|
|
#1 |
|
Prospect
Join Date: Jan 2007
Posts: 25
|
Need help making iTunes auto update iOS apps
Managing all my iOS app updates has started to become a chore, and my goal is to make iTunes automatically update all apps that need updating so they're automatically pushed out to my iPhone and iPad at the next update. Sadly Apple has not given us any clear way to automatically update iOS apps either by Applescript nor by clear menus or keyboard shortcuts, so I appear to need to do it with UI scripting, the bane of poorly designed Mac software.
There are several options, including fiddling with Applescript, but Keyboard Maestro is what I'd like to use I think. The problem is, other than setting the screen to a set size and clicking the point where I know the "Update apps" button to be, I can't think of a way to reliably access that button. Another option is Automator, which I tend to dislike using for some reason, maybe because it makes me feel like a noob. I can make an action that loads iTunes and clicks the appropriate "Update apps" button at the bottom of the screen, but the fact that this button's value can change (now it says "2 Updatable Apps" instead) seems to break Automator. So my question, I guess, how can I script the clicking of the "Update now" button in the iTunes 11 apps tab as reliably as Automator can do it? If anyone has any suggestions on how to proceed it'd be great. Also if I'm missing any way to update apps directly using Applescript that's be awesome too, though I can't find any support for what I want to do in the dictionary. |
|
|
|
|
|
#2 |
|
Major Leaguer
Join Date: Apr 2010
Posts: 324
|
I don't have apps, and no "update apps" button, so I'm explaining this blind. Plus, I'm running Lion, so if your OS varies, so may your results. I hope that I'm giving enough info so that you can craft something that works. I'm also being more verbose in my explanation and the code, so that it's (I hope) more understandable for you and other users.
Running something like the following script in AppleScript Editor will return results which can supply clues as to how to refer to the UI element you want to act upon: Code:
tell application "iTunes" to activate tell application "System Events" tell application process "iTunes" tell window "iTunes" entire contents end tell end tell end tell Code:
static text "Apps" of row 8 of outline 1 of scroll area 1 of splitter group 1 of window "iTunes" of application process "iTunes" of application "System Events" Code:
row 8 of outline 1 of scroll area 1 of splitter group 1 of window "iTunes" of application process "iTunes" of application "System Events" Code:
tell application "System Events" tell application process "iTunes" tell window "iTunes" tell row 8 of outline 1 of scroll area 1 of splitter group 1 properties end tell end tell end tell end tell To find the updatable apps button (I hope there's only one), use something like: Code:
tell application "iTunes" to activate tell application "System Events" tell application process "iTunes" tell window "iTunes" -- select Apps section in Library tell row 8 of outline 1 of scroll area 1 of splitter group 1 select it end tell -- click updatable apps button tell group 1 of splitter group 1 set listButtonsUpdatableApps to (every button of it whose name contains "updatable apps") set buttonUpdatabaleApps to item 1 of listButtonsUpdatableApps click buttonUpdatabaleApps end tell end tell end tell end tell
__________________
see a problem; solve a problem. |
|
|
|
|
|
#3 |
|
Prospect
Join Date: Jan 2007
Posts: 25
|
Thanks for the reply, this is helpful. Unfortunately the script to get the "entire contents" of the UI times out after 2-3 minutes. Is there any other way to get this information dumped that you can think of?
|
|
|
|
|
|
#4 |
|
Hall of Famer
Join Date: Dec 2007
Posts: 3,642
|
Two points which aren't exactly direct answers to the original question. For one, getting the apps in iTunes beforehand isn't necessary for syncing. Plus, if you're running iOS 6 on the iPhone and iPad you can update the apps on the devices in three taps per device: Tap the App Store icon, tap the Updates section, Tao the Update All button. When you do sync, iTunes will grab newer app versions from the devices. In a sense, apps on a Mac (or PC) are essentially backups of what you can freely re-download from the App Store if you need to, not to mention the apps are part of device back ups to either your Mac or iCloud (depending upon which backup system you've chosen).
But out of curiosity, I set up a solution to this using Keyboard Maestro. Yes, that's US $36 software, but it took me about two minutes to configure a macro to handle this, and sojourner is spot-on in noting that GUI scripting is difficult to configure. Considering your interest in automating this activity, you may have other uses for Keyboard Maestro, and they border on the limitless because the software is so flexible in what it allows you to do. So I figured I'll point out this option. Anyway, the picture shows the macro I created. A keyboard shortcut starts things, though this could be launched in a number of other ways. iTunes activates, then the macro switches iTunes to the Apps section (⌘-7), presses the Tab key once to select the button which shows available updates, then activates that button by pressing the Space Bar. From there, it's just a couple instructions which move the mouse to where the Download All Updates option is always shown and clicking in that spot. If I were actually using this, I would make a couple adjustments beyond what's shown in the picture.
If you do decide to give Keyboard Maestro a try (there is a 30-day trial), just post if you have any questions about using it or setting up a macro for this. |
|
|
|
|
|
#5 |
|
Major Leaguer
Join Date: Apr 2010
Posts: 324
|
I've used with Keyboard Maestro. It's on my buy list, as it is an easy to use program that can do some fairly complex things. Not only does can it make UI scripting less of a pain, it has a number of other features that puts it on my buy list. I would definitely recommend taking it for a test drive if you have any doubts about buying it. The trial period is more than fair.
If you want to continue with the UI scripting, I am curious about your timeout issues. It's odd that it would take so long. Which OS are you using?
__________________
see a problem; solve a problem. |
|
|
|
|
|
#6 | |||||||||||||||||||||||
|
League Commissioner
Join Date: Sep 2003
Location: Tokyo
Posts: 6,046
|
Yes, they have. There's a "Download all updates" button in both iTunes and the device's App Store. There's also an "Always check for available downloads" option in iTunes preferences. You seem to want a "just do it in the background" option - such a feature wold be unreliable on anything except a desktop with a permanent internet connection, and you would complain about it if the system was downloading some giant update at the same time you are trying to watch streaming video. |
|||||||||||||||||||||||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|