Forked from tgcnzn/Copy track files from specific playlists on Itunes to a folder (applescript)
Created
September 23, 2020 01:46
-
-
Save krisai/82a8cbc4ff12f8ee7d8c5ce57128bb6c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set mylist to {"Beats", "Brasil", "Dubstep/Grime", "Groove", "Jungle/DNB/Electronic", "Rap", "Reggae/Dub", "Trap", "Trip-Hop"} | |
set loc to choose folder "Choose Parent Folder Location" | |
tell application "iTunes" | |
set myPlaylists to every playlist | |
repeat with myPlaylist in myPlaylists | |
if mylist contains name of myPlaylist then | |
set playListName to name of myPlaylist | |
set myTracks to every track of myPlaylist | |
tell application "Finder" | |
if not (folder playListName of loc exists) then | |
set targetFolder to make new folder at loc with properties {name:playListName} | |
else | |
set targetFolder to loc & playListName as string | |
end if | |
end tell | |
repeat with myTrack in myTracks | |
set trackName to name of myTrack | |
set trackArtist to artist of myTrack | |
set trackFile to location of myTrack | |
tell application "Finder" | |
set aName to name of trackFile | |
if not (exists targetFolder & ":" & aName as string) then | |
duplicate trackFile to targetFolder | |
end if | |
end tell | |
end repeat | |
end if | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment