Working with Scripts


The Pro Script module extends Mira's image processing capabilities using a scripting language based on the Lua language (see http://www.lua.org). This architecture provides a complete script processing engine that can be used to extend Mira's image and data processing capabilities as well as performing general types of computing that do not involve Mira tools or image data. The script language itself is described in a separate document, the Pro Script User's Guide. The current topic describes how to work with scripts in Mira. Complete documentation on script functions, classes, methods, and other features, is found in the Pro Script User's Guide.

Overview

For viewing, creating, and modifying scripts, Mira provides the Script Editor. The Script Editor is a special kind of text editor that highlights the different language elements according to patterns and rules. The script editor uses several styles to display different types of syntax. This syntax highlighting makes the script more human-readable but it does not actually affect the script text itself. Scripts can be executed, or "run", using the [ ! ] button on the Script Editor Toolbar and the Main Toobar, or from the Script Manager.

When running a script, Mira loads the text directly from a file or from the Script Editor. This text is fed to the Lua engine, which compiles the text to byte code and executes it. The sections below describe how to create, open, save, and run scripts in Mira.

Creating a Script

To create a new script, do one of the following. These actions open an empty Script Editor:

Opening an Existing Script

To open a script from a file, do one of the following. These actions load the existing script into a Script Editor:

Saving a Script

Scripts are saved to text files with a lua file extension. You can choose to save scripts in the ...\Mira Pro 7 UE\Scripts folder tree or anywhere in your file system. If you choose to save them outside the ...\Mira Pro 7 UE\Scripts folder tree, then they will not be accessible from the Script Manager. To save a script, use one of the following methods:

Running a Script

For detailed information about running a script, see Running Scripts. Essentially, there are 3 ways to run a script:

Related Topics

Script Editor, Script Manager, Running Scripts, Contents