The Action object is passed into Script Events. The methods and properties available on the Action object are as follows:
Method Call | Example | Description |
---|---|---|
<br>procedure SetLogTitle(value As String)<br> |
<br>Action.SetLogTitle("Building...");<br> |
Allows you to set the title of the Automise log. |
<br>procedure SendLogMessage(MessageText As String)<br> |
<br>Action.SendLogMessage("Built!");<br> |
Sends a message to the output window. |
<br>procedure Echo(MessageText As String)<br> |
<br>Action.Echo("Built!");<br> |
Same as SendLogMessage (see above). |
<br>procedure SendProgress(Value As String, progress As Integer)<br> |
<br>Action.SendProgress("Help Built.", 60);<br> |
Sends a progress message to the Run Status window. This enables the action to report it's progress as it's executing. Progress is a percentage and should therefore range between 0 and 100. |
Method Call | Example | Description |
---|---|---|
<br>function ExpandExpression(expr As String) As String<br> |
<br>var exePath = Action.ExpandExpression("%ProjectDir%\\MyExecutable.exe");<br> |
This expands the string passed in by substituting Automise variables when %<variable>% is encountered. |
<br>function ChildActions(index As Integer) As OleVariant<br> |
<br>var child = Action.ChildActions(1);<br> or <br>for (var i = 0; i < Action.ChildActionCount - 1; i++){ <br> <br> var child = Action.ChildActions(i); <br> <br> if (child != null){ <br> <br> if (child.ActionName === "Compile Delphi Win32 Project"){<br> <br> child.CompilerOpt.DebugInfo = IncludeDebugInfo;<br> <br> }<br> <br> }<br> <br>}<br> |
Allows access to child actions, index is zero based. Use ChildActionCount property to get a count of the child actions. In the second example the script turns off debug info on all child Delphi compiler actions. Add this code to the BeforeAction event handler of the parent action typically a group action. |
<br>function Parent As OleVariant<br> |
<br>var parent = Action.Parent();<br> |
Returns the Parent action of the current action. This will return null for root level actions. |
Method Call | Example | Description |
---|---|---|
<br>property ActionComment As String<br> |
<br>var curActionComment = Action.ActionComment;<br> |
Provides access to the action comment. |
<br>property ActionLogTitle As String<br> |
<br>Action.LogTitle = "Full Build - VB6";<br> |
Allows you to change the title of the action's entry in the output window. This has no effect if set from the AfterAction event (since the log entry has already been made.) |
<br>property ActionName As String<br> |
<br>var curActionName = Action.Name;<br> |
Provides access to the Action's name |
<br>property ChildActionCount As Integer<br> |
<br>var curChildCount = Action.ChildCount;<br> |
Returns the number of Child Actions the action has. |
<br>property Description As String<br> |
<br>var description = Action.Description;<br> |
Provides access to the Action's description |
<br>property IgnoreFailure As Boolean<br> |
<br>Action.IgnoreFailure = true;<br> |
Provides access to the Action's IgnoreFailure flag |
<br>property LogToVariable As String<br> |
<br>Action.LogToVariable = "ActionLog";<br> |
Provides access to the Action's LogToVariable flag |
<br>property PauseInterval As Cardinal<br> |
<br>Action.PauseInterval = 100;<br> |
Provides access to the Action's PauseInterval property |
<br>property SuppressStatusMessages As Boolean<br> |
<br>Action.SuppressStatusMessages = false;<br> |
Provides access to the Action's SuppressStatusMessages property |