Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Sync or eject iPods/iPhones in iTunes via AppleScript Apps
I find it frustrating that there's no quick and easy way to sync my iPod and iPhone in iTunes without a degree of mouse movement and clicking (someone please correct me if I'm wrong!). Since I'm a keyboard navigation fan, I wrote some very simple AppleScripts to either sync or eject all iPods/iPhones currently connected to iTunes. The scripts are identical apart from the type of action:

Sync iPod.scpt:
tell application "iTunes"
  repeat with s in sources
    if (kind of s is iPod) then update s
  end repeat
end tell
Eject iPod.scpt:
tell application "iTunes"
  repeat with s in sources
    if (kind of s is iPod) then eject s
  end repeat
end tell
I personally have these scripts in my user's Library/Scripts folder, and use Quicksilver to quickly invoke them when I want to force a sync or eject of my iPod/iPhone.
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[6,277 views]  

Sync or eject iPods/iPhones in iTunes via AppleScript | 8 comments | Create New Account
Click here to return to the 'Sync or eject iPods/iPhones in iTunes via AppleScript' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Sync or eject iPods/iPhones in iTunes via AppleScript
Authored by: 01 on Sun, Apr 27 2008 at 2:01PM PDT
Are you speaking of more that just the auto-sync option in iTunes?

[ Reply to This | # ]
Sync or eject iPods/iPhones in iTunes via AppleScript
Authored by: DougAdams on Sun, Apr 27 2008 at 2:41PM PDT
Are you speaking of more that just the auto-sync option in iTunes?

If your iPod is set to sync automatically, the update command will sync it on-the-fly. For instance, if you add new stuff to iTunes and want it on the iPod right away, rather than hit the "sync" button on the iPod's Summary screen, run the script with the update command. If you have it set to manually manage, update has no effect.

---
Doug's AppleScripts for iTunes
dougscripts.com

[ Reply to This | # ]

Sync or eject iPods/iPhones in iTunes via AppleScript
Authored by: paulpro on Sun, Apr 27 2008 at 9:56PM PDT
If you have it set to manually manage, update has no effect.

If you manually manage your music but sync other content, such as photos, bookmarks, contacts, and calendar items, will the update command trigger a sync of this data?

[ Reply to This | # ]
Sync or eject iPods/iPhones in iTunes via AppleScript
Authored by: DougAdams on Mon, Apr 28 2008 at 8:15AM PDT
You either manually mange or you don't, depending on how "Manually manage music and videos" is checked in the iPod's Summary screen. If it is checked, update has no effect.

---
Doug's AppleScripts for iTunes
dougscripts.com

[ Reply to This | # ]
Sync or eject iPods/iPhones in iTunes via AppleScript
Authored by: paulpro on Sun, May 4 2008 at 5:23PM PDT
You either manually mange or you don't, depending on how "Manually manage music and videos" is checked in the iPod's Summary screen. If it is checked, update has no effect.

Actually, it does.

Even if you have "Manually manage music and videos" checked, there are still other things that can need updating, and will be updated by the update command.

If you make a change to any of your:

- iPhoto albums
- calendars or calendar items
- address book contacts
- Safari bookmarks

then the update command will sync those changes.

And since those are the only things that I sync, this hint is perfect for my needs.

---
Why can't I colour label Address Book cards?


[ Reply to This | # ]

Sync or eject iPods/iPhones in iTunes via AppleScript
Authored by: mjb on Mon, Apr 28 2008 at 4:21PM PDT
Dave writes:
If your iPod is set to sync automatically, the update command will sync it on-the-fly. For instance, if you add new stuff to iTunes and want it on the iPod right away, rather than hit the "sync" button on the iPod's Summary screen, run the script with the update command. If you have it set to manually manage, update has no effect.
Dave's right on the money with the bit I've italicised. I basically wanted the ability to force an instant sync, usually right before I want to walk away from the desk with my iPhone. I don't personally use 'manually manage', so this script suits me perfectly.

I also have 'automatically sync when connected' disabled, and using this script causes an instant 'on-the-fly' update, just like pressing 'Sync' on the summary screen - but without having to navigate to the summary screen to do so.

[ Reply to This | # ]

Sync or eject iPods/iPhones in iTunes via AppleScript
Authored by: ptujec on Mon, Jan 5 2009 at 6:47AM PST
Would be nice to have a growl notification for both

[ Reply to This | # ]
Sync or eject iPods/iPhones in iTunes via AppleScript
Authored by: MtnBiker on Wed, Oct 14 2009 at 2:54PM PDT
iPhone is apparently an "unknown" device.
But with that change this script works for an iPhone in 10.6 and iTunes 9.0.1
if (kind of s is unknown) then eject s

---
Hermosa Beach, CA USA

[ Reply to This | # ]