View Single Post
Old 9th March 2006, 21:54   #351
Junior Member
Join Date: Feb 2005
Posts: 5
Informations disappear after updating Media Library with "MediaLibrary.Insert"

Hi scripters,

I'm using a slightly modified version of the script to call Mp3Tag.

All functions well but informations YEAR and BITRATE disappear and PLAYCOUNT is set to the maximum possible unsigned integer value 4294967295 :-) :-(


Script follows:

On Error Resume Next

Const ForReading = 1, ForWriting = 2

Dim fso, WshShell, TmpPlaylist, SendTo_Items
Dim TmpPlaylistPath, Mp3TagPath

Set fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")

'===== Get path where Mp3Tag is installed

Mp3TagPath = RegistryRead( _
"HKCU\Software\Moebius\Install\Mp3tag", "InstDir") & _

'===== Get filename of temporary playlist

TmpPlaylistPath = GetEnvString("%TEMP%") & _

'===== Create tmp. playlist

Set TmpPlaylist = fso.OpenTextFile(TmpPlaylistPath, _
ForWriting, True)

'===== Get selected "Send To" items (either from
'===== MediaLibrary or from playlist)

SendTo_Items = GetSendToItems

'===== Write selection to tmp. playlist

TmpPlaylist.WriteLine ("#EXTM3U")

For Each track In SendTo_Items
TmpPlaylist.WriteLine (track.Filename)


'===== Run Mp3tag and wait until it is finished

WshShell.Run """" & Mp3TagPath & """ ""/m3u:" & _
TmpPlaylistPath & """", 1, True

'===== Update entries in Media Library --> Errors in ML

For Each track In SendTo_Items
set theItem = LoadItem(track.filename)

'=== Have also tried MediaLibrary.RefreshMeta here.
'=== No difference.

gerd.gabriel is offline   Reply With Quote