Other Content

Table Of Contents
526 Writing Lua Scripts
3. Click Insert > Script Editor > EditScript.
The Script Editor opens showing the script. If the selected work area on the
page does not contain a script, Edit Script is dimmed.
If the script is password protected, the Password Protected dialog box
opens prompting for a password.
4. Make any desired changes.
To designate comments, use double hyphens (--) at the start of each
comment line.
To change the title, click Edit > Set Script Title or right-click the title and
click Set Script Title.
Notes:
Some nonstandard UTF-8 characters may not be displayed correctly.
For these characters, it is highly recommended that you use the
string.uchar function.
The print function may yield unexpected results for nonUTF-8
characters.
Some nonprintable characters returned by the on.save function will be
discarded.
5. To execute the script, click Set Script.
Any errors are displayed in the Console area in the Tools panel.
6. To view the script application (running script), click Focus Script.
Changing View Options
To change viewing options:
To clear the scripting data in the Tools panel and restore the editor defaults,
click View > Restore Editor to Defaults.
To view the script title in the document and before each print statement in
the Console, click View > Title in Document View.
To hide or show toolbar labels, click View > Toolbar Text Labels.
To show or hide the Tools panel or its areas, click View > Tools Panel and
click the appropriate option.
To create tab groups when multiple scripts are open, right-click one of the
titles and click New Horizontal Group or New Vertical Group.