hi,
i made these script so when i download a mp3 or aac file to my downloads folder it adds them to the itunes library
but i was wondering how i can make it play the song i just added if itunes is not playing any music…
also, i would like some help on understanding the Script Editor dictionary, for example how do i call stuff(properties or elements) of the class playlist in itunes ??
UPDATE!!: i was able to code it, see below…
HELP!! itunes opens when i enable this folder action, is there anyway to make it so that it runs it only when itunes is needed???
on adding folder items to this_folder after receiving added_items
set added to 0
tell application "Finder"
repeat with aFile in added_items
if the name of aFile ends with {".mp3"} ¬
or the name of aFile ends with {".aac"} then
tell application "Finder"
try
tell application "iTunes"
if player state is stopped or player state is paused then
set addedTrack to add aFile
play addedTrack
else
add aFile
end if
end tell
on error err
display dialog err
end try
end tell
set added to 1
end if
end repeat
if added is 1 then
display dialog ¬
"Music files have been added to the iTunes Library."
move aFile to trash
end if
end tell
end adding folder items to