Run Program

This window runs an external program on one of the files shown within a file comparison.

To open this window for the file in the active pane of a file comparison:

  • press Shift+F9;
  • from the ribbon External menu, choose the appropriate Run external program on {first|second|third} file… command;
  • or, right-click the pane and choose the Run external program on {first|second|third} file… item from the context menu.

Information After this window has been used to configure a suitable external program, press F9 to launch the program directly for the active file, without showing the window.

Fields

Program

Enter the path of the program to run. The button can be used to browse for the program.

Information A fully qualified path is recommend. Although programs present in the system’s AppPath or PATH environment variables will be found without a fully qualified path, providing one ensures that the intended program is run.

Arguments

Enter the arguments that will be provided to the program when it is run.

File and folder paths that contain spaces should be enclosed within double quotation marks. For example, "C:\My Documents\file.txt".

Information See Argument substitution variables below for variables that can be used in this field.

Command preview

This field shows the exact command and arguments to be run, with argument variables substituted appropriately.

Argument substitution variables

This table describes the variables that can be used in the Arguments field. These variables are substituted with the appropriate values when an external program is launched.

VariableDescription
${currentPath}The fully qualified path to the file in the comparison panel for which the window was launched.
${currentLineNumber}The current line of the cursor in the comparison panel for which the window was launched. This is only relevant for text and binary comparisons; it will be 1 if launched for an image comparison.
${currentColumnNumber}The current column of the cursor in the comparison panel for which the window was launched. This is only relevant for text and binary comparisons; it will be 1 if launched for an image comparison.
${otherPaths}The fully qualified paths to the non-current file or files in the panel or panels of the comparison.
${path1}The fully qualified path to the file in the first panel of the comparison.
${path2}The fully qualified path to the file in the second panel of the comparison.
${path3}The fully qualified path to the file in the third panel of the comparison.

Information Substituted values will be surrounded with double quotation marks if they contain whitespace.

Examples

The examples below show field values for running a selection of common text editors.

Visual Studio Code

The following field values open the relevant file in Visual Studio Code with the cursor appropriately positioned:

FieldValue
Program%PROGRAMFILES%\Microsoft VS Code\Code.exe
Arguments--goto ${currentPath}:${currentLineNumber}:${currentColumnNumber}

Sublime Text

The following field values open the relevant file in Sublime Text with the cursor appropriately positioned:

FieldValue
Program%PROGRAMFILES%\Sublime Text\sublime_text.exe
Arguments${currentPath}:${currentLineNumber}:${currentColumnNumber}

Notepad++

The following field values open the relevant file in Notepad++ with the cursor appropriately positioned:

FieldValue
Program%PROGRAMFILES%\Notepad++\notepad++.exe
Arguments${currentPath} -n${currentLineNumber}
-c${currentColumnNumber}