Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Full circle' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Full circle
Authored by: gshenaut on Jul 02, '04 12:35:45AM
OK, this is great stuff. First, on the aaafilter.sh script I posted previously, it may be necessary to insert code to set the PATH to something other than the default, or otherwise initialize the shell, to let it see all the possible filter commands you want to run. On my system, I can do ". /etc/profile" in the script for this, but YMMV.

Second, I made this little script, which I call "xvi":

#!/bin/sh

T=/tmp/xvi$$
trap "rm -f $T" EXIT
trap "rm -f $T;exit" INT

cat > $T

xterm -e vi $T

cat $T
exit 0
which, if typed into the filter window will start up vi on the selected text in an X window. When you write it out, the result will replace the selected text. You could use your favorite editor instead of vi if you want.

Bottom line: with this trick, you can now use any editor you want to edit text in GUI programs like Mail.app, TextEdit, and so on, and you can do all the text filtering you want.

Cheers,

Greg Shenaut

[ Reply to This | # ]