HowTo get selected songs

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: HowTo get selected songs

Re: HowTo get selected songs

by PetrCBR » Thu Feb 09, 2017 3:48 pm

As i wrote, asJSON property will be introduced in next release.

Re: HowTo get selected songs

by Ludek » Thu Feb 09, 2017 3:27 pm

Re: Discogs Tagger

You might want to look at [MM5 install folder]/SampleScripts/customWebTagger.mmip (after install the sources will be in [MM5 install folder]/Scripts/customWebTagger/)

Re: HowTo get selected songs

by crap_inhuman » Thu Feb 09, 2017 2:42 pm

I try to convert the Discogs Tagger using Autoit3 scripting language - the script interact with MM using the COM interface. Works perfect with MM4. To get the script working with MM5 i need a COM interface as in MM4. This script is already finished.

Using the following code didn't return a object, so i would have to change the whole script.

Code: Select all

tracks = SDB.runJSCode('function(){ var list = uitools.getSelectedTracklist(); if(!list || !list.count) list = uitools.getTracklist(); if(list) return list.asJSON; return ''; }();')


I try to convert the script using the VBS2JS converter, too... But i don't know, if i can get it work sometime.

Re: HowTo get selected songs

by PetrCBR » Thu Feb 09, 2017 7:51 am

From COM interface you can get the tracks as JSON string using asJSON property (will be introduced in next build):

Code: Select all

tracks = SDB.runJSCode('function(){ var list = uitools.getSelectedTracklist(); if(!list || !list.count) list = uitools.getTracklist(); if(list) return list.asJSON; return ''; }();')

Re: HowTo get selected songs

by crap_inhuman » Thu Feb 09, 2017 3:06 am

Thank you for your answers.

Is it possible with the COM interface, too?

Re: HowTo get selected songs

by djdd » Wed Feb 08, 2017 3:43 pm

An example can be found in the SampleScript "fixTrailingThe", local.js, line 234, that also Show how to handle the Situation, if nothing was selected

Code: Select all

trackList = uitools.getSelectedTracklist()
if (!trackList || trackList.count == 0) {

    trackList = uitools.getTracklist()
}

if (!trackList || trackList.count == 0) {
    res = messageDlg("Select tracks to be updated", 'Error', ["btnOK"], {}, function(){})
    return
}
Regards,
Dieter

Re: HowTo get selected songs

by PetrCBR » Wed Feb 08, 2017 6:09 am

Code: Select all

var tracklist = uitools.getSelectedTracklist();

HowTo get selected songs

by crap_inhuman » Tue Feb 07, 2017 8:53 pm

How can i get the selected songs through api ?

Using the well-known SDB.SelectedSongList return no result

Top