InitialKey doesnt work in script

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey for Windows 4.

Moderators: Gurus, Addon Administrators

EinsteinX
Posts: 31
Joined: Thu Feb 04, 2010 2:29 pm

InitialKey doesnt work in script

Post by EinsteinX »

I tried modifying the Swap Artist / Title script to get the song key copied to the Custom 1 field. Running the script I get the error message saying that the object doesn't support property or method: 'itm.InitialKey', though according the table in the wiki InitialKey should be the correct field. The script works flawlessly if I change it to itm.Custom1 = itm.Custom2, so for some reason the script doesn't want to read from InitialKey, though I don't understand why. Can anyone explain? Here's the script:

Sub ExtractKey
Dim list, itm, i
Set list = SDB.CurrentSongList
For i=0 To list.count-1
Set itm = list.Item(i)
itm.Custom1 = itm.InitialKey
Next
list.UpdateAll
End Sub

Tx, Eins
mcow
Posts: 834
Joined: Sun Sep 21, 2008 9:35 pm
Location: Cupertino, California

Re: InitialKey doesnt work in script

Post by mcow »

EinsteinX wrote:according the table in the wiki InitialKey should be the correct field.
Which table are you looking at? I don't see InitialKey documented for SDBSongData.
Lowlander
Posts: 56491
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: InitialKey doesnt work in script

Post by Lowlander »

Peke
Posts: 17457
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: InitialKey doesnt work in script

Post by Peke »

Currently Only way to manipulate that field is to use SQL queries.

It is on our to do list but not yet fully implemented

See http://www.ventismedia.com/mantis/view.php?id=7181
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
EinsteinX
Posts: 31
Joined: Thu Feb 04, 2010 2:29 pm

Re: InitialKey doesnt work in script

Post by EinsteinX »

I don't think I'm smart enough (yet) to use SQL queries

Eins
Post Reply