Re: Avoiding 'With timeout of...'
Re: Avoiding 'With timeout of...'
- Subject: Re: Avoiding 'With timeout of...'
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 05 Apr 2002 12:19:47 -0500
on 02-04-05 11:49 AM, email@hidden at email@hidden wrote:
>
One solution would be to set a timeout that is longer than needed. However if
>
I do that the script will try to open 'xyz' again after the scan has finished
>
until the timeout has expired.
>
Is it possible to tell the script to exit the timeout when the first scan has
>
finished.
>
>
I have also seen that the scan application returns a gdut event as soon as it
>
receives the open event from the script. This seems to trigger the script to
>
do a second scan. Is there anyway I can tell the script to perform a certain
>
action when receiving the gdut even.
Normally, setting the timeout value to something that might as well be
inifinity (say, the number of seconds in a week) is the preferred technique.
The application and the script will both finish up whenever they would have
finished up, anyway, but you won't get a timeout error. The only function of
the 'with timeout' command is to give you an automatic way to detect that
the application is taking too long to do something. When you know it's
supposed to take a long time, anyway, it is appropriate to effectively do
away with the timeout detection mechanism by telling it that you expect the
operation to take forever.
Nothing in the 'with timeout' command should affect what the application
does. So you should look at your code to see whether you are inadvertently
including a scan command in a loop that gets called again, directly or
indirectly. If it's really the application that is causing this (which seems
very unlikely), then you could set up some counting mechanism in your script
that causes the script to quit (or exit the loop) as soonn as it has issued
the first scan command.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.