Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'This script might make it easier' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
This script might make it easier
Authored by: robJ on Feb 05, '03 12:05:02PM

I don't use my laptop for music very often so scripting iTunes isn't something that I do on a regular basis. With that said, this quickly composed script might be useful in adding a rating to the comment field of every track in a playlist. The script could probably stand some tweaking/error checking but tests indicate that it works ok as is and it can easily be modified to suit your needs. It requires that a playlist window be open and frontmost.

-- begin script --
set trackRating to "Rated G" -- change as desired

tell application "iTunes"
set frontmostWin to class of front window -- Check class of front window
if frontmostWin is not playlist window then -- Quit the script if it isn't a playlist
display dialog "Please open a playlist window and run the script again." buttons {"OK"} default button 1
return
end if
set playlistName to name of front window -- Get the playlist window name
set trackList to tracks of playlist playlistName -- Get a list of the tracks
repeat with thisTrack in trackList -- Add the comment to every track
set oldContent to comment of thisTrack
if oldContent is not "" then
set comment of thisTrack to comment of thisTrack & ". " & trackRating
else
set comment of thisTrack to trackRating
end if
end repeat
end tell
-- end script --



[ Reply to This | # ]
This script might make it easier
Authored by: Xeo on Jun 05, '03 01:11:58AM

Seems to me, if you are creating a playlist of acceptable songs, why not just "Cmd-I" on the whole playlist and set the comment for all the tracks at once. Seems a bit easier than using AppleScript.



[ Reply to This | # ]