Run commands are operating system commands run from within Komodo.
Use the Run Command dialog box to interact with the system
command line or shell while
editing or
debugging files in Komodo. Besides making it
easy to run simple and complex custom commands from within Komodo, the Run
Command dialog box can insert the results of shell commands into a document in
the Editor
Pane, or pass the contents of a document to the system command line or
shell.
To view examples of run commands, see the "Samples" folder in the
Toolbox.
Run commands can be stored for re-use in a
project or the
Toolbox, where they can be assigned
key bindings.
Access the last ten commands executed in the Run Command
dialog box by selecting Tools|Recent Commands. The prefixes [i],
[l] and [il] indicate that Insert output, Pass
selection as input or both were selected with the original command.
|
|
To create a run command, select Tools|Run Command. The
Run Command dialog box is displayed. Alternatively, invoke
the Run Command dialog box from the
Project Manager or the
Toolbox by
selecting Add|New Command from the Project or
Toolbox menu.
The Run Command dialog box can be toggled between its
"simple" or "advanced" form by clicking the More/Less button.
This section describes the components of the Run Command
dialog box that are displayed when the advanced commands are hidden (via the
More/Less button. See Advanced Run
Commands for information about the advanced fields.
- Run: Enter the command to run.
- Interpolation Shortcut: Click the arrow
button to the right of the Run field to access a drop-down
list of interpolation
shortcuts. When an interpolation shortcut is selected, it is
inserted at the current cursor position in the Run
field. Windows users should enclose shortcuts for files and
directories in double quotes (e.g. "%F") to ensure that spaces in
the file name or file path are interpreted correctly.
- Pass selection as input: If this check box is selected,
the text currently highlighted in the editor is passed to the command in
the Run field. For example, if the Run
field contains
grep myvar , each line containing "myvar" in the
text selected in the editor is returned.
- Insert output: If this check box is selected, the results
of the command are inserted at the cursor position in the current document.
- Add to Toolbox: If this check box is selected, the
command is saved in the Toolbox.
Click the More button in the Run Command
dialog box to display advanced options. The following options are available:
- Start in: Enter the directory where the command should
be run, or click the Browse button to navigate the
filesystem. Click the arrow button to the right of the Start
in field to select interpolation
shortcuts pertinent to the Start in setting.
Interpolation shortcuts are inserted at the current cursor position in the
Run field.
- Run in: Specify the environment in which the command
should be run. The options are:
- Command Output Tab: The command is run in
Komodo's Bottom
Pane.
- New Console: The command is run in a new shell
or command window.
- No Console (GUI Application): The command launches
the specified application without displaying output in a shell or on the
Command Output tab.
- Do not open output pane: If this check box is selected,
the Bottom
Pane containing the Command Output tab does not
automatically open when the command is run. To manually view the Bottom
Pane, select View|Command Output. (This option is only
accessible if the Run in field is set to
Command Output tab.)
- Parse output with: If this check box is
selected, the field to the right is used to enter a regular
expression that parses the output. See Parsing Command Output in
the Run Command Tutorial for an example. (This option is only
accessible if the Run in field is set to
Command Output tab.)
- Show parsed output as list: If output parsing is
configured, select Show parsed output as list to display
the output in list format on the Command Output tab.
(This option is only accessible if the Run in field is set to
Command Output tab.)
- Environment Variables: Use the Environment
Variables section of the dialog box to configure new environment
variables or change the value of existing environment variables for the
duration of the run. To add or alter an environment variable, click
New and configure the following values:
- Variable Name: Enter a name for the variable.
- Variable Value: Enter a value for the variable.
- Interpolation Shortcut: Click the arrow
button to the right of the Variable Value field to
insert an interpolation
shortcut pertinent to the Variable Value setting.
The interpolation shortcut is inserted at the current cursor
position in the Variable Value field.
- Add Path: Click this button to insert a directory
as the variable value.
- Save advanced options as defaults: If this check box is
selected, the current settings are stored as the defaults for the Run
Command dialog box.
By default, the commands run in the Command Output tab
on Komodo's Bottom
Pane. (Use the Run in field to run the command in a
new shell window, or to run a graphical application without a console.)
If the command prompts for input, enter it directly on the Command
Output tab. Output written to "stderr" (standard error output) is
displayed in red at the top of the tab. Click the Close
button at the top right of the Command Output tab to terminate
a running command. Click the Toggle Raw/Parsed Output View
button to jump from parsed results to raw output and vice versa. (Parsing
is enabled and configured via the Parse output with field.)
Note: For more information on parsing command output, see
the Parsing Command Output section
of the Run Command Tutorial.
To add a run command to the Toolbox,
select Add to Toolbox in the Run Command dialog box. Run
commands can also be added to projects
or the Toolbox via the methods described in
Storing Run Commands in a Project or the Toolbox.
To run a command stored in the Toolbox or in a project, double-click the run
command's name, use the assigned
key binding, or right-click the run
command and select Run.
To access run command options for the selected run command, right-click
the run command's name. The options are as follows:
- Run Command: Execute the stored run command.
- Cut/Copy/Paste: These options are used to remove the
run command from a project or the Toolbox, or to move a run command between
a project and the Toolbox (and vice versa).
- Export as Project File: When this option is invoked,
a new project file is created that contains the run command from which the
option is invoked. You are prompted to provide the name
of the new project file and the directory where it is stored. To open
the new project file, select File|Open|Project.
- Export Package: Run commands can be archived and
distributed among multiple Komodo users via "packages". Packages are
compressed archive files that contain the run command from which the
Export Package option was invoked. Packages are stored in
files with a ".kpz" extension, and can be opened by any archiving utility
that supports
libz (for example WinZip). The Export
Package option differs from the Export as Project
File option in that copies of filesystem-based components (such as
files and dialog projects) are included in the archive. Conversely,
Export as Project File creates a project with a reference to
the component's original location and does not create copies of the components.
When Export Package is invoked, you are prompted for a name
and file location for the package. Exported packages can
only be imported into "container" objects in Komodo, such as projects, the
Toolbox, and folders within projects and the Toolbox. See
Toolbox - Exporting and
Importing Toolbox Contents,
Projects - Importing
and Exporting Projects via Packages, or
Folders - Import Contents from
Package for more information.
- Rename: To change the name of a run command, select this
option and enter a new name.
- Delete: To remove a run command from a project or the
Toolbox, select this option. The run command is permanently deleted.
To access the properties of a run command stored in a project or the
Toolbox, right-click the run command and select Properties.
The Properties dialog box contains all the elements of the Run Command
dialog box, and is therefore used for editing stored run commands. In
addition, the Properties dialog box is used to assign a custom icon to the
run command, and to assign a custom key binding.
The default run command icon can be replaced with custom icons. Komodo
includes more than 600 icons; alternatively, select a custom image
stored on a local or network drive (use 16x16-pixel images for best results).
To assign a custom icon to a run command:
- On the Projects tab or Toolbox tab,
right-click the desired run command and select Properties.
Alternatively, click the run command in the Projects tab or
Toolbox tab, then select
Projects|runcommand_name|Properties or
Toolboxruncommand_name|Properties.
- In the Properties dialog box, click Change Icon.
- In the Pick an Icon dialog box, select a new icon and click
OK. Alternatively, click Choose Other,
and browse to the desired image file.
- In the properties dialog box for the run command, click OK.
The custom icon is displayed next to the run command.
To revert to the default icon for a selected run command:
- On the Projects tab or Toolbox tab,
right-click the desired run command
and select Properties.
- Click Reset, then click OK. The default
icon is displayed next to the run command.
Custom key bindings can be assigned to run commands stored in the
Toolbox or in a
Project. Use the
Key Binding tab in the run command's Properties to specify the
keystrokes that invoke the run command. See
Key Bindings
for Custom Components for more information.
|