Script Window

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.

Code Tab

The Code tab contains a text editor region for editing the body of the script. It provides syntax coloring for Python code.

Inputs and Outputs Tab

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:

General Tab

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:

* 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.

Buttons

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.

 

Related Topics: