repeat command out of place?


hey guys,

wrote script know close, not in right place. want script continously check see if program "musicsource_hd.osx" still running. once isn't, want quicktime player quit. doing wrong?

code:
tell application "system events"  	set isrunning ((application processes (name equal "musicsource_hd.osx")) count)  end tell  repeat until isrunning 0  	if isrunning greater 0  	else  		tell application "quicktime player" quit  	end if  end repeat
 

code:
  tell application "system events"  	set isrunning ((application processes (name equal "musicsource_hd.osx")) count)  end tell  repeat until isrunning 0  tell application "system events"  	set isrunning ((application processes (name equal "musicsource_hd.osx")) count)  end tell  	if isrunning less 1  		tell application "quicktime player" quit  	end if  end repeat
i modified enter loop (this off top of head, not @ mac) if musicsource_hd.osx running. if when script starts, tell quicktime quit once program no longer running. without check quit quicktime whenever script run, if musicsource_hd.osx never running.

might want put delay in repeat loop happens once every 5 seconds or so. otherwise tight loop eating cpu time (even if not intensive).

-lee
 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

Upgrade Eligibility?

need help with itunes 7.7

How to change Apple IDs on iPhones