Advanced Command Editor
The simple mode only
lets you define functions that consist of a single line. From simple mode, click
the Advanced button to switch to advanced mode, which lets you
create more complex functions. The command editor will switch to advanced mode
automatically if the button you are editing already contains a function that
extends over more than one line. In the advanced mode the single line
Function field is replaced by a multiple-line text box that
lets you create more complicated, multiple-line functions.
This screenshot shows the command editor when it is in advanced mode (the
function shown is from Copy Files button on the default
toolbar). You can see that the single-line Function field has
been replaced with a multiple-line field. There is a new drop-down which lets
you select the type of the function (Standard or MS-DOS
Batch). Also, the Start in and Run
fields have disappeared - if they had been specified in simple
mode, they will be replaced by equivalent commands in the multi-line
function definition.
In these screenshots you can see that the Start in field has
been converted to a cd command (to set the
current directory) and the Run
setting has been converted to a @runmode modifier.
There are a number of command modifiers that you can use for commands in
advanced mode. Another one is shown above: in the Copy File
function, the @keydown modifier is used to change the
button's function based on whether the Shift key is held down
or not. See the Command
modifiers page for more information on modifiers.
The Function drop-down in advanced mode lets you select
from three types of functions:
- Standard Function: This is used for most commands, and is
the option you will most often select. Both internal Opus functions and
the launching of regular external Windows programs work in this mode.
- MS-DOS Batch
Function: This is used to run MS-DOS type programs (including
.bat scripts). It's intended for programs that don't open a
window of their own, but instead are designed to print text to a DOS prompt.
- Script
Function: This type is used to define a button written using an
ActiveX scripting language like VBScript or JScript. Script buttons normally
begin with a @script directive to specify the script
language, which is then followed by the actual script code. See the page on Scripting for more details on
scripts.
The multi-line text field is where you enter the instructions that make up
the command. The toolbar along the top of the field contains a number of
drop-downs that can help you build up the command:
- Edit: This dropdown contains a number of text
editor-like functions for the edit field; clipboard operations, search and
replace, etc.
- Commands: Displays a list of the internal commands (including any user-defined commands).
Selecting one will insert the command into the function.
- Arguments: This is a context-sensitive drop-down that
displays the arguments (if any) for the command that begins the line the
cursor is on. So for instance, if you had selected Copy from
the Commands drop-down, the Arguments
drop-down would then show you the arguments for the Copy
command. Again, selecting arguments from the drop-down menu inserts
them into the body of the function. The Arguments drop-down
also displays a list of the external control codes (which you can
use with both internal commands and external programs to pass things like the
names of selected files through to the command).
- Browse: This button displays a standard file browser
dialog letting you locate an external program to run. The full path to the
program will be inserted into the function.
- Modifiers: This displays a drop-down list (with
descriptions) of the various command modifiers that you can use to change
the behavior of commands.
Lines beginning with // are ignored, allowing you to put comments in your
commands.