Set Genre in iTunes?

Hi everyone,

Is it possible to have a script set the Genre of a song in iTunes? I hope to create a folder action that will add a song to a specific playlist (that I can figure out) and then set the genre.

Being lazy like I am :), I hope to eventually create a folder action that will create a playlist from the name of the file I drop into it and set the genre. For example, drag the folder “Beatles - Help!” into my set up folder and have it create a playlist called “Beatles - Help!” and set the genre to “Pop”.

I have searched for workable or similar scripts (including Doug’s Scripts) and haven’t found them so I thought I’d ask if they were possible here before I attempt to create them since I am fairly new to writing scripts.

Thanks for any advice and insight,
Cindy in Indy

Hi,

assigning an existing genre to a track is quite easy


tell application "iTunes"
	set aTrack to 1st track whose name is "whatever"
	set genre of aTrack to "Pop"
end tell

Hi,

The script below works great for a song that is playing or one I select but I was hoping to attach at a script to a folder so that when I add a mp3 file to that folder it gets added to a specific playlist with a specific genre.

Maybe what I am wanting isn’t easily possible.

Thanks though for script below. :slight_smile:

Use folder actions.Here is a tutorial.

Hi thewaytoapplescript,

I know how to create a folder action, although I mostly use Hazel instead. I can get the tracks added to the correct playlist. I cannot get iTunes to apply the genre I put in the script.