• 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: Repeat until application is frontmost
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Repeat until application is frontmost


  • Subject: Re: Repeat until application is frontmost
  • From: theDaniel <email@hidden>
  • Date: Fri, 13 Jan 2012 18:24:27 -0500

Yay!! It works! Thank you Luther!

Here's what I've got…

set OLB to application "Online Bible"
tell application "System Events" to keystroke "c" using command down
tell OLB to activate

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 OLB then delay 1


end repeat

tell application "System Events"
delay 0.3
keystroke "f" using command down
delay 0.3
keystroke "v" using command down
delay 0.2
keystroke (key code 36)


end tell

 -Daniel

On Jan 13, 2012, at 3:20PM, Luther Fuller wrote:

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

  • Follow-Ups:
    • Re: Repeat until application is frontmost
      • From: theDaniel <email@hidden>
References: 
 >Repeat until application is frontmost (From: theDaniel <email@hidden>)
 >Re: Repeat until application is frontmost (From: KOENIG Yvan <email@hidden>)
 >Re: Repeat until application is frontmost (From: theDaniel <email@hidden>)
 >Re: Repeat until application is frontmost (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Repeat until application is frontmost
  • Next by Date: Re: Repeat until application is frontmost
  • Previous by thread: Re: Repeat until application is frontmost
  • Next by thread: Re: Repeat until application is frontmost
  • Index(es):
    • Date
    • Thread