I'm trying to write a script to sync a playlist with files in a network share, the purpose of this is to wirelessly keep my smartphone updated and commit purchased songs to my MM library. I have the very basics working - connecting to the network share and recursively enumerating files, connecting to the playlist by name and enumerating files. My question is; does anyone have suggestions on how to compare files in a network directory against entries in the library? What I really want to do is read the ID tag of each network file and compare them to the library files but I cannot for the life of me find a way to read ID tags from a file through the script properties.
Here's what I have so far. Once I figure out how to get the properties of the network files I'll figure out how to do the comparison.
Code: Select all
Sub CopyToBlackBerry() dim strBBPath(1) strBBPath(0) = "\\BlackBerry\removable_sdcard\music" strBBPath(1) = "\\BlackBerry\media\music" for iPath = 0 to ubound(strBBPath) set FSO = CreateObject("Scripting.FileSystemObject") set oParentFolder = FSO.GetFolder(strBBPath(iPath)) ShowSubFolders(oParentFolder) next playlistTitle = "BlackBerry" set oPlayList = sdb.playlistbytitle(playlistTitle) set oTracks = oPlaylist.tracks msgbox(oTracks.count) for iTrack=0 to oTracks.count-1 set cTrack = oTracks.item(iTrack) strPath = cTrack.path strLength = cTrack.songLength strTitle = cTrack.Title strArtist = cTrack.ArtistName ' once I figure out how to compare, I'll write some comparison code next End Sub Sub ShowSubFolders(objFolder) Set colFolders = objFolder.SubFolders For Each objSubFolder In colFolders msgbox(objSubFolder.Path) Set colFiles = objSubFolder.Files For Each objFile In colFiles ' this is where action should be taken on the file, call new sub ' need to figure out how to read the properties of a file on disk ' so that it can either be imported or skipped allFiles = allFiles & objFile.name & chr(10) Next msgbox(allFiles) ShowSubFolders(objSubFolder) Next End Sub