Transform selected text with external program (Windows)

11 views
Skip to first unread message

Bouncing Bob

unread,
Nov 17, 2009, 11:44:24 AM11/17/09
to scite-interest
SciTE 2.01, Windows

Ok, it's a little strange, but I have a situation where I'd like to be
able to call an external program to transform the current selection
(not the entire document) in SciTE.

The aim is to improve workflow - at the moment the text is copied into
another program, the transformation applied and the result pasted back
into SciTE. While this works, it would be so much easier (and faster)
if people could do this from within SciTE.

Now, the transformation part I can do - that's easy. Working out how
to extract the selection, run it through the external program and then
paste it back again, that's beyond me.

Go easy please - I'm not a programmer by any stretch of the
imagination, I just have an itch to scratch ;)

Philippe Lhoste

unread,
Nov 17, 2009, 4:27:57 PM11/17/09
to scite-i...@googlegroups.com
On 17/11/2009 17:44, Bouncing Bob wrote:
> Now, the transformation part I can do - that's easy. Working out how
> to extract the selection, run it through the external program and then
> paste it back again, that's beyond me.

I have a pair of examples in my .properties file:

# Filter the current selection using an external command line program
accepting stdin,
# then replace this selection with stdout.
command.name.4.*=Sort lines
command.4.*=sort
command.is.filter.4.*=1
command.subsystem.4.*=0
command.input.4.*=$(CurrentSelection)
command.replace.selection.4.*=1
command.quiet.4.*=1

command.name.5.*=Dict Lookup
command.subsystem.5.*=2
command.5.*=E:\Dev\AutoHotkey\Dict.ahk $(CurrentSelection)
command.save.before.5.*=2
command.quiet.5.*=1

sort is Unix' command, provided by the UnxUtils.
The Dict.ahk is a script.

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

Bouncing Bob

unread,
Nov 17, 2009, 5:05:48 PM11/17/09
to scite-interest
On Nov 17, 9:27 pm, Philippe Lhoste <Phi...@GMX.net> wrote:
>
> I have a pair of examples in my .properties file:
<---SNIP--->
> sort is Unix' command, provided by the UnxUtils.
> The Dict.ahk is a script.

Perfect, that was exactly what I needed - thank you.
Reply all
Reply to author
Forward
0 new messages