Runs an embedded or external BASIC script or creates a user defined function which may be called in subsequent expressions or BASIC scripts. BASIC scripting can be used for advanced flow, COM objects, API calls and the creation of custom dialog boxes.
This action includes a BASIC Script IDE which is an Interactive Design Environment used for developing, examining, testing and executing BASIC scripts. To access the BASIC Script IDE, click Edit Script located in the BASIC Script action's General tab properties.
AWE's built-in AML language is easy to use, includes drag-and-drop functionality and very robust, however there may be occasions when it is necessary to use BASIC scripting to access advanced objects or increase execution time. This action is ideal for such occasions.
Declaration
<AMSCRIPT FILENAME="text"></AMSCRIPT> OR <AMSCRIPT>Script text</AMSCRIPT>
Example
<AMSCRIPT FILENAME="C:\Logs\Macro.bas"></AMSCRIPT>
- or -
<AMSCRIPT>Sub Main MsgBox("Hi")End Sub </AMSCRIPT>
To enter Basic Script properties:
In the Available Actions pane, expand the Advanced folder and double-click the 'Basic Script' action or drag this action onto the Steps pane.
In the Location of script parameter of the General tab, select one of the following drop-down options then enter the applicable properties:
Script is embedded in task file. If this option is selected, click Edit Script to open the BASIC Script IDE, which helps in writing, debugging, and testing your AWE BASIC script.
Script is located in an external file: If this option is selected, click Open Folder and navigate to the script (.bas) file.
To set the Description tab properties, refer to Description Tab Options.
To set the Error Causes and On Error tab properties, refer to Step Error Handling.
When finished, click OK to save settings and close the properties dialog box.
See Also
Introduction to Scripting, BASIC_Script_IDE, Execute DLL, Run, Create Array, Create Variable
Property |
Type |
Required |
Default |
Markup |
Description |
Location of script |
Text |
Yes |
(Empty) |
FILENAME= "C:\Temp\myScript.bas" |
Specifies where the script is located. The available options are:
Click the Folder icon to navigate to the desired external .BAS file or manually enter the full path and filename of the.BAS file in the provided text-box. Click Edit Script to access the BASIC Script IDE, an Interactive Design Environment used for developing, examining and testing BASIC scripts. |
The Description tab allows you to customize the text description of any step when it appears in the Steps Pane.
More on setting custom step description
The Error Causes tab properties are part of AWE's Error Handling functionality which allows you to instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.
More about error causes properties
The On Error tab properties are part of AWE's Error Handling functionality which allows you to determine what a task should do if a particular step encounters an error.
More about On Error properties
All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, % Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.
More on the expression builder