Hi. This is a pretty basic question, apologies, but I have googled for ages and can’t work it out!
I want a script that whenever I add folders of music files to a certain folder it adds the music files from the folders or subfolders to itunes and then to a playlist called ‘New Music’. I have made a script that adds the files to itunes, but I can’t work out how to add them to the playlist. I assume it is a simple command that i need to add to the below, but I can’t seem to find it.
on adding folder items to this_folder after receiving these_items
tell application "iTunes"
launch
end tell
repeat with i in these_items
if folder of (info for i) is true then
tell application "Finder" to set folder_items to every item of i
process_folder(folder_items)
else
tell application "iTunes"
try
add i
end try
end tell
end if
end repeat
end adding folder items to
on process_folder(the_items)
repeat with j in the_items
set j to j as alias
if folder of (info for j) is true then
tell application "Finder" to set folder_items to every item of j
process_folder(folder_items)
else
tell application "iTunes"
try
add j
end try
end tell
end if
end repeat
end process_folder