Pass selection over multiple lines to a user tool

Help with setting up and configuring custom user tools in UltraEdit (based on command line input)

Pass selection over multiple lines to a user tool

Postby tulpe » Fri Oct 15, 2004 4:49 am

Is there any way to pass a selection, which spans multiple lines, to a shell script interpreter like php or pearl?

In case of php-cli, when i use the following tool-configuration:

php.exe C:\multiline_tool.php "%sel%"

only the first line makes it into $argv which is the array in which php stores the command line parameters. :cry:

If not, wouldn't it be nice to include an option in the tool-configuration window, to type in a replacement for linebreaks so that eg: "\n" gets converted to "#n#".

Oh.. beside that, UltraEdit rocks! :D

Regards

Thomas Schuessler
User avatar
tulpe
Newbie
 
Posts: 4
Joined: Thu Oct 14, 2004 11:00 pm

Re: Pass selection over multiple lines to a user tool

Postby Mofi » Thu Oct 28, 2004 8:33 am

I think, MS Windows is truncating the arguments at line breaks, not UltraEdit. Use the Save Selection As command from the file menu to save the current selection to a temporary file before running the tool with the temporary file.

You can also use a macro to save the current selection to always the same temporary file without prompting and you can even run the tool from inside the macro after saving the selection with the macro command RunTool "tool name". The tool name is case-sensitive!

Here is an example of the macro:

InsertMode
ColumnModeOff
HexOff
UnixReOff
Copy
NewFile
Paste
SaveAs "C:\Windows\Temp\Tempfile.tmp"
CloseFile
RunTool "tool name"
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4049
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Custom User Tools/Tool Configuration

cron