• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: threads in appleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >threads in appleScript (From: Hamish Graham <email@hidden>)

  • Prev by Date: Re: GUI scripting 101
  • Next by Date: Getting screen resolution the Safari way
  • Previous by thread: Re: threads in appleScript
  • Next by thread: Mail.app/System Events GUI
  • Index(es):
    • Date
    • Thread