DESCRIPTION:
The Task object encapsulates an AutoMate™ task. Upon executing an AutoMate™ BASIC script, AutoMate™ automatically creates an instance of Task called CurrentTask that contains the information from current task being executed. Using the CurrentTask object, a task has the capability to modify itself from with the scripting language. Using the Task Object in the scripting language, AutoMate™ could create new tasks as well to respond to certain conditions. You may create additional instances of the Task within AutoMate™ Basic scripts as necessary.
Properties
TaskName |
Read/Write |
Variant |
Task Name |
LaunchDate |
Read/Write |
Variant |
Launch Date in the system ShortDate format |
LaunchTime |
Read/Write |
Variant |
Launch Time |
Frequency |
Read/Write |
Integer |
Task Execution Frequency |
IntervalType |
Read/Write |
Integer |
Task Execution Frequency |
Interval |
Read/Write |
Integer |
Task Execution Frequency in IntervalTypes |
RunLate |
Read/Write |
Integer |
Controls Run Action When Task is Overdue |
ScheduleLate |
Read/Write |
Integer |
Controls Rescheduling When Task is Overdue
|
Active |
Read/Write |
Integer |
Controls Task Execution |
Triggers |
Read/Write |
Integer |
Task Triggers; combination of the following values: |
Hotkey |
Read/Write |
Variant |
Trigger Hotkey |
WindowName |
Read/Write |
Variant |
Trigger Window Title |
StepCount |
Read Only |
Integer |
Number of Steps in Task |
TaskData |
Read/Write |
Variant |
Task Data in Raw, Internal Format |
Details |
Read/Write |
Variant |
Task Details |
FrequencyString |
Read Only |
Variant |
Task Frequency Display String |
Events |
Read/Write |
Integer |
Windows Events to Trigger On; combination of the following values: |
Function GetTaskStep (StepNo As Integer) As Variant
Retrieves the string containing the specified task step. The first step is numbered 0. The string contains the task step command and parameters in the format that appears in the AutoMate™ step windows.
Example:
Sub Main
x = CurrentTask.GetTaskStep(0)
MsgBox x
'CurrentTask.DeleteTaskStep(1)
CurrentTask.AppendTaskStep(1, x)
End Sub
Function GetStepCommand (StepNo As Integer) As Variant
Retrieves the string containing the specified task step command. The first step is numbered 0.
Function GetStepParamCount (StepNo As Integer) As Integer
Retrieves the number of parameters in the specified task step.
Sub SetTaskStep (StepNo As Integer, NewAction As Variant)
Changes the specified task step. The NewAction parameter must be passed in the correct format for the new step to be valid.
Example:
Sub Main
CurrentTask.SetTaskStep(1,"OPEN")
End Sub
Function GetStepParameter (StepNo, Parameter As Integer) As Integer
Retrieves a string containing the specified task step parameter. The first step is numbered 0 and the first parameter is numbered 0.
Example:
Sub Main
X = CurrentTask.GetStepParameter(1,0)
End Sub
Sub AppendTaskStep (Action As Variant)
Adds a new task step. The Action parameter must be passed in the correct format for the new step to be valid.
Example:
Sub Main
x = CurrentTask.GetTaskStep(0)
MsgBox x
'CurrentTask.DeleteTaskStep(1)
CurrentTask.AppendTaskStep(1, x)
End Sub
Sub InsertTaskStep (Before As Integer, Action As Variant)
Inserts a new task step before the specified step. The Action parameter must be passed in the correct format for the new step to be valid.
Example:
Sub Main
x = CurrentTask.GetTaskStep(1)
CurrentTask.InsertTaskStep(3, x)
End Sub
Sub DeleteTaskStep (StepNo As Integer)
Deletes the specified step.
Example:
Sub Main
CurrentTask.DeleteTaskStep(3)
End Sub
Function GetStepStatus (StepNo As Integer) As Integer
Retrieves the status flag for the specified task step. A return value of 0 means the step is disabled (skipped), 1 means the step in enabled.
Example:
Sub Main
x = CurrentTask.GetStepStatus(1)
MsgBox x
End Sub
Function SetStepStatus (StepNo, Status As Integer) As Integer
Sets the status flag for the specified task step. Setting Status to 0 means the step is disabled (skipped), 1 means the step in enabled.
Example:
Sub Main
CurrentTask.SetStepStatus(1,1)
End Sub
Sub ClearSteps
Deletes all steps from the task.
Example:
Sub Main
CurrentTask.ClearSteps
MsgBox CurrentTask.TaskData
End Sub
Sub SaveToFile (FileName As Variant)
Save the task data to a file.
Example:
Sub Main
CurrentTask.SaveToFile("c:\testtask.txt")
End Sub
Sub LoadFromFile (FileName As Variant)
Loads the task data from a file.
Example:
Sub Main
CurrentTask.LoadFromFile("c:\testtask.txt")
End Sub
Related Topics: