Getting Started

OpusScript can be used to extend the functionality of Opus in a number of ways.

  1. It can be used to create a single line expression similar to those found in Illuminatus 4.

  2. It can also be used for simple loops in which actions (i.e. OpusScript functions) are repeated a set number of times or only while a particular condition is met.

  3. Alternatively, and most useful of all, scripts can be used to combine a whole series of actions into your own user-defined functions which can be used again and again simply by calling that function. Effectively this allows you to write your own custom actions.

Below are brief descriptions of the main areas of this OpusScript Help file. Depending on your experience in programming, you may want to start at a different section in the help file. For example:

  1. New users – if you are new to programming you will need to understand more about the language and protocols used to write a script and would probably start in the OpusScript syntax section.

  2. Experienced users – may prefer to start with the functions provided by Opus (to see what’s on offer) and would start in the OpusScript functions section.

Note:
Before you start using OpusScript, you should be familiar with using Opus itself. In other words, you should understand how to: create a publication; add a page; add objects to a page; set the properties of a publication, page or object; and how to add actions and triggers to a page or object. These are all described in the main Opus Help file – to open the help, select Contents & Index from the Help menu.

Adding a Script to your publication

Before you familiarise yourself with the commands and the syntax of OpusScript, it is useful to know how to incorporate scripts into your publication. There are two methods of adding a script to an Opus Pro publication:

Add a Script Object to a Page The Script Object will appear in the Organiser on the left-hand side of the screen. Like the Timeline feature, the Script Object does not appear as an object on a page.

Add a Script Action to an Object on a Page The Script action works like any other Action for an object, that is, the Action is assigned to a Trigger i.e. double-click on the Script action or drag the Script action icon onto the Trigger in the Actions Organiser.

OpusScript Syntax

Before you can use OpusScript you will need to understand how the language is structured, in other words how you layout the commands and functions so that the script understands what you want. And the basic commands used in the language to assign values or to control the activity of the program. This is called the syntax of the language. As OpusScript is based on the same base language as JavaScript 1.1 they share the same syntax and some basic commands, so anyone familiar with JavaScript need only learn the OpusScript functions.

OpusScript Syntax

OpusScript Reference List

As an aide memoire, we have provided the OpusScript functions in an alphabetical list for quick reference. There is also a separate list for the Database, Date and Math functions. Each list contains the function name, the category to which they belong and a one line description. You can click on the name of the function to open the full description of the function.

Overview of Reference Lists

OpusScript Functions

This section describes all of the OpusScript functions we provide. These are listed in different categories, each one is specific to a type of object in Opus, for example, the Text section contains functions specifically related to Text and Input Text objects. Please note, that other categories in this section can also be used by a variety of objects, for example, Text objects can also use the functions in the Graphical Objects section – this is described in the Overview topic within each section.

Overview of OpusScript Functions

Related Topics:

Overview of OpusScript