On 4 Jan 2014, at 09:33, Christopher Stone <listmeis...@suddenlink.net> wrote:

> In a Text Filter can you grab STDIN <do stuff> and prevent STDOUT from 
> rewriting the front document?
> 
> Alternatively is there a way to pipe the selection or whole text from the 
> front document in a Unix Script (not a Text Filter) without having to save 
> the front document first?
> 
> (I can always use Applescript, but at the moment I'm trying not to.)


If you run this text filter on the front document, whether saved or not, the 
document will be rewritten just as it is, and you can write your modified 
output, whatever it is, to another document.  This also shows what extra 
variables are available in this environment. If this isn't the sort of thing 
you want, let us know more clearly what you want to do.

You also have various run options in the shebang menu.


#!/usr/bin/perl
my $tempfile = "/tmp/temp.txt";
my $fh;
open $fh, ">$tempfile";
while(<>){
        print;
        print $fh $_;
}
print $fh "\n\n\%ENV:\n";
foreach (keys %ENV) {
        print $fh "$_: $ENV{$_}\r" if /^BB/;
}
`open -a bbedit '$tempfile'`


#JD

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.

Reply via email to