Results 1 to 2 of 2
Thread: Itunes playlist script
- 03-19-2009, 11:25 AM #1
Member
- Join Date
- Mar 2009
- Posts
- 1
- Rep Power
- 0
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.");
-
Similar Threads
-
Need Java Script Installed
By billaaa777 in forum Jobs OfferedReplies: 0Last Post: 09-04-2008, 04:37 PM -
Running a script within IE
By Java Tip in forum SWTReplies: 0Last Post: 07-25-2008, 02:33 PM -
Sample ANT Script
By Java Tip in forum Java TipReplies: 0Last Post: 01-24-2008, 03:22 PM -
JSP redirection script
By ravian in forum New To JavaReplies: 1Last Post: 01-07-2008, 10:33 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks