[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] BBedit filter problem



>>robinmcf@altern.org wrote:
>> I'm having a problem using the enclosed script with BBedit 6.02.............

Jim Correia  wrote:
>Putting up standard file in the background is a good way to "hang" the
>machine.  MacPerl should notice this and request attention to be brought
>to the front before doing so.  It apparantely doesn't, so your script
>will have to do the work by calling SetFrontProcess or something
>similar.

Ok did that, but I still get the hangs - however if I run the
SetFrontProcess part on it's own (ie in a small test script) it works as it
is supposed too

#! perl -w

#=========== declare includes =============

use strict;
use diagnostics-verbose;
use Mac::StandardFile;
use Mac::Processes;

#========== declare variables =============

my($version,$file,$comma,$ProcessNumber);
my (@FileInfo,%Process);

#============= script body ================
$version="Script =-> $0   version =-> 1.0.a";
$comma="\'";

# -- this part should bring MacPerl to the front
foreach $ProcessNumber (keys(%Process)) {
 if ($Process{$ProcessNumber}->processName()eq 'MacPerl'){
   SetFrontProcess($ProcessNumber)or die "couldn\'t move MacPerl to the
front: $^E";
}
}



$file=StandardGetFile(0,0) or die"there\'s a problem getting the file info:
$^E";
if ($file->sfGood()) {@FileInfo=MacPerl::GetFileInfo($file->sfFile());}
print "creator code= $comma$FileInfo[0]$comma  file type=
$comma$FileInfo[1]$comma\n";
print "path to file = $comma",$file->sfFile(),"$comma\n";

#========= sub routine separator ===========

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org