Pass selection over multiple lines to a user tool

Pass selection over multiple lines to a user tool

4
NewbieNewbie
4

    Oct 15, 2004#1

    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

    6,681583
    Grand MasterGrand Master
    6,681583

      Oct 28, 2004#2

      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"
      Best regards from an UC/UE/UES for Windows user from Austria