The CurrentTask2 object encapsulates the properties of a task, and methods that act upon that task.
Description
The CurrentTask2 object contains properties and methods to allow you to view and modify attributes of the currently executing task. Use this object to control specific parts of the executing task “on the fly.”
The CurrentTask2 object provides all the functionality of the CurrentTask interface provided with previous versions of AutoMate™, but also offers extended capabilities that encapsulate the new features available in newer releases of AutoMate™. The CurrentTask2 interface should be used instead of the CurrentTask interface in newer scripts. The CurrentTask2 interface is still available for backward compatibility.
When a script is started, AutoMate™ automatically instantiates an CurrentTask2 object and populates it with the properties of the currently running task. This object is referred to as “CurrentTask2.” Use CurrentTask2 to access and modify the properties of the currently running task, as well perform actions on the task such as rescheduling or saving it to a file.
Remarks
When creating or altering steps for the currently running task the format must be the same as steps inside the Step Builder.You must make sure that all string paramaters are inside double quotes correctly. Here is an example of the correct way to format the string for AutoMate™.
varNewStep = "START: ""C:\Windows\Notepad.exe"","""",0,""c:\"",0,1,0,"""""
CurrentTask2.AppendTaskStep(varNewStep)
Notice the use of double quotes around strings. All methods in CurrentTask2 will require this in order for AutoMate™ to be able to use the new step.