Application Guide

516 Writing Lua Scripts
Using the Status Bar
The status bar at the bottom of the window shows basic script data, as described in
this example:
stopwatch, 1.1,4:1,Running
Name of the document that the script application is attached to (stopwatch)
Problem and page number (1.1)
Script line and character, (4:1 describing line 4 and character 1)
Operational state of the script (Running). Note the possible states:
- Normal mode: Running, Paused, or Error
- Debugging mode: Running (debugging), Paused, or Error
Inserting New Scripts
To insert a new script application and script, follow these steps.
1. Open the document where you want to insert the script. It can be a new or existing
document.
2. Click Insert > Script Editor > Insert Script.
A script application is inserted, and the Script Title dialog box opens.
Note: The TI-Nspire™ CX Student Software and the TI-Nspire™ CX CAS Student
Software open automatically within the Documents Workspace.
3. Type a script title. (The maximum number of characters is 32.)
4. Click OK.
The Script Editor window opens showing a blank script.
5. Type your text in the script lines.
Note: Some nonstandard UTF-8 wide characters may not be displayed correctly.
For these characters, it is highly recommended that you use the string.uchar
function.
6. When the script is complete, click Set Script to execute it.
In a TI-Nspire™ document, the script application is inserted in a new page.
When the page containing the script application is active, the Documents
Toolbox is empty.
In a PublishView document, a frame containing the script application is added
to the active page. You can move or size this frame just as you would any other
PublishView object, and you can add other PublishView objects to the page.
7. To view the script application, click Focus Script.
Zooming Text in the Script Editor
You can adjust the size of the text in your script and in any of the tool panels.