Creating new playlist via Applescript
I am very new to Applescript and I am trying to create a temp Playlist but have met some errors. Can anyone help?
This is my script
tell application "iTunes"
my create_tempPlaylist("Temp1")
my create_tempPlaylist("Temp2")
display dialog "Voila!" buttons {"Thanks"} default button 1 with icon 1
end tell
on create_tempPlaylist(NameOfTempPlaylist)
if user playlist name:NameOfTempPlaylist exists then
try
--delete tracks of user playlist albumPlaylistName
end try
else
make new playlist with properties {name:NameOfTempPlaylist}
end if
end create_tempPlaylist
MacBook Pro with Retina display, OS X Yosemite (10.10.4)