Overview of OpusScript

Opus Pro includes a full scripting language for developers which allows even more sophisticated combinations of actions to be created than with the presets built into the Opus interface.

It is intended as a way of writing self-contained functions and extensions to the functionality provided in the core of the program and not as a replacement for a full-blown programming language.

You can either write the script in the simple Script Editor provided by Opus or write it in an External Editor and import it into your publication.

OpusScript provides developers with four distinct advantages:

  1. Greater control of objects on a page. Scripts can be added to a page or to any object on a page, such as a frame, button, text, image, slideshow etc. Many functions have been created that allow you to change the properties and actions of objects on a page.

  2. Increased mathematical functionality and data manipulation. Complex calculations can be written in OpusScript as well as manipulation of strings of text.

  3. Enhanced variable control. System defined or user-defined variables created via the Actions Editor can be used within OpusScript. You can also set OpusScript expressions for system and user-defined variables.

  4. Interaction with Databases. Information stored in databases can be used or manipulated within OpusScript; the new values created in OpusScript can then be written back to the database using the new database facilities.

Scripts written in OpusScript are fully web-compatible, any script written in your publication will run inside a browser in exactly the same way as on a stand-alone machine or over a network. (The exception to this is any functions that access files on disk or write to the system registry. These are disabled in the web plug-in for security reasons).

When publishing to Flash format using the Flex publication type you can also write Flash Actionscript into a script object and this will be passed through to the Flash player. Note however that you cannot use Actionscript to command Opus objects as Flash does not recognised Opus objects.

Note:
Many of the OpusScript functions provided are copies of actions that you can add to pages or objects in your publication using the Actions dialog. This is useful, because if you are creating a complex formula using OpusScript, you can also run an action for a page or object without leaving your script. Furthermore, you can mix-and-match, in other words, you can create a script for some actions and use the Actions dialog for others.

Related Topics:

Getting Started

Where do I write my OpusScript?

Overview of OpusScript Syntax

Overview of Script Functions