Re: Halt script in progress...
Re: Halt script in progress...
- Subject: Re: Halt script in progress...
- From: Chris Garaffa <email@hidden>
- Date: Fri, 9 Jan 2004 18:31:35 -0500
On Jan 9, 2004, at 6:19 PM, Matthew Broms wrote:
I have an AS Studio app that repeats through a large folder processing
images which can take several hours. The user selects a source folder
and a
destination folder. I9ve put a 3Stop2 button into my interface so if
they
change their mind and want to perform another task in the program, or
change
either folder paths and start over. If they click on this button a
display
dialog appears pausing the process. How do I tell the entirely
separate
repeat loop from a different handler to just stop doing it9s thing?
Can it
be done? I9ve tried inserting an error -1289, but nothing happens.
I've never done this, but here's an idea to try:
Have a global variable, for example gShouldStopRoutine. Set it to
false. Since you say you have a repeat loop, enter this code:
if (gShouldStopRoutine is true) then
exit repeat
end if
Now, when the stop button is clicked, change gShouldStopRoutine to true
and you should be all set. Hope that works out!
--
Chris Garaffa
email@hidden
_______________________________________________
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.