Repeat until application is frontmost
Repeat until application is frontmost
- Subject: Repeat until application is frontmost
- From: theDaniel <email@hidden>
- Date: Fri, 13 Jan 2012 11:02:46 -0500
I'm trying to figure out how I can get an applescript to repeat until the application is frontmost.
I want this script usable from whatever application I'm using and whether the application "Online Bible" <kenhamel.com> is running or not. If it isn't running then it takes 6 or more seconds (on my Mac) to activate for the first time after bootup. If it has been activated more than once since bootup then it take less time and of course its almost instantaneous if it is running. I will activate this using the Script menu.
set OLB to application "Online Bible" tell application "System Events" keystroke "c" using command down tell OLB to activate delay 6 (* repeat until OLB is frontmost end repeat *) keystroke "f" using command down -- the search dialog is slow to draw delay 0.3 keystroke "v" using command down delay 0.2 keystroke (key code 36)
end tell
The above works but I don't know how to get it to work with a loop until the Online Bible is running and frontmost. When I put in a repeat the script stops there. I would be grateful for anyone's opinion and/or suggestions.
BTW the Online Bible for Mac is scriptable only through the GUI, it has no applescript dictionary.
Thanks in advance. -Daniel |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden