PDA

View Full Version : Help: Petition for a Script


jfischetti
09-17-2003, 07:10 PM
Since iTunes can accept multiple "genre" keywords, can someone write a script that will:

1. Accept a genre keyword (i.e. "Single") to apply to a set of selected songs
2. Apply "Single" keyword to 'Genre' ID3 tag if none exist
3. Apply ", Single" to keywords that already exist in the tag.

i'm not sure if this can be done, but i sure would love to be able to genre keywods enmasse.

Thanks in advance.

Doug Adams
09-17-2003, 09:44 PM
If you are considering this, read the comments at this thread (http://www.macosxhints.com/article.php?story=20030409021945127) at Mac OS X Hints.

eustacescrubb
09-20-2003, 11:02 PM
I solved the problem somewhat by assigning my own custom genres, like so:

I have a bunch of stuff that's more or less just rock and roll; I want, some times, to have all this stuff in one smart playlist, so I want all of it to be called "rock" in some way (not "Aleternative and Punk", for example, which is a dumb, dumb dumb grouping. That's like having a "Smooth Jazz and Disco" genre). So, I make compound genres:

Rock
Alternative Rock
Punk Rock
Metal Rock
Grunge Rock
Classic Rock

etc, etc.

I do the same with jazz:

Jazz
Bebop Jazz
Swing Jazz
Big Band Jazz
Vocal Jazz
Fusion Jazz

etc, etc.

This works fairly well.

(Doug, I was tempted to make a Venn Diagram of this concept, but alas, the baby began to cry. ;) )

Doug Adams
09-21-2003, 09:37 AM
I was tempted to make a Venn Diagram of this concept

:D

If compound Genres are acceptable (I think the space is better than comma as delimiter, yes?) then a script could be written that manipulates the genre property of a track pretty easily.

My concern was that it would royally screw things up. Here is an example of what jfischetti was inquiring about:

tell application "iTunes"
if selection is not {} then
set g_component to text returned of (display dialog "Enter additional Genre keyword:" default answer "")
set sel to a reference to selection
repeat with aTrack in sel
tell aTrack
try
set genre to (get genre & space & g_component)
end try
end tell
end repeat
else
display dialog "Select some tracks first" buttons {"Cancel"} default button 1 giving up after 15
end if
end tell

No error checking, and probably could use a bell and a couple of whistles, but this works. I did not use a comma, however if you wanted to use one, substitute ", " (quotes and all) for space.