AppendToComment.js


Article Image
Tags:

Added On: 20th Jan 08

Links: [site] [download]

This script adds chosen text to the end of track comments for the songs selected. It does not erase or overwrite existing comment text, and it will not add the same text that is already in the comment field.

Script by [LiquidParallax].

With tracks that are highlighted (selected), it adds user-defined text to a comment without erasing and overwriting previous comment text. It will not add the same text that is already in the comment field (so if you have “live” already written in the comments and are adding “live” with this script it will only have one occurrence of the word).

  • Remember to replace “your appendage” (two occurences) with a word or phrase that you want to use.
  • If a track comment already contains “your appendage”, it will be skipped.
  • This could be useful for adding “live” to the comments of selected tracks, for instance.

var ITTrackKindFile = 1;
var objApp = WScript.CreateObject("iTunes.Application");
var tracks = objApp.SelectedTracks;
var numTracks = tracks.Count;
var i = 0;
while (numTracks != 0)
{
var currTrack = tracks.Item(numTracks);
if (currTrack.Kind == ITTrackKindFile)
{
var storedComm = currTrack.Comment;
if (storedComm.match(/your appendage/i) == null)
currTrack.Comment = storedComm + " your appendage";
}
numTracks--;
i++;
}
WScript.Echo ("The text has been appended to Comments.");

UnRelated Posts:

This post has been read 265 times.

No Comments

Leave a comment