Actions are very common in every application. You meed them often when you use any application. Clicking on a toolbar icon, selecting a menu item or using a shortcut usually executes an action. In Quanta Plus actions are taken to the next level. Instead of hardcoded actions (that are created by the application programmer at the source code level) it is possible for the ordinary user to create and modify actions and by this way adding new functionality to Quanta Plus. These are the user defined actions, and many of the standard Quanta Plus actions are user defined (and user modifiable) actions as well.
There are three types of user definable actions:
You can create an action by going to -> . Click on and you will face a similar dialog:
The user visible name of the action.
The icon assigned to this action. Click on it in order to change the current icon.
Short description of what the action does.
The shortcut assigned to this action. Click on Custom or the button near Custom to assign a shortcut; click on None to remove the currently assigned shortcut.
The user defined toolbars where this action appears. See the section called “Creating Toolbars”.
Specific settings for the different type of actions. See below.
Useful to insert XML tags, but of course you can use them for other purposes as well.
The name of the tag.
If checked when the action is executed this text will be inserted as a closing tag. If there is a selected area in the document before you execute the action, the <tag> will be inserted before the selected area and the </tag> after.
If checked and there is a tagXML file for this tag, a tag editing dialog will be shown prior of inserting the tag inside the document, so you can fine-tune the tag attributes.
First you have to enter the name of your script with the interpreter as well. Example: sh /home/myHome/myScript.sh.
Although you can use full paths, the recommended way is to use the %scriptdir variable in the command line, like sh %scriptdir/myScript.sh. This way Quanta Plus will try to locate your script in the following places:
global script folder: $TDEDIR
/share/apps/quanta/scripts
local script folder: $TDEHOME
/share/apps/quanta/scripts
your path: $PATH
%f: will be replaced with the URL of the current document. In case of local documents, file:/ will be stripped from the document.
%input: will be replaced with the selected input. See below.
%projectbase: will be replaced with the URL of the current project. It is empty if no project is loaded.
%pid: will be replaced with the PID of the running Quanta Plus process. If Quanta Plus is running in unique mode, the "unique " text will be prepended to the PID number. Useful when you use DCOP to control Quanta Plus from the external script.
%userarguments: useful in case of events. This entry will be replaced by the event properties in the following order:
The unique id of the script
the event name
the parameters for the event, usually the file name of the current document or the path to the project file.
Aside of the above methods the script can receive input from Quanta Plus on the standard input. In the Input combobox you can select what to send to the standard input. Choices are:
None: nothing is sent to the script.
Current document: the whole document is sent to the script.
Selected text: the selected area of the document is sent to the script. Using the %input variable usually makes sense only when using this setting.
Similar to the Input you can catch the output of the executed application. There are two kind of outputs:
normal output, printed to the standard output;
error messages, printed to the standard error.
None: the output of the application is ignored.
Insert in cursor position: the output will be inserted in the current document and the cursor position.
Replace selection: the selected area of the document will be replaced with the output.
Replace selection: the selected area of the document will be replaced with the output.
Create a new document: a new document will be created and will contain all the output of the script.
Replace current document: the entire document will be replaced with the output.
Message window: the output will appear in the Messages toolview.
The choices for the standard error output (Error) are the same as for the normal output.
Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team