The parameter list dialog is used when running your script in the console or selecting parameters in the external tools.

The edit box shows the parameter going to be used, while the list view some predefined tags and their value (at the time the dialog was invoked). The hint of the parameter edit box previews the parameters after processing the tags.

 

%file%

The filename of the script.

 

%filenoext%

This is the filename of your script excluding the extension.

 

%folder%

The folder in which the script is, excluding the trailing backslash.

 

%path%

This will be replaced with the full path to the script you are editing.

 

%pathsn%

Full path to script as a dos short name (no spaces).

 

%querybox%

Prompts user to enter some text.

 

%ARGV%

The arguments entered in Run / Arguments. Needed for console scripts.

 

%selection%

The text selected in the editor. If the text spans many lines then the EOL characters are deleted.

 

%url%

Sends the same url that is called in the internal browser when running the script.

 

%word%

The current word under the cursor.

 

%get%

The active get method text

 

%post%

The active get method text

 

%pathinfo%

The active pathinfo text

 

%cookie%

The active cookie text

 

%data0% ... %data9%

These are replaced with the corresponding fields of the active project's options. Check how these are used for an implementation of CVS.

 

%f<filename>%

Gets replaced with the text in the file "filename", for example

%f<c:\test\testparams.txt>%

 

%n<filename>%

Creates a new file in the editor with the name "filename". This is used mostly with the special tags below.

 

%o<FullPathToFile>%

Opens a file in the editor. This is the only tag that when used, does not require the "Program" path to contain something to be executed. For example, you can create a tool with the "Program" field empty, and in "Parameters" something like %o<c:\myfile.txt>. When ran, this will just open the file in the editor.

 

icon_idea The text you enter in the above 3 commands is also evaluated. For example, you can enter:

 

%n<%fileNoExt%-text>%

If you ran a tool containing this parameter on test.cgi, then a new tab in the editor would pop-up with the name "test-text"

 

 

Tags that modify OptiPerl's options

 

These tags do not actually get replaced with text; they only change the behavior with the script.

 

%toggle<OptionName>%

Toggles any boolean option value of optiperl. See the file settings.ini for possible values. For example: %toggle<WordWrap>%

 

%set<OptionName=Value>%

Toggles any options value of optiperl. For example: %set<WordWrap=true>% %set<BlockIndent=3>%

 

 

Special tags

 

If optiperl detects one of the following tags, then OptiPerl opens a pipe with the script. These tags do not actually get replaced with text; they only change the behavior with the script.

 

%GETFILE%

Replaces the text of the active file in the editor with the text sent from the script.

 

%SENDFILE%

Sends the text of the active file to the script. The script should read it from <STDIN>

 

%GETSELECTION%

Replaces the text of the selection in editor with the text sent from the script.

 

%SENDSELECTION%

Sends the selected text in the editor to the script. The script should read it from <STDIN>

 

%GETPROJECT%

OptiPerl replaces all files of the current project with the filenames sent from the script. The filenames must be absolute and delimited with a \n (newline).

 

%SENDPROJECT%

Sends all the filenames of the active project to the script. The filenames are absolute and are delimited with a \n (newline).

 

%GETLINE%

Navigates and positions the cursor on a line of a file, opening it in the editor. The format optiperl will expect from <STDOUT> is:

 

line<tab>filename

 

so print from your script something like:

 

$line\t$file

 

If this parameter is used together with %GETFILE% then make sure this is the first line printed.

 

%SENDLINE%

 

Sends to the script the active filename and caret position, in the same format as above. It will be the first line sent, and you can read it in a perl script by using:

 

($linenum,$activefilename) = split(/\t/,<STDIN>);

 

 

 

Top  Previous  Next