Actions in Quanta are the basis for nearly all the extensions that Quanta has and will acquire in the future. The same mechanism that defines an action in Quanta enables autocompletion and tag dialogs. With actions, the limit of what you can do is virtually limitless. For means of an example, we will use html tidy on our web pages.
Let's get started: Settings->Configure Actions
Once you start the actions dialog you'll see this window. To the left is the list of currently known actions. You can select one of those and perform the same actions for an existing action that we're going to do with our html tidy action.
We're going to make a new action, so let's click on the new button (lower left) and begin.
Now you're presented with a blank set of options to fill in:
This is the name of the action
Not sure where this get's displayed. It's optional!
Don't know what this is for or where it's used. It's optional!
This enables the drop down box for selection of a toolbar to place this action onto. If you don't choose now, you can always add them later from Settings->Configure Toolbars.
Now to the meat of the matter. The actions definition.
If we were defining a markup tag, we could use the tag tab here to input the tags parameters.
To whit:
This is where you enter the tag name as it will appear in your document. e.g. <div align=center>
This is where you enter the closing tag, if any, or uncheck the box if none. e.g. </div>
This runs the dialog editor if there is a tag file defined for this item. Check out the tag files section for more information on tag files.
And now... Back to our regularly scheduled program. Continuing on the html tidy action creation.
Click on the Script tab to reveal the following:
This is where you place the executable that you're after. In our case, it would be /usr/local/bin/tidy because that's where I keep tidy.
Now on to the Input/Output/Error tabs.
Input Tab
Don't take any input for this script. This could be useful if you were calling a Tcl/Tk script that popped up a window for interaction with the user and then returned its results. We'll be choosing something else for tidy.
Just what it says. It pushes a copy of the currently selected text out to the standard in of the script in the input box above. We could use this for tidy, but it's no fun to select everything in a large document.
Pipes the contents of the editor version of the file through to the standard in of the script in the input box above. This is what we'll use for tidy.
Now click on the Output tab. This is where we decide on our redirection for your scripts output.
Duh. This would be fine if you're launching an external application that only takes input but doesn't output anything. This is no real use for us with tidy.
Just what it says. Be certain you're where you want the text inserted. No good for tidy.
Total file replacement here. It won't overwrite the file on disk, but it will blast your current edit session. Use with caution. We won't use this for tidy.
Output to a new document in the edit window. This is the best choice for tidy.
Output to the message window (Ctrl+M). This is useful for debugging and the Error tab, but not much else for Output. Not for tidy.
For the Edit tab, the options are the same as the Output tab. Usually, you'll use the message window, to help in debugging, or none option.