Discussion:
Sending Perl script output to frontmost window
Harold Tessmann III
2008-05-25 02:44:45 UTC
Permalink
I have a Perl script that I used with an older version of BBEdit
(7.1.4) as a Unix filter. It generates some text and that version of
BBEdit puts the output in the frontmost window, replacing the current
selection. I really only care that it puts the text at the insertion
point, and more specifically at the end of the file.

I tried to run it with a more recent version of BBEdit (8.2.6) and it
behaves differently. The filter now replaces the contents of the
frontmost window with the output. That makes more sense when you
think of what a "filter" should do, but in this case I want the old
behavior. I added a loop that simply prints the contents of the file
and then the new text, but that leaves the insertion point at the
beginning of the text. I tried running it as a Unix script, but that
dumps it into a Unix Script Output window, and I can't figure out how
to change that, if you even can.

Did I miss a preference or option that gives me the behavior I want?
I know how to wrap the script in an AppleScript and tell BBEdit to
put the output in place of the selection, but that seems overly
complicated. Does anybody have a better way to do it?

Thanks,
Harold
--
Harold Tessmann III Wandering Programmer
(I handle simian sort) ***@umich.edu

Breach hull, all die. Even had it underlined. -- Crow T. Robot
You can never plan the future by the past. -- Fred Brooks
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Charlie Garrison
2008-05-25 12:04:52 UTC
Permalink
Good evening,

On 24/5/08 at 9:44 PM -0500, Harold Tessmann III
Post by Harold Tessmann III
Does anybody have a better way to do it?
I just make sure I always have a selection before running a unix
filter. Selecting a space character (or anything really) at the
end of the line will achieve that.

I don't need to do it often enough for it to be a nuisance. If
it's something you do a lot, you create an AppleScript to add a
space at the end of the line and select it. Then you can run
your filter script and output will be placed at the end of the line.


Charlie
--
Charlie Garrison <***@zeta.org.au>
PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Loading...