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

Re: [MacPerl] MacPerl in front



At 14.48 -0400 1998.09.15, Marcel Brown wrote:
>I've noticed that sometimes the MacPERL application is the frontmost
>application on my Web server. Is there a way to keep WebSTAR in front?

Going through old mail, did not see a response to this.  This should keep
any app wth the given symbol in front when your MacPerl script is running.
set_front() returns 1 if successful, else undef.  Call set_front() at the
beginning of your CGIs to make WebStar the front app ASAP, or for processor
intensive CGIs that benefit from MacPerl being in front, run set_front() at
the completion of the CGI.

  #!perl -w
  use Mac::Processes;
  set_front('R*ch');  # BBEdit's id, in this case

  sub set_front {
    my $psn = get_front(shift);
    SetFrontProcess($psn) if $psn;
  }

  sub get_front {
    my($app, %x) = @_;
    foreach (keys %Process) {
      $x{$Process{$_}->processSignature} = $_;
    }
    return $x{$app} if exists $x{$app};
  }

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch