by kiwichick » Sat Apr 17, 2010 10:05 pm
Hi there, I know next to nothing about script writing but I recently managed to alter the SwapArtistTitle script so that I could copy Artist name to AlbumArtist name. I created the following vbs file:
Sub CreateAlbumArtist
' Define variables
Dim list, itm, i
' Get list of selected tracks from MediaMonkey
Set list = SDB.CurrentSongList
' Process all selected tracks
For i=0 To list.count-1
Set itm = list.Item(i)
' Copy the fields
itm.AlbumArtistName = itm.ArtistName
Next
' Write all back to DB and update tags
list.UpdateAll
End Sub
And I added the following to scripts.ini:
[CreateAlbumArtist]
FileName=CreateAlbumArtist.vbs
ProcName=CreateAlbumArtist
Order=6
DisplayName=Create AlbumArtist
Description=Copies Artist to AlbumArtist
Language=VBScript
ScriptType=0
It works perfectly. Now I'm trying to alter the script again to copy Date to OriginalDate but I can't get it to work. I have created the following vbs file:
Sub CreateOriginalDate
' Define variables
Dim list, itm, i
' Get list of selected tracks from MediaMonkey
Set list = SDB.CurrentSongList
' Process all selected tracks
For i=0 To list.count-1
Set itm = list.Item(i)
' Copy the fields
itm.OriginalDate = itm.Date
Next
' Write all back to DB and update tags
list.UpdateAll
End Sub
And I added the following to scripts.ini:
[CreateOriginalDate]
FileName=CreateOriginalDate.vbs
ProcName=CreateOriginalDate
Order=7
DisplayName=Create OriginalDate
Description=Copies Date to OriginalDate
Language=VBScript
ScriptType=0
But when I run the script I get the following error:
Error #438 - Microsoft runtime error
Object doesn't support this property or method 'itm.OriginalDate'
File: "C:\Program Files\MediaMonkey\Scripts\CreateOriginalDate.vbs, Line:13, Column :0
I'm guessing that OriginalDate should read something else. Any help would be greatly appreciated. Cheers.
Hi there, I know next to nothing about script writing but I recently managed to alter the SwapArtistTitle script so that I could copy Artist name to AlbumArtist name. I created the following vbs file:
Sub CreateAlbumArtist
' Define variables
Dim list, itm, i
' Get list of selected tracks from MediaMonkey
Set list = SDB.CurrentSongList
' Process all selected tracks
For i=0 To list.count-1
Set itm = list.Item(i)
' Copy the fields
itm.AlbumArtistName = itm.ArtistName
Next
' Write all back to DB and update tags
list.UpdateAll
End Sub
And I added the following to scripts.ini:
[CreateAlbumArtist]
FileName=CreateAlbumArtist.vbs
ProcName=CreateAlbumArtist
Order=6
DisplayName=Create AlbumArtist
Description=Copies Artist to AlbumArtist
Language=VBScript
ScriptType=0
It works perfectly. Now I'm trying to alter the script again to copy Date to OriginalDate but I can't get it to work. I have created the following vbs file:
Sub CreateOriginalDate
' Define variables
Dim list, itm, i
' Get list of selected tracks from MediaMonkey
Set list = SDB.CurrentSongList
' Process all selected tracks
For i=0 To list.count-1
Set itm = list.Item(i)
' Copy the fields
itm.OriginalDate = itm.Date
Next
' Write all back to DB and update tags
list.UpdateAll
End Sub
And I added the following to scripts.ini:
[CreateOriginalDate]
FileName=CreateOriginalDate.vbs
ProcName=CreateOriginalDate
Order=7
DisplayName=Create OriginalDate
Description=Copies Date to OriginalDate
Language=VBScript
ScriptType=0
But when I run the script I get the following error:
Error #438 - Microsoft runtime error
Object doesn't support this property or method 'itm.OriginalDate'
File: "C:\Program Files\MediaMonkey\Scripts\CreateOriginalDate.vbs, Line:13, Column :0
I'm guessing that OriginalDate should read something else. Any help would be greatly appreciated. Cheers.