FREN

#FF00AA


27 nov. 2007

AppleScript: Enhanced Application Object Model

I still don’t know why my on idle script that updated the “currently playing” item on my blog doesn’t work in Leopard, but this new bit is quite useful for just about anything you want to do with AppleScript:

tell application "iTunes"

  −− won’t launch iTunes if it isn’t running

  if it is running then

    pause

  end if

end tell

 

And the variant I find more intuitive:

if application "iTunes" is running then

  tell application "iTunes"

    pause

  end tell

end if

 

P.S. Hmm, for some reason the “Stay Open” bit you must set when saving the on idle application had gotten lost at some point.

→ www.apple.com

Want to know when I post new content to my blog? It's a simple as registering for free to an RSS aggregator (Feedly, NewsBlur, Inoreader, …) and adding www.ff00aa.com to your feeds (or www.garoo.net if you want to subscribe to all my topics). We don't need newsletters, and we don't need Twitter; RSS still exists.

Legal information: This blog is hosted par OVH, 2 rue Kellermann, 59100 Roubaix, France, www.ovhcloud.com.

Personal data about this blog's readers are not used nor transmitted to third-parties. Comment authors can request their deletion by e-mail.

All contents © the author or quoted under fair use.