Script Action

image\Action_Programming_Script.jpg

A Script Action allows you to write an OpusScript statement or list of statements in an Editor window on the Script Action tab. A Script Action can be added to any object that appears on the page, just like any other action. This action is particularly useful for calling functions contained in a Script Object.

Note:
Any object that contains a Script Action can also contain other actions; this action can also be part of a Simultaneous Action Group action.

To add a Script Action to an Object:

1. Add the Script Action to your trigger, as described in adding actions. The Script tab will automatically appear when you add the action.

2. Type your script in the Editor window. Press the Enter key on the keyboard to insert a new line in the window.

Note:
Below the Editor window is an Error Message Line – if the expression entered in the window is syntactically correct the message will read Expression OK; if the message reads Expression contains errors, then at least one line of code in the editor is syntactically incorrect i.e. it is not a valid OpusScript statement

3. Click on the down arrow to the left of the EasyCode button to list the most commonly used functions in a script. Select the function from the list you require and then click on the EasyCode button image\Icon_Button_EasyCode.jpg to place a skeleton code with the correct syntax in the Editor window – you can then quickly and appropriately complete it.

4. Click on the Apply button to save your changes.

Note:
The Script Action is often used to test a condition which would be too complex for the standard Programming action or to call a function in a Script Object – see Script Action vs. Script Object in the Script help file for more information.

Related Topics:

Introducing the Programming Actions

Choosing an Action