OpenWindows User's Guide

Custom Commands

The Custom Commands window allows you to create and store commonly used operating system commands. Once you have added the commands to the menu, you can use them at any time by choosing them from the Custom Commands submenu from the File menu.

Creating Custom Commands

Choose Custom Commands category from the Properties menu, as shown in Figure 2-45. You use this window to add often-used UNIX commands to your Custom Commands menu. You can even create a command that lets you specify different options every time the command is chosen.


Note -

The Custom Command feature assumes that you have some working knowledge of the UNIX operating system. If you are not familiar with UNIX or have problems, you might want to have your system administrator help you create any desired custom commands.


Figure 2-45 Custom Command Pop-up Window

Graphic

The scrolling list shows your current custom commands. You use this window to add, delete, and change the order of your custom commands.

Follow the steps below to add a new custom command to the Custom Commands Menu Items scroll box. Follow the examples to add a custom command to search for a particular text string in the selected files or folders.

  1. Type the actual UNIX command in the UNIX Command text field.

    You can add $FILE or $ARG to the command to represent the currently selected file or special arguments (options) that you can specify at the time you choose the command.

    In this example, type grep $ARG $FILE in the UNIX command text field.

  2. Type the name of the command that you want to appear in the Menu Label text field.

    This Menu Label does not have to be the actual UNIX command. You may want the command to be something more descriptive.

    In this example, type String Search.

  3. Add the item.

  4. To prompt for command options, (that is, if you are using $ARG in the UNIX command), choose Yes on the Prompt Window setting, then type the prompt label into the first line of the Prompt text field.

    If you use a prompt window, when the custom command is chosen from the Custom Commands menu a window is displayed with the prompt label. You use this pop-up window to type the command options.

    In this example, choose Yes on the Prompt Window setting and type Search For: in the Prompt text field. When your custom command is chosen from the Custom Commands window, a window is displayed in which you can specify the text that you want to search for.

  5. If your custom command will create any output, choose Yes on the Output Window setting.

    This causes an output window to be displayed when the custom command is chosen, where you can see the result of your command.

    In this example, you want to choose Yes on the Output Window. Then when you choose the new custom command from the Custom Commands menu, a window will be displayed that lists the places the text string is found.

  6. Click SELECT on Apply to add the new command to the Custom Commands scrolling list.

    To use the item, select the folders and files where you want to search for text, choose the String Search command from the Custom Commands submenu, and type the text string to search for in the window that is displayed. Press RETURN to quit or SELECT Quit from the output window.