Create Original Date

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Create Original Date

Re: Create Original Date

by bakker_be » Sat Jan 29, 2011 3:13 pm

Thanks a lot for this nugget. It's just what I needed right now!!

Re: Create Original Date

by ZvezdanD » Sun Apr 18, 2010 4:20 am

You could write that as some kind of programing exercise, but also you could use the RegExp Find and Replace add-on to copy fields e.g. Year to Original Year or Date to Original Date or whatever to whatever - after the installation just choose Edit/Tag Manipulation Presets/Copy <From Field> to <Into Field> and select your source and destination fields.

Re: Create Original Date

by kiwichick » Sat Apr 17, 2010 10:13 pm

Never mind. I got it fixed. It was a bit confusing when the MM column names are Date and Original Date but the required script names are Year and Original Year. I just changed Date for Year across the board and now it works.

Create Original Date

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.

Top