Programming interface (API)
Menu bar |
Keyboard shortcut |
---|---|
Edit > Scripts |
Ctrl + J |
The Front Panel Designer includes a programming interface (API) that you can use to formulate action sequences as executable scripts. The script language used is JavaScript.
All actions described below are executed in the scripting window (Edit > Scripts). The window opens in a reduced view. Use the >> button above the list of scripts to open the full view with the integrated script editor.
Interface documentation
You can find the programming interface documentation (PDF) here.
Running a script
Running a listed script:
Marking a script
Click Start
Run external script:
Click PastePad
Paste code into the editor that opens
Click Start
When a script is run, results of the script, output of the print()
function, and error messages are displayed in the Output field.
After the script is run, the front panel that has been edited or created is displayed in Front Panel Designer’s workspace.
Creating/editing a script
To create a new script, click New.
To edit an existing script, highlight the script in the directory tree.
Then open the integrated script editor with the >> button.
You can run the edited script at any time (Start button), save it in the meantime (Save button), or create it as an additional script under a new name (Save as button).
In the PastePad, you can individually test created or pasted rows at any time (for example, variants of a specific milling element).
To change a user script’s file name, highlight the script and click Rename.
Adding an external script
To transfer an external script (file extension .fpjs) to the file list, click Add. Alternatively, add the script directly to the user scripts directory (file path, see below) and then update the file list in the scripting window.
Managing scripts
All scripts that were either created by the user (User scripts) or supplied with Front Panel Designer (FPD scripts) are displayed in the upper area of the scripting window.
The user scripts are stored under the following path:
Windows: %APPDATA%FrontDesignScripts
Mac: $HOME/.FrontDesign/Scripts
Mac: $HOME/.FrontDesign/Scripts
If you have changed the contents of the corresponding path, for instance, using a file manager, you can apply the changes via the Update button above the script directory.