Scripting in Appraise-It Pro
Before writing custom scripts, make sure you've enabled the Development tab for access to the Field Details Pane.
Overview
Appraise-It Pro uses the MoonSharp Lua interpreter to run scripts written in the Lua scripting language.
There are some minor differences from the original Lua scripting language, mainly to support interoperability with the .NET Framework Appraise-It Pro is built upon. You might want to familiarize yourself with these differences and additions.
Scripting API Access
ScriptingProxy exposes the core methods and properties that make up the scripting API. An instance of this class is always accessible via one of two global variables: pro
or Pro
.
For example, the command Pro.SelectedTextField.Text
uses ScriptingProxy's SelectedTextField method to access the text of the active field in Appraise-It Pro.
Writing a Custom Script
You can write scripts in any text editor or integrated development environment (IDE). For example, Notepad++ is a powerful free text editor that supports Lua syntax highlighting.
Once you've written a script, save it in the Scripts
folder within Appraise-It Pro's data folder. Scripts should be plaintext files ending in .lua
.
Where is my data folder?
If you're not sure where your data folder is located, follow these steps.
- Launch Appraise-It Pro.
- In the Backstage view, click the Settings tab.
- Click the Folders tab.
The location of your data folder is displayed in the Data folder field.
Running a Custom Script
Once a custom script is saved to your Scripts folder, there are three ways to run them within Appraise-It Pro:
- On the Tools tab, click the Script button to launch a file browser dialog in your Scripts folder; select the script file you want to run and click Open.
- On the Tools tab, click the Script button dropdown to access a menu of all files in your Scripts folder; select the script you want to run.
- Press Ctrl + M to launch a file browser dialog in your Scripts folder; select the script file you want to run and click Open.
The script will execute. If you wish to stop the script, click Cancel in Appraise-It Pro's status bar.