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

Re: Script to Sync iTunes Libraries Between Macs


  • Subject: Re: Script to Sync iTunes Libraries Between Macs
  • From: Dave <email@hidden>
  • Date: Thu, 25 Sep 2008 11:39:29 +0100

Hi,

Add the statement:

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

Try this:

set theListofTracks to theListofTracks & location of file tracks of playlist "Movies" where date added > theDateofLastSync

set theListofTracks to theListofTracks & location of file tracks of playlist "TV Shows" where date added > theDateofLastSync

Hope this helps

Cheers
Dave


Hi On 24 Sep 2008, at 16:45, Brian Cipresse wrote:

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 (applescript- email@hidden)
Help/Unsubscribe/Update your Subscription:
40looktowindward.com
Archives: http://lists.apple.com/archives/applescript-users


This email sent to email@hidden


_______________________________________________
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
References: 
 >Script to Sync iTunes Libraries Between Macs (From: Brian Cipresse <email@hidden>)

  • Prev by Date: Re: end tell issue..
  • Next by Date: renaming a usb memory stick using applescript
  • Previous by thread: Script to Sync iTunes Libraries Between Macs
  • Next by thread: Re: Script to Sync iTunes Libraries Between Macs
  • Index(es):
    • Date
    • Thread