• 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: Wait for applescript to complete
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wait for applescript to complete


  • Subject: Re: Wait for applescript to complete
  • From: has <email@hidden>
  • Date: Wed, 11 Jul 2007 19:57:51 +0100

Andrew James wrote:

I have this problem with my code, i use a apple script to communicate
with iSync however i need the script to finish before i run
BTFinishSession() which resets their bluetooth to its original state,
so the question is how do i make it wait for the AS to finish?

Your script is buggy - if iSync isn't already running when the script starts, the script won't enter the polling loop as intended. It should read:


tell application "System Events"
	set iSync_Running to (exists process "iSync")
end tell
tell application "iSync"
	if not syncing then synchronize
	repeat while syncing
		delay 1
	end repeat
	if not iSync_Running then quit
end tell


BTW, you might like to check out objc-appscript for sending Apple events directly from ObjC:


http://appscript.sourceforge.net/objc-appscript.html

HTH

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
http://appscript.sourceforge.net/objc-appscript.html

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: How to keep creation/modification date of a (Core Data) object?
  • Next by Date: Custom Image unit works in CoreImage Funhouse but not in Quartz Composer
  • Previous by thread: Re: Wait for applescript to complete
  • Next by thread: Linker flags set incorrectly ?
  • Index(es):
    • Date
    • Thread