Application Guide

520 Writing Lua Scripts
Note:Replace img_1 (above) with the name of your image.
2. Click Set Script to save the script. You will see your image in the Document Preview
screen.
3. Click Focus Script to set the focus to the page in the document where you want to
attach the script application.
Note: A TI-Nspire document sets the focus to the page; A PublishView document
sets the focus to the frame on the page.
Create a Script to Call Up Multiple Images
1. Type a script in the script line box as follows:
myimg = {}
for name, data in pairs (_R.IMG)
myimg [name] = image.new(data)
end
function on.paint (gc)
gc:drawImage (myimg[imagename], 30, 30)
end
2. Click Set Script to save the script. You will see your image in the Document Preview
screen.
3. Click Focus Script to set the focus to the page in the document where you want to
attach the script application.
Note: A TI-Nspire document sets the focus to the page; A PublishView document
sets the focus to the frame on the page.
Setting Script Permissions
You can set permission levels for a script and specify a password to protect a script.
Follow these steps.
1. In the Script Editor window, click File > Set Permissions.
The Set Permissions dialog box opens.
2. In the Permissions Level area, select the appropriate security level:
Protected. The script can be run, but not viewed or edited.
View only. The script can be viewed, but not edited.
Unprotected. The script can be viewed and edited.
3. To secure a script, designate a password in the Security area.
Note: Use caution when setting passwords because they cannot be recovered.
4. Click OK.
The next time you click Insert > Script Editor > EditScript, a Password Protected dialog
box opens prompting for the password. Choose one of these options: