regnix
regnix

Reputation: 123

How do I select playlists in a subfolder in Itunes using AppleScript?

This code will return all the play lists in iTunes:

tell application "iTunes"

get name of playlists

end tell

How do I return all play lists in a subfolder?

Thank you in advance.

Upvotes: 3

Views: 798

Answers (1)

adayzdone
adayzdone

Reputation: 11238

You can try something like this:

tell application "iTunes"
    set myList to {}
    set myFolder to folder playlist "testFolder"

    set myPlaylists to playlists
    repeat with aPlaylist in myPlaylists
        try
            if aPlaylist's parent = myFolder then set end of myList to aPlaylist's name
        end try
    end repeat

    return myList
end tell

Upvotes: 2

Related Questions