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

Re: [MacPerl] appleevent timeout



At 13.06 -0400 1998.09.10, M. Christian Hanson wrote:
>I wish to change the timeout on appleevents I am sending.  here is the
>snippet of code.  I need to lengthen the timeout.
>
>	$evt = AEBuildAppleEvent ('misc', 'dosc', typeApplSignature ,
>'LAND', 0,0, "TEXT: "$scriptorun"") || die $^E;
>	$rep = AESend ($evt, kAEWaitReply) || die $^E;

>From the POD for Mac::AppleEvents:

=item AESend EVENT, SENDMODE [, SENDPRIORITY [, TIMEOUT ] ]

Send the Apple Event EVENT.
TIMEOUT defaults to kAEDefaultTimeout.
SENDPRIORITY defaults to kAENormalPriority.
Returns the reply if SENDMODE was kAEWaitReply.


So ...

  $rep = AESend($event, kAEWaitReply, kAENormalPriority, 60*60*9999); #large

If you look up 'timeout' in the index of the Inside Macintosh IAC book, and
follow it to chapter 5, you see that there are two constants to use,
kAEDefaultTimeout and kNoTimeOut.  It also notes that the value you pass is
in ticks, which are 60 to a second (1 tick = 1/60 second).  So my event
above waits 9999 minutes.

--
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