Skip to content

Instantly share code, notes, and snippets.

@jspiewak
Created February 22, 2014 02:48
Show Gist options
  • Save jspiewak/9147887 to your computer and use it in GitHub Desktop.
Save jspiewak/9147887 to your computer and use it in GitHub Desktop.
Copy iTunes music to SD card
set dest to choose folder
tell application "iTunes"
set the_tracks to tracks of playlist "Audi Q5 MMI"
repeat with t in the_tracks
set ll to get location of t
set a to album artist of t
if length of a = 0 then
set a to artist of t
end if
set ab to album of t
-- Deal with compilations, unknown artist
-- Put script into github
tell application "Finder"
if not (exists folder a of dest) then
make new folder at dest with properties {name:a}
end if
if not (exists folder ab of folder a of dest) then
make new folder at folder a of dest with properties {name:ab}
end if
duplicate ll to folder ab of folder a of dest
end tell
end repeat
log "Done!"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment