Help with a script needed !

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus


Help with a script needed !

Post by Apopsis »

Help with a script needed !
I have no experience with visual basic
I want to make a simple script to copy the ''media'' field of every song
in the database (or selected songs) to the custom 1 field(s).
I take as a reference the ''SwapTitleArtist'' script, because it looks similar.
Added in the Scripts.ini file the lines :

DisplayName=&Copy Media to custom 1
Description=Copy Media content to custom 1 field

After that, i modified the ''SwapTitleArtist.vbs''
and made the file ''CopyMedia2custom1.vbs'' in the scripts directory.
whith these lines inside :

' A simple script that copy the content of media field to custom 1 field of selected tracks

Sub CopyMedia2custom1
' Define variables
Dim list, itm, i, tmp

' Get list of selected tracks from MediaMonkey
Set list = SDB.SelectedSongList
If list.count=0 Then
Set list = SDB.AllVisibleSongList
End If

' Process all selected tracks
For i=0 To list.count-1
Set itm = list.Item(i)

' copy the fields
itm.Custom 1 = itm.Media

' Update the changes in DB
End Sub

The script appear now in the scripts menu, but it give me some errors when i run it.
What is wrong ? Am i missing something ?

Thanks, (and sorry for my bad english !)
Posts: 5397
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic

Post by jiri »

There is a problem in the line assigning Media label to the custom field, which should look like:

itm.Custom1 = itm.MediaLabel


Post by Apopsis »

Thank you Jiri - its working now !

Can you please tell me how to name the other fields
(i want to make some simillar scripts)

Filename, Path, Artist, Title, Genre, etc
I tried the ''Filename'' field like ''itm.Filename'' or ''itm.FilenameLabel''
and did not worked
Posts: 5397
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic

Post by jiri »

Look at this post (, there is an IDL definition of all exported objects. It's not much, there isn't any description of them, but together with the examples it should be enough for making new scripts.

Posts: 47969
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Update song tags itself?

Post by Lowlander »

Does a script like this also update the tags in the file itself or just in the DB?
Lowlander (MediaMonkey user since 2003)
Post Reply