#FF00AA

Je m’appelle Cédric Bozzi, je crée des sites et des applications, et ceci est mon blog dédié à la technologie : vous y trouverez des news, des opinions et des tests, le tout écrit par un Mac-head aux opinions tranchées.

There’s an English version here, mais la majeure partie du contenu est tirée de mon flux Twitter, et donc disponible en une seule langue (qui change au hasard des humeurs).

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.

 

Archives

2001   01   02   03   04   05   06   07   08   09   10   11   12  

2002   01   02   03   04   05   06   07   08   09   10   11   12  

2003   01   02   03   04   05   06   07   08   09   10   11   12  

2004   01   02   03   04   05   06   07   08   09   10   11   12  

2005   01   02   03   04   05   06   07   08   09   10   11   12  

2006   01   02   03   04   05   06   07   08   09   10   11   12  

2007   01   02   03   04   05   06   07   08   09   10   11   12  

2008   01   02   03   04   05   06   07   08   09   10   11   12  

2009   01   02   03   04   05   06   07   08   09   10   11   12  

2010   01   02   03   04   05   06   07   08   09   10   11   12  

2011   01   02   03   04   05   06   07   08   09   10   11   12  

2012   01   02   03   04   05   06   07   08   09   10   11   12