BASIC Script

Declaration

<AMSCRIPT FILENAME="text"></AMSCRIPT> OR <AMSCRIPT>Script text</AMSCRIPT>

See Also

The BASIC Language All Groups | Execute DLL | Run | Enable/Disable Task | Create Array | Create Variable | Call Function | MSMQ (Microsoft Message Queuing) | Microsoft SharePoint | AS2 (Applicability Statement 2) | Amazon EC2 (Elastic Compute Cloud) | Amazon RDS (Relational Database Service) | Amazon S3 (Simple Storage Service) | Amazon SimpleDB | Amazon SQS (Simple Queue Service)

Description

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 the Edit Script button located in the BASIC Script action's General tab properties.

Practical Usage

AutoMate'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.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Location of script

Text

(options)

Yes

(Empty)

FILENAME=

"C:\Temp\myScript.bas"

Specifies where the script is located. The available options are:

  • Script is embedded in task file

  • Script is located in an external file.

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 the Edit Script button to access the BASIC Script IDE, an Interactive Design Environment used for developing, examining and testing BASIC scripts.

Description Properties

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

Error Causes Properties

The Error Causes tab properties are part of AutoMate'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

On Error Properties

The On Error tab properties are part of AutoMate'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

Additional Notes

Variables and Expressions

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 variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Sample 1: Run script file C:\Logs\Macro.bas.  

<AMSCRIPT FILENAME="C:\Logs\Macro.bas"></AMSCRIPT>

 

Sample 2: Run embedded script.  

<AMSCRIPT>Sub Main MsgBox(&quot;Hi&quot;)End Sub </AMSCRIPT>

↑ Top of Page