User actions

User actions define commands that can be invoked within Genero Studio from a menu item, toolbar icon, file association, or project node.

Important: If you are using a remote configuration, the user action is executed on the remote server unless you specify otherwise.

To view user actions, select Tools > Preferences (or, if you are on a Mac, Genero Studio > Preferences), then select General > User Actions.

Figure: User Actions Configuration page

Screen shot of User Action Configuration page

Adding a user action

Click the add or edit toolbar icon to open the Add a user action dialog. Fill in the fields as in Table 1.

Figure: Add a User Action dialog

Screen shot of the Add a User Action dialog
Table 1. Adding user action detail
Field Description
Name Name of the user action.
Label Label for the user action as displayed in Genero Studio action listings, menus, or toolbars.
Description Optional.
Icon Optional.
Target nodes

Optional. Use this field to specify the nodes that will include this user action in their context menu. To attach the user action to another project node, click the ellipse at the end of this field.

Note: If no target nodes are selected, the message "Check File Associations" displays. This refers to the Files Association Configuration dialog box, which allows you to associate the action with specific file types. If you do not specify target nodes, it is recommended that you use either the file association, toolbar icons, or menu items (see Associating a user action).
Command line
Command to be executed. Arguments can be included on the command line as needed.
Note: If the command includes a path that contains spaces, the path must be in quotes.
Use the Insert Variable button to select from the available variables. The available variables include system environment variables and environment variables from the current configuration (see Environment sets). Other available variables depend on whether target nodes are selected.
  • If no target nodes are selected, the following variables are included: FileBaseName, FileDir, FileExtension, FileName, FilePath, FilePaths, Locator, and MimeType.
  • If target nodes are selected, variables include all properties associated with the target nodes.
  • If target nodes contain a Project Manager node, variables Implicit and TemplateDir are also included.
When the action is executed, Genero Studio attempts to resolve the variable. If the variable cannot be resolved, the user is prompted for a value.
Examples:
  • Execute the program stest using the selected file:
    C:\myprograms\stest $(FileName)
  • Execute the program stest using the user-defined variable ($(p1)):
    C:\myprograms\stest $(p1)
  • Open the associated file (a .per or .4fd file) as a compiled .42f file:
    $(open) $(FileDir)/$(FileBaseName).42f)
Display output If selected, the output from the executed commands are displayed in the Output view.
Verbose If selected, the user action commands are displayed in the Output view.
Always execute locally If selected, the user action is executed locally even if the current configuration is remote.

Associating a user action

When the user action is created, you can associate it with: