Add a Script Object to a page

A Script Object is like a Timeline object in that it does not appear on the page itself, like a Button object or an Image object. It is also like a Timeline object because it can make things happen, such as, showing and hiding object or playing a sound. However, unlike a Timeline object that uses actions that you place on a timeline, a Script Object uses the OpusScript functions to make things happen.

Note:
Once you have added a Script Object to a page, the Script Object window will appear – see Script Object window for more information.

To add a Script Object to a page

    1. Open the page from the Organiser on which you want to add a Script Object.

    2. Select Script Object from the Insert menu. A Script Object window will appear over the top of your displayed page.

    3. Enter your Script in the Script Object window.

Note:

Script Objects can only be added to a page or an individual object on a page, they cannot be added to a publication or chapter. Adding a Script Object to an object on a page is generally for advanced users only, so it is recommended that you begin by placing your script object only on the page.

    1. The script in a Script Object is automatically saved when you close the Script Object window.

Renaming Script Objects

  1. Every Script Object inserted on a page is added to the Objects tab of the Organiser. By default, the first Script Object added is given the name Script 1, the second Script 2, and so on.

  2. You can rename, reposition, cut, copy and paste a Script Object in the Organiser in the same way as other objects.

Note:
For example, to re-name a Script Object, left-click on its name to highlight it, left-click again on the highlighted name and a text edit box will appear, you can now enter a new name. Press the Enter key or click elsewhere in the workspace to accept the name. Alternatively, you can select Rename from the right-click mouse menu when the Script Object is highlighted.

  1. Script Objects are attached to a page, but they do not appear physically on a page like an object, such as a Button object or an Image object, and therefore do not have actions or properties that you can set.

Starting a Script Object

        1. Script Objects are run automatically as soon as you enter a page.

        2. If more than one Script Object is added to a page, the first script to be processed is the Script Object that appears lowest in the list in the Objects tab of the Organiser.

Note:
There is usually no reason to have more than one Script Object on a page; therefore, we advise you only enter one Script Object per page to begin with.

        1. If you have entered Script actions in object’s on a page that are triggered by the On Show trigger, the same rule as in point 2 above applies. In other words, the Script actions or Script Objects that are listed lowest in the Organiser will be the first script processed.

Editing a Script Object

  1. To edit a Script Object, double-click on the name of the Script Object in the Objects tab in the Organiser to open the Script Object window.

  2. Alternatively, right-click on the name of the Script Object and select Edit from the right-click menu.

Closing the Script Object

  1. To close the Script Object window, click on the close button image\Close_Button.jpg in the top right-hand corner of the Script Object window

  2. Alternatively, double-click on any other object in the Objects tab of the Organiser.

Copying Script Objects

Within the Organiser, Script Objects can be copied, cut and pasted from the current page to a new page in the publication in the same way as other objects.

Note:
A copied version of a Script Object can be edited without affecting the original version.

Tip:

If the same Script Object is required for more than one page in your publication, save the Script Object as an external file and import the file into a Script Object for each page.

If a Script Object on one page will be similar but NOT the same as a Script Object on another page, make a copy of the Script Object and then edit as required – see External Scripts for more information.

Related Topics:

Add a Script Action to an object

Script Objects versus Script Actions