• 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 Sync iTunes Libraries Between Macs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Script to Sync iTunes Libraries Between Macs


  • Subject: Script to Sync iTunes Libraries Between Macs
  • From: Brian Cipresse <email@hidden>
  • Date: Wed, 24 Sep 2008 08:45:51 -0700

I found this great script online ... somewhere. It's not mine and unfortunately I totally forget where I found this. This script requires that the Mac being accessed has remote events enabled. I've added some simple "say" commands so I could audibly monitor what's happening between my two Macs. This script does a great job of syncing music but not anything else managed in iTunes (eg: not TV Shows, Movies).

 I've looked at all the possible iTunes applescript commands but I can't figure the proper command to sync non-music content. My suspicion is that the following line needs to be augmented or appended to also include non-music tracks:

set theListofTracks to location of file tracks of library playlist 1 where date added > theDateofLastSync

The entire script follows. I'm grateful for any knowledge and energy you have to respond.

Regards,
Brian

(*=== Properties and Globals===*)
property theDateofLastSync : "" -- date of last sync
property theOtherMachine : "" -- address of other machine

(*=== Main Run ===*)

if theDateofLastSync is "" then set theDateofLastSync to ((current date) - 1 * days) -- force date for first run
if theOtherMachine is "" then
display dialog "Please enter address of other Mac" default answer "eppc://10.0.1.193"
set theOtherMachine to text returned of the result
end if

-- chat with other machine
set GotsomeTracks to true
try
with timeout of 30000 seconds
tell application "itunes" of machine theOtherMachine
using terms from application "iTunes"
activate
set theListofTracks to location of file tracks of library playlist 1 where date added > theDateofLastSync
say "Brian is syncing"
end using terms from
end tell
end timeout
on error
set GotsomeTracks to false
say "No tracks"
end try

-- back to this Machine
set SyncedOK to false
if GotsomeTracks then
say "Got some tracks"
set SyncedOK to true
try
tell application "iTunes"
if (count of items of theListofTracks) is greater than 0 then
repeat with alocation in theListofTracks
add alocation to library playlist 1
end repeat
end if
end tell
on error
set SyncedOK to false
end try
end if

-- save sync date if all ok

if SyncedOK then set theDateofLastSync to current date
say "I'm done now"
 _______________________________________________
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 Sync iTunes Libraries Between Macs
      • From: Dave <email@hidden>
  • Prev by Date: Re: Changing permissions on a volume
  • Next by Date: Re: Script to Sync iTunes Libraries Between Macs
  • Previous by thread: Re: Instructions after file check...
  • Next by thread: Re: Script to Sync iTunes Libraries Between Macs
  • Index(es):
    • Date
    • Thread