To access this window, right-click an action icon in the Actions pane, and click Edit Action on the shortcut menu.
A script window allows you to modify Python code and define metadata for a script. It contains the following tabs:
NOTE: The Code, General, Inputs, and Outputs tabs are all "dockable". You can drag a tab to a different location within its containing window, such as side-by-side, vertically stacked, or layered; you can even drag a tab outside its containing window to make it a separate window.
The Code tab contains a text editor region for editing the body of the script. It provides syntax coloring for Python code.
The Inputs and Outputs tabs contain information about the input and output parameters of the script. Inputs correspond to function arguments for functions and to command-line arguments for scripts. Outputs correspond to return values for both functions and scripts.
The Inputs and Outputs tabs each contains sub-tabs: a Table sub-tab and an Editor sub-tab
You can use the table toolbar to add and remove items, and to sort and reorder the columns of the table.
When an item is selected in a Table tab, the settings for the item appear in the Editor tab. You can modify any of the settings in this tab.
You can specify the following information for each input and output parameter:
Name: The name of the argument or variable that corresponds to the parameter.
Description: A description of the parameter.
Type: The datatype of the parameters; select a value from the list.
Measure of: The type of measurement represented the parameter.
Unit system: The unit system that the parameter is in; actual parameters values in a different unit system will be converted before being passed to the script.
Visible: If checked, the parameter will be displayed when the script is used in layers, columns, or workflows.
Name: The name that will appear in the Actions tab for this script.
Category: The folder in which this script will appear in the Actions tab.
Inputs Tab: A table of definitions for input parameters for the action. Each input parameter usually corresponds to an argument of a function defined in the script.
Outputs Tab: A table of definitions for output parameters for the action. Each output parameter usually corresponds to a return value of a function defined in the script.
You can specify the following information for each input and output parameter:
Arg Name: The name of the argument or return value that corresponds to the parameter.
Default: The default value for the parameter.
Description: A description of the parameter.
Port Name:* The name of the parameter, for purposes of matching other variables. This name typically corresponds to a log name.
Modifier:* An optional modifier for the parameter name. A modifier often indicates a condition regarding a log, such as "oil", "gas", or "wet".
External Type: The datatype of the value expected (for inputs) or produced (for outputs) by the parameter.
Internal Type: The datatype of the value expected (for inputs) or produced (for outputs) internally by the function in the script.
Type: The datatype of the parameter.
Units: The unit for the value.
Family: The quantity described by the units of the value, for example, density.
Units System: The system of measure that the unit belong to. The units system determines the resulting units for calculated values.
* These columns are not typically used by the system.
If you change the information for an entry, you can save it as default metadata to be used for other parameters that have the same name. To do this, right-click an entry and click Add as Default on the shortcut menu.
Click the Set user preferences for table () icon to open the Select and Order Columns dialog box, to choose
the columns to display and the order to display them in.
Save: Saves any changes to the script code or metadata. The default directory where scripts are saved is in your user home directory (C:\Documents and Settings\username on Windows), in the following subdirectory:
.enthought.envisage\
enthought.cplab\
plugins\
cp.lab.plugin.action_plugin.ActionPlugin\
user_action_path\
user_actions
Run: Executes the script.
Auto populate: Generates rows for the Inputs and Outputs tables, based on the input parameters and return values of the function in the script. You can modify the information in the rows after it is generated.