Re: threads in appleScript
Re: threads in appleScript
- Subject: Re: threads in appleScript
- From: christian vick <email@hidden>
- Date: Wed, 08 Jan 2003 17:46:54 +0100
>
Is it possible to use threads on AppleScript?
Unfortunately, no, not really.
>
I have a button that does
>
something and I want to be able to click on a second button to stop
>
what the first button was doing, at the moment my "stop" button has no
>
effect as the "start" button takes over until it is finished what it is
>
doing...
Sure, but how should using threads help here? (something like the opposite
would help more in this case ;).
>
So is it possible to put button 1 in its own thread and have button 2
>
stop button 1s thread? hope that makes sense :)
Button 2 is actually stopping the handler called by button 1, but as soon
the on clicked handler has finished, the first handler continues (which is
good behavior).
You can define a global variable to hold a "cancel-value". Your handler,
triggered by button 1 checks from time to time the value of the variable,
and if it's false it stops and returns. Button 2 sets the variable to true.
Greetings
Christian Vick
_______________________________________________
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.