Control Structures

do

Supported By

Syntax

do script [as scriptingLanguage]

Description

The do statement causes the XION interpreter to execute the specified string as an XION script. The string is executed as though it were inserted in place of the do statement.

The as scriptingLanguage form causes the XION interpreter to execute the specified string as a script in some other scripting language. HyperTalk supports AppleScript as well as any OSA-compliant scripting component. OpenXION supports AppleScript on Mac OS X, VBScript on Windows, and bash, Perl, PHP, Python, and Ruby on Mac OS X and other systems other than Windows. The XION Scripting Language Standard does not require support for any particular external language; only support for the syntax.

Security

To execute arbitrary XION code, OpenXION's security settings must allow the DO_AND_VALUE security key. To execute code in other scripting languages, OpenXION's security settings must allow the EXTERNAL_SCRIPTS security key. If the required security key is denied, a script error will be triggered.