Re: Wait for applescript to complete
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