Displaying data for Selected objects

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Risser

Displaying data for Selected objects

Post by Risser »

How can I, in a script, know which items are selected in the track list?
I'd like to show some summary info in a report, but only for the selected items and I'm not sure how to do this.

Anyone?
Peter
Pablo
Posts: 554
Joined: Sun Feb 22, 2004 2:59 am

Post by Pablo »

Use SDB.SelectedSongList :)
Several of the example scripts or scripts that other people have made use this, so if you look around you should get some examples.

Also, in the developers page you can find a help file detailing all available COM objects and properties (though the last time I checked it was the 2.2 version, but that still works in 2.3 8) )

Happy scripting 8)
Risser

Post by Risser »

I looked for some examples, but didn't see any that referenced only selected songs. Most scripts either built nodes, created playlists or updated/reported on the entire library.

So, I can get SDBSongData items from the SDBSelectedSongList (which isn't in the help file, by the way), assuming it acts just like an SDBSongList.

But I can't see how to get Quality/Mood/etc from there.

Is there some resource besides the "Developer Scripting" page? Because it doesn't have ANY of this information on it.

Thanks,
Peter
onkel_enno
Posts: 2153
Joined: Fri Jan 14, 2005 1:45 am
Location: Germany
Contact:

Post by onkel_enno »

Example:

Code: Select all

  set Songlist = SDB.SelectedSongList
  for i=0 to Songlist.Count-1
    set Track = Songlist.Item(i)
    SDB.MessageBox Track.Artist.Name, mtWarning, Array(mbOk)  
  next
You'll find the latest Help-File here:
http://www.mediamonkey.com/beta/MediaMo ... ipting.chm
Post Reply