-
Itunes playlist script
I have this script that automatically creates playlists on itunes, you run the script, you select the folder that contains the mp3s and the M3u playlist file and will create the playlist on itunes according to the m3u file name.
there is an issue with this script. It creates the playlist but adds the tunes twice (duplicates), so if there is a playlist with 10 tracks it will add the 10 tracks twice in the playlist.
Could anyone suggest a fix for this please
the code of the .js file is
// Add a series of artis/album directories to iTunes as playlists
var shell = WScript.CreateObject("Shell.Application");
var folder = shell.BrowseForFolder(0, "Select the folder containing your album/artist directories:", 512);
if(folder == null) WScript.Quit();
var iTunes = WScript.CreateObject("iTunes.Application");
var fso = WScript.CreateObject("Scripting.FileSystemObject") ;
var artists = new Enumerator(fso.GetFolder(folder.Self.Path).SubFold ers);
while(!artists.atEnd()) {
var albums = new Enumerator(fso.GetFolder(folder.Self.Path+"\\"+fso .GetBaseName(artists.item())).SubFolders);
while(!albums.atEnd()) {
var listname = fso.GetBaseName(artists.item())+" - "+fso.GetBaseName(albums.item());
iTunes.CreatePlaylist(listname).AddFile(albums.ite m());
albums.moveNext();
}
artists.moveNext();
}
WScript.Echo("Finished.");
-
This unfortunately has nothing to do with Java. Your best bet is to find a Javascript forum and ask this question there. Best of luck.