About the Script Tab

You click the Script tab to access the Script Editor. The Script Editor lists the command lines within the script. You use its Add button to add command lines to the script. The other buttons provide methods for managing the order of the command lines. Because scripts generally execute the command lines in order, starting at command line 1, it is important to have them in the correct order.

Script Editor showing the script selection, Hex Value checkbox, command line add, delete, and reorder tools, and column adjustment areas.

Once you have multiple commands in the list, you can move between them by either selecting the one you want to go to or using the keyboard’s Up Arrow and Down Arrow keys to step from one to the other. You can also press the Command key along with the Up Arrow and Down Arrow keys to jump to the first or last command line, or the Page Up and Page Down keys to move through the list one page at a time.

Command Line Add and Delete Buttons

There are three buttons you can use to add or remove command lines from the Script Editor.

Figure. Command line insert, add, and delete buttons of the Script Editor.
  • Add (+): Clicking the Add button, or pressing Command–Equal Sign (=), adds a command line to the script. This command line is always placed at the end of the list, regardless of which command is currently selected. By default, each added command line is set to Nop (no operation) which works as a placeholder for the actual command you will select in the Inspector.
  • Delete (–): Clicking the Delete button removes the currently selected command line from the list. You can also use the keyboard’s Delete key.
  • Insert: Clicking the Insert button, or pressing Command–Shift–Equal Sign (=), adds a new command line to the list, positioned after the currently selected command line. All command lines below the current one ripple down one location. As with the Add button, the new command is a Nop.

Command Line Reorder Tools

You can use the reorder tools to change the order of the command lines in the Script Editor. You can also drag a line to a new position.

Note: You are just rearranging the order of the command lines—you are not deleting or replacing any command lines.

Figure. Command line reorder buttons of the Script Editor.
  • Move Up: Clicking the Move Up button moves the currently selected command line up one location. The command line already at that location moves down one location to make room (the two command lines basically switch positions).
  • Move Down: Clicking the Move Down button moves the currently selected command line down one location. The command line already at that location moves up one location (the two command lines basically switch positions).
  • Move To Top: Clicking the Move To Top button moves the currently selected command line to the top of the list, making it the first command line executed. All command lines that were above it in the list ripple down (the command line that was at the top is moved to the number 2 position, the number 2 command line moves to number 3, and so on).
  • Move To Bottom: Clicking the Move To Bottom button moves the currently selected command line to the bottom of the list, making it the last command line executed. All command lines that were below it in the list ripple up.

Copying Command Lines

When creating a script with multiple similar command lines, you may find it easier to create the first version of the command line, copy that command line multiple times, then modify the copies as needed. You can also copy a command line from one script to another.

To copy command lines in the Script Editor
  1. Select the command line to be copied.

    You can select more than one command line.

  2. Choose Edit > Copy (or press Command-C).

    This copies the command lines to the Clipboard. The selected command lines are not affected.

  3. Select the command line in this script or a different script after which you want to paste the copied command lines.

    If you have no command lines selected, the copied command lines are placed after the last existing command line.

  4. Choose Edit > Paste (or press Command-V).

To move one or more command lines using cut and paste
  1. Select a command line or a group of command lines to be moved.

  2. Choose Edit > Cut (or press Command-X).

    This copies the command lines to the Clipboard and removes the command lines from the current list.

  3. Select the command line in the script after which you want the cut command lines to be pasted.

  4. Choose Edit > Paste (or press Command-V).

This is most useful when you are moving command lines from one script to another.