Re: Repeat until application is frontmost
Re: Repeat until application is frontmost
- Subject: Re: Repeat until application is frontmost
- From: Luther Fuller <email@hidden>
- Date: Fri, 13 Jan 2012 14:20:54 -0600
On Jan 13, 2012, at 1:35 PM, theDaniel wrote: Thank you guys. Already tried the first one, didn't work. Just now tried the second, it didn't work either. I'll have to try this on Sno Leo later, but right now I'm on Lion and it don't work. :)
This will work ...
repeat 60 times -- 1 minute tell application "System Events" to set frontAppl to (name of (some process whose frontmost is true)) as text if frontAppl is "Finder" then beep delay 1 end repeat display dialog "Finished!"
WARNING: The 'delay' is there for a reason having nothing to do with 'beep'. If you have a 'repeat' loop which will run for a long time, it must contain a 'delay' to prevent overheating of your CPU.
I do monitor my CPU temperature and without a 'delay' or with a too-short 'delay' I can watch the CPU temperature rise. This can be dangerous!
|
_______________________________________________
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