Command line interface of Windows, Linux and MacOS do not support parameter strings containing newline characters. Therefore it is not possible to pass a multi-line string as parameter to an application. You must copy the selection into a new file and save it with a file name.
It would be perhaps a good idea for use cases like this one if IDM Computer Solutions, Inc. would enhance the list of options for user and project tools by one more option.%sel%
results in passing the current selection (without newline characters) as parameter to started application. So behavior is unchanged for %sel%
But with %SEL%
the behavior changes. In this case UE/UES should
- create in directory %TEMP% a new file with a random but unique file name using encoding of active file,
- copy current selection into this new file and save it,
- start the application and pass for placeholder %SEL% the name of the temporary file,
- wait until started application terminated in case of a console application or a few seconds in case of a Windows application,
- delete the temporary file.
In this case it would be possible for small multi-line selections to use an UltraEdit script to
- copy the selection into a new file,
- remove all leading spaces/tabs,
- remove all trailing spaces/tabs,
- remove all carriage returns and line-feeds,
- select the remaining single line string,
- run the user tool from within script,
- close the new file without saving.
This would be a possible solution for small selections of a code block not exceeding the command line length limits after removing all unnecessary white spaces if the scripting syntax of AutoHotKey do not depend on line terminators.