Command/Compiler Variables

How they work

When configuring External Commands or Compilers it is possible to use a number of variables in the application settings path and the LOG file path. These are described below.

Note: These variable names are all case-sensitive so, for example %File% will work, but %file% and %FILE% will fail to produce the expected results.

%File%

Full path name, including drive specifier, of current file.

Example:
C:\MyProg.exe "%File%"

Becomes:
C:\MyProg.exe "C:\Documents and Settings\user\This File.txt"

Note: The quotation marks around the variable name are required if the path name includes spaces.

%Dir%

Full path, including drive specifier, of directory in which current file is saved.

Example:
C:\MyProg.exe -o "%Dir%" ...

Becomes:
C:\MyProg.exe -o "C:\Documents and Settings\user\"

Note: The quotation marks around the variable name are required if path name includes spaces. Also note that the %Dir% variable includes the trailing slash (\).

%DosFile%

Short path name, including drive specifier, of current file.

Example:
C:\MyProg.exe "%File%"

Becomes:
C:\MyProg.exe "C:\DOCUME~1\user\MYDOCU~1\ThisFi~1.txt"

Note: The quotation marks around the variable name are required if the path name includes spaces.

%DosDir%

Full short< path, including drive specifier, of directory in which current file is saved.

Example:
C:\MyProg.exe -o "%Dir%" ...

Becomes:
C:\MyProg.exe -o "C:\DOCUME~1\user\MYDOCU~1\"

Note: The quotation marks around the variable name are required if the path name includes spaces. Also note that the %Dir% variable includes the trailing slash (\).

%Name%

Name, without extension, of current file.

Example:
C:\MyProg.exe "%Name%"

Becomes:
C:\MyProg.exe "This File"

Note: The quotation marks around the variable name are required if file name includes spaces.

%Ext%

Extension of current file name.

Example:
C:\MyProg.exe -e %Ext%

Becomes:
C:\MyProg.exe -e .txt

Note: Extension includes preceding perid (.).

%Project%

Current project name.

Example:
C:\MyProg.exe -p "%Project%"

Becomes:
C:\MyProg.exe -p "New Project"


%ProjectDir%

Current project file path.

Example:
C:\MyProg.exe -p "%ProjectDir%"

Becomes:
C:\MyProg.exe -p "c:\projectfile.ppr"


%PSPath%

PSPad application path.

Example:
C:\MyProg.exe -p "%PSPath%"

Becomes:
C:\MyProg.exe -p "C:\Program Files\PSPad\"

Note: Path includes trailing slash (/).

%URLFile%

Full path name, including drive specifier, of current file preceded by "file://localhost/"

Example:
C:\MyProg.exe "%URLFile%"

Becomes:
C:\MyProg.exe "file://localhost/C:/Documents and Settings/user/This File.txt"

Note: The quotation marks around the variable name are required if the path name includes spaces.

%HttpFile%

Full path name, including drive specifier, of current file preceded by "http://localhost/"

Example:
C:\MyProg.exe "%HttpFile%"

Becomes:
C:\MyProg.exe "http://localhost/C:/Documents and Settings/user/This File.txt"

Note: The quotation marks around the variable name are required if the path name includes spaces.

%PHPFile%

If start of path of current file matches value of setting in "Settings > Program Settings > Internet > Document Root" then the variable will be replaced with the value "http://localhost/" + the path relative to Document Root. Otherwise variable equates to %File%.

Example:
Assume the Document Root is set to "C:\Inetpub\wwwroot" and the current file path is "C:\Inetpub\wwwroot\test.htm" C:\MyProg.exe "%PHPFile%"

Becomes:
C:\MyProg.exe "http://localhost/MySite/text.htm"

Note: The quotation marks around the variable name are required if the path name includes spaces.

%SelText%

Currently selected text.


%Input%

Prompt user to enter value.

Note: If "Cancel" is pressed when prompt is displayed, command will not be run. To run command with no value, delete any text in prompt's input box and press "OK"

%Word%

Word at current cursor position.


%Line%

Line number of current cursor position.


%AppData%

Path where applications store data by default.


%HomePath%

Path to the user's home directory.

Example:
C:\MyProg.exe -p "%HomePath%"

Becomes:
C:\MyProg.exe -p "\Documents and Settings\UserName"

Note: Path excludes drive (C:) and trailing slash (/).

%Temp%

Default temporary directory used by applications for current user.

Example:
C:\MyProg.exe -p "%Temp%"

Becomes:
C:\MyProg.exe -p "C:\DOCUME~1\UserName\LOCALS~1\Temp"

Note: Path is short and usualy excludes trailing slash (/).

%UserProfile%

Path of profile for current user.

Example:
C:\MyProg.exe -p "%UserProfile%"

Becomes:
C:\MyProg.exe -p "C:\Documents and Settings\UserName"

Note: Path excludes trailing slash (/).

%WinDir%

Path of operating system directory.

Example:
C:\MyProg.exe -p "%WinDir%"

Becomes:
C:\MyProg.exe -p "C:\WINDOWS"

Note: Path excludes trailing slash (/).