I'm trying to figure how to download the file for iTunes songs which are are not yet downloaded to my local machine (and reside in the iTunes Match Cloud) using AppleScript or any other library.
My goal is to have a script running locally on a cron that downloads any 5 star rated song. As I stream most of my music via iTunes Match, I want an automated way to download those high rated songs.
I looked around and figured something like this would work:
tell application "iTunes"
activate
set results to (every file track of playlist "Library" whose rating is 100)
repeat with t in results
download t
end repeat
end tell
Although it just blows up:
error "iTunes got an error: item 1 of
{file track id 86657 of library playlist id 61224 of source id 66, .... }
doesn’t understand the “download” message."
Any help would be appreciated.
Best Answer
This does the job!
I couldn't figure how to do a nested condition on the
whose
so I simply acquire both set of searches for matched and uploaded songs and combined them.The
try
andif
just ensure we download the valid tracks if they don't exist locally.