Hi all! I’m very new to AppleScripting so I thought I’d practice by making a simple playlist generator.
So here’s my problem. My script seems to work. Script Debugger shows that multiple tracks were parsed, but nothing shows up in the playlist that the script is making. The playlist is always empty. Is this because of being logged in to iTunes Music? Any help is appreciated.
set theAnswer to (display dialog "What do you what to listen to?" default answer ¬
"New Playlist Name" buttons {"Electronic", "Indie", "Rock"} default button "Electronic")
set myplaylistName to text returned of theAnswer
set myGenre to the button returned of theAnswer
tell application "iTunes"
make playlist with properties {name:myplaylistName}
duplicate (tracks of library playlist 1 whose genre is myGenre)
end tell