The Console: Command Line and Script Editor

To open the console, choose Tools > Console. On the left half of the console window you can see four areas. Starting from the top, there is the log area, with the history of the current session; under it there is the input area; below that, the output area, shown without borders and with a gray background. At the bottom there can be an optional double row of shortcut buttons.
On the right you can see the controls. This page describes the actions associated with these controls, but first, here are the keyboard shortcuts that make working with the console easier.

Command Key on the Keyboard
Redraw spectrum. Many commands that modify the spectrum do not automatically update the display. Esc
Previous command. Recall previously entered commands. Up and Down Arrows
Next/Previous line Control - Arrows
New line. Control - Carriage Return
Copy output back to the input area. Page Up or Page Down
Execute code. Return
Command Console Button
Apply every command to all open spectra.
When executing a script, if this option is on, every command is performed on all the open documents before moving on to the next statement. Functions that return a value represent an exception, because they return the value from the frontmost spectrum only.
For All Documents
Save the current session (limited to the last 20 statements) in the active document. If the document already contains a saved script, that script is opened in your default editor instead. Disk Icon
Reload the session saved in a document. Folder Icon
Amplify / De-amplify the spectrum. Little Arrows
Copy the text of the log area (the history of the session). Copy
Consult the list of iNMR commands.
The Lua website contains a complete list of the basic Lua functions.
Question Mark
Resize the Console. Zoom or Resize
Execute the chunk of code in the input field. Run

The command line gives you a great deal of freedom, including the freedom to do something irreversible. Since console actions can be irreversible, remember to save your documents frequently. If something goes wrong, you can revert to the most recently saved copy.

Related Topics

Setting Up iNMR to Run the Scripts

Minimal Lua Primer