• 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
Script to force iTunes'11 to start and check for App updates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Script to force iTunes'11 to start and check for App updates


  • Subject: Script to force iTunes'11 to start and check for App updates
  • From: Esa Ruoho <email@hidden>
  • Date: Fri, 05 Apr 2013 12:26:33 +0300

Hi. I've been fiddling with this for a while now and am really hoping someone might have something to add.

Ever since we got iTunes'11, CMD-7 has taken me to "App list", and CMD-R to "My App Updates".
So, I wanted to create an iCal event that runs an AppleScript that starts iTunes, activates iTunes, presses CMD-7 and then CMD-R, and then I'd be able to wake up to a list of updated apps.
Did it work? Yes, and no. Then I fiddled with it a little bit more, and did it work? Yes, and no.

1st iteration was this:

tell application "iTunes" to launch

tell application "iTunes" to launch

delay 2

tell application "iTunes" to activate

tell application "iTunes" to activate

tell application "System Events"

tell process "iTunes" to keystroke "7" using command down

tell process "iTunes" to keystroke "r" using command down

end tell

tell application "iTunes" to activate

tell application "System Events"

tell process "iTunes" to keystroke "r" using command down

end tell


Well, that kind of worked. If iTunes wasn't open, it was opened, activated, and cmd7+cmd-r would be pressed. If sometimes iTunes was slow to activate or somehow "lurched", the first cmd-r was ignored so hence why I added a second cmd-R, just to make sure.

But this took into consideration: nothing. For instance, if I had left work and left iTunes into the state where the Search Bar was active. I just couldn't, for the life of me, figure out a way to get away from the Search Bar. So, after a while, I updated the script to the 2nd iteration:


tell application "iTunes" to launch

delay 2

tell application "iTunes" to activate

tell application "System Events"

tell process "iTunes" to keystroke "l" using command down

tell process "iTunes" to keystroke "7" using command down

tell process "iTunes" to keystroke "r" using command down

end tell


Objective was to also use CMD-L, which "focuses on the song being played" (thus escaping away from the Search Bar. So I was happy for a while, up until I came to work and saw that nothing had actually happened. Why? Because, if iTunes is started for the first time, and nothing is playing, there's nothing to be done.

So, here's where I'm at now. I've got a half-working script, and I just can't for the life of me figure out how to get a clear cmd-7/cmd-r, no matter if search bar is selected, if iTunes is closed or open, or if iTunes is playing a song (and paused) or not.

How should I go about doing this, please?


Yours, Esa
http://esaruoho.tumblr.com/
http://www.lackluster.org/
 _______________________________________________
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: Script to force iTunes'11 to start and check for App updates
      • From: Brian Christmas <email@hidden>
    • Re: Script to force iTunes'11 to start and check for App updates
      • From: Brian Christmas <email@hidden>
    • Re: Script to force iTunes'11 to start and check for App updates
      • From: Brian Christmas <email@hidden>
  • Prev by Date: Re: Launching one Applescript app with another Applescript app fails in OS X 10.8
  • Next by Date: Re: Script to force iTunes'11 to start and check for App updates
  • Previous by thread: Re: Launching one Applescript app with another Applescript app fails in OS X 10.8
  • Next by thread: Re: Script to force iTunes'11 to start and check for App updates
  • Index(es):
    • Date
    • Thread