(* $Id: count_playlist.osa 353 2002-09-20 22:50:32Z comdog $ *) tell application "iTunes" set myCount to 0 repeat with i from 1 to (the count of the playlists) set this_playlist to playlist i try if the name of this_playlist is "iTune" then set myCount to myCount + 1 end if end try end repeat return myCount end tell