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

Re: [MacPerl] Clearing console window



At 11:46 -0700 2000.07.28, Alan Winslow wrote:
>I use
>      MacPerl::DoAppleScript('close window "MacPerl"');

I should have mentioned in my post that this method is slower; the
AppleScript has to be compiled, which can take several seconds on some
machines.  It has the benefit, of course, of being easier to read, and of
waiting for the Apple event reply.

If you need to call the close window several times, this might be a nice
way to do it:

  use Mac::OSA::Simple;
  my $close = compile_applescript('close window "MacPerl"');

Then whenever you want to close the window:

  $close->execute;

It may take a second or two to compile the first time, but each call to
execute() is very fast.

-- 
Chris Nandor       |     pudge@pobox.com      |     http://pudge.net/
Andover.Net        | chris.nandor@andover.net | http://slashcode.com/

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