iTunes question..

How do I select genre or artist from the playlist ‘Library’?

I’m not sure if this is what you are looking for…

tell application "iTunes"
	set x to artist of current track as string
	set y to genre of current track as string
	return x & space & y
end tell

I want to pick a type of genre or artist list and play it. For example I want to play the ‘Jazz’ (genre). I assume I pick ‘Jazz’ and then play it. This list is in the ‘library’ and is not a playlist.

Let me try and do a better job of explaining what I’m after. When you open iTunes and click Library in the ‘Source’ column, you come up with various categories in the Genre, Artist and Album columns. What I would normally do (with the mouse) is click on a specific genre, let’s say Jazz (in the Genre column), and click Play. This is what I would like an applescript to do-pick the ‘Jazz’ genre and then tell iTunes to play. Just like I would tell iTunes to play the ‘Library’ in an applescript.

Hi again David, thanks for the clearification. I’m still trying. This is close, but it needs some type of a repeat clause to finish playing the list of songs returned…

Thanks Mr Spence, every bit helps.

The browser which allows you to select a genre, artist, or album to play is not scriptable with iTunes. A good number of people wish it was.

Thanks for the info.

Look on this page for a script that will do something similar to what you want to do:
Shuffle and Play by Genre
http://www.malcolmadams.com/itunes/scripts/scripts02.shtml