User Guide/The Script Controller: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
[[File:ws_sc.png]] | [[File:ws_sc.png]] | ||
The '''Script Controller''' is a subdialog of the {{STX}} Workspace GUI, displayed in the upper right part of the window, and provides a convenient way to run {{STx}} scripts. | The '''Script Controller''' is a subdialog of the {{STX}} Workspace GUI, displayed in the upper right part of the window, and provides a convenient way to run {{STx}} scripts. | ||
To hide or show the {{STx}} Script Controller, use the Workspace menu item '''Scripts > Show Scripts'''. | To hide or show the {{STx}} Script Controller, use the Workspace menu item '''Scripts > Show Scripts'''. | ||
Note: The [[Detailview_Find_Select|Find / Select dialog]] for the detail view is displayed in the part of the GUI. Only one of both dialogs can be visible. | |||
;Note: The [[Detailview_Find_Select|Find / Select dialog]] for the detail view is displayed in the part of the GUI. Only one of both dialogs can be visible. | |||
===Dialog Elements: | |||
===Running a script=== | ===Running a script=== |
Revision as of 16:01, 18 January 2016
The Script Controller is a subdialog of the STx Workspace GUI, displayed in the upper right part of the window, and provides a convenient way to run STx scripts.
To hide or show the STx Script Controller, use the Workspace menu item Scripts > Show Scripts.
- Note
- The Find / Select dialog for the detail view is displayed in the part of the GUI. Only one of both dialogs can be visible.
===Dialog Elements:
Running a script
To run an STx script from the mighty STx Script Controller, do the following:
- Select a script file by clicking the "Script File" button. STx will provide you with a file selection dialog labelled "Select script file" allowing you to tell STx which script file to use.
- Choose the macro to be run from the "Macro" combobox. In this comobox, STx lists all macros available in your script file.
- If your macro expects arguments, provide them in the "Arguments" field.
- To finally execute the macro, either press the button, or choose the menu item "Scripts > Run", or just press the Enter key while in the "Arguments" combobox.
You can also add scripts and store their arguments in the "Application & Setup Tree" under the entry Scripts.
Debugging a script
Just check the "Debug" checkbox. Now when you execute the script, the STx debugger will automatically open.
Command History
A history of arguments passed to the script is stored and can be retrieved by selecting an entry from the "Arguments" combobox.
The Console
If you press the Console button, the Console application is started. The Console is a command line interface to an STx shell.
The Console can:
- process commands on a line by line basis
- process multiple commands pasted from the clipboard
- maintain a command history (up/down keys)
The Console cannot:
- process IF or WHILE control statements
The Console implements the following additional commands:
- exit
- cls|clear
- cd
- pwd
- ls
- log
- list
- setcon
- stx
- sts
- use
Other ways to select / run STx Scripts
- Script files can be added to the Script section of the The Application & Setup Tree of the Workspace. Scripts stored in the workspace can be started quickly and its also possible to edit or debug the scripts and to assign startup arguments. To add a script file, drop it on the workspace window (file extion: .sts) or use the context menu.
- You can also open the STx Console to run a script via the command line.
- If a script file filename.sts is dropped on the workspace, a dialog comes up to select a function for the script file:
- Add the file to the [[User_Guide/Workspace/Application_and_Setup_Tree|The Application & Setup Tree]
- Run the macro filename defined in the script file
- Select the script file as the current file of the Script Controller
- Edit the file filename.sts
The Console was added to STx in version 3.9. It is currently in its baby shoes, so please be nice to it, and report any misbehaviour.