Thanks for your assistance.
I sorry that I didn't read your posts carefully enough before. They were clear enough. It wasn't the answer that I was looking for, but now that I have slowed down, I now see that it seems a good solution to the COM facilties which will not be migrated to MM5.
Thanks for your patience with me.
A couple of questions while I wait for 2089
Code: Select all
Dim SDB : Set SDB = CreateObject("SongsDB5.SDBApplication")
Dim SLText : SLText = SDB.runJSCode("(function() { app.playlists.getByIDAsync(3).then(function(playlist) { playlist.getTracklist().whenLoaded().then(function (list) { runJSCode_callback(list.asJSON); }); }); })()", True)
Dim SL : Set SL = SDB.fromJSON(SLText)
While I am waiting would you mind posting an example JSON string from your List.asJSON callback in the above example code?
what type is SDB in that example? I don't see the runJSCode method documented here:
http://www.mediamonkey.com/webhelp/MM5P ... s/App.html
I looked in App and DB, as I thought it may be there ..?
Which is the part that is not coming until 2089? .. is the callback facility? ... or the facility to string commands together (eg like you have playlist.getTracklist().whenLoaded() working on the output of app.playlists.getByIDAsync(3)) ? .... or is it both facilities that are coming with 2089?
I tried giving things a bit of a prod while I am waiting, to see how things work, and to sort out how I would debug it.
ie. I tried blindly following your example to see if I could get passed back a simple string
Code: Select all
SDB.runJSCode("(function() { app.getIniFile().then(function(iniFileAccess) { iniFileAccess.getStringValue('System','DBName') }); }); ()", True)
It broke MM5, and returned just a blank unicode string.
I followed the advice from the sticky thread, and opened the Chromium Developer Tools console. ... It doesn't look like this is going to me much help when debugging something via COM ... ie. I see that I have an unexpected token, but I can't see inside any of the source modules, to see what token, and where. .. should I be able to see inside them?
How do you recommend testing a COM called runJSCode function?
If I coded the above fragment correctly, should I expect that a simple string, as output by getStringValue of type IniFileAccess, would be passed back through COM from my call to SDB.runJSCode? ... or do I need to do as you have done, and use JSON?
I seem to have generated a couple of dump files which got emailed back to MM ... do you want me to try and stop these being sent while i am testing my things?
Thanks for your assistance.
I sorry that I didn't read your posts carefully enough before. They were clear enough. It wasn't the answer that I was looking for, but now that I have slowed down, I now see that it seems a good solution to the COM facilties which will not be migrated to MM5.
Thanks for your patience with me.
A couple of questions while I wait for 2089
[code]Dim SDB : Set SDB = CreateObject("SongsDB5.SDBApplication")
Dim SLText : SLText = SDB.runJSCode("(function() { app.playlists.getByIDAsync(3).then(function(playlist) { playlist.getTracklist().whenLoaded().then(function (list) { runJSCode_callback(list.asJSON); }); }); })()", True)
Dim SL : Set SL = SDB.fromJSON(SLText)[/code]
While I am waiting would you mind posting an example JSON string from your List.asJSON callback in the above example code?
what type is SDB in that example? I don't see the runJSCode method documented here: http://www.mediamonkey.com/webhelp/MM5Preview/classes/App.html
I looked in App and DB, as I thought it may be there ..?
Which is the part that is not coming until 2089? .. is the callback facility? ... or the facility to string commands together (eg like you have playlist.getTracklist().whenLoaded() working on the output of app.playlists.getByIDAsync(3)) ? .... or is it both facilities that are coming with 2089?
I tried giving things a bit of a prod while I am waiting, to see how things work, and to sort out how I would debug it.
ie. I tried blindly following your example to see if I could get passed back a simple string
[code]SDB.runJSCode("(function() { app.getIniFile().then(function(iniFileAccess) { iniFileAccess.getStringValue('System','DBName') }); }); ()", True)[/code]
It broke MM5, and returned just a blank unicode string.
I followed the advice from the sticky thread, and opened the Chromium Developer Tools console. ... It doesn't look like this is going to me much help when debugging something via COM ... ie. I see that I have an unexpected token, but I can't see inside any of the source modules, to see what token, and where. .. should I be able to see inside them?
How do you recommend testing a COM called runJSCode function?
If I coded the above fragment correctly, should I expect that a simple string, as output by getStringValue of type IniFileAccess, would be passed back through COM from my call to SDB.runJSCode? ... or do I need to do as you have done, and use JSON?
I seem to have generated a couple of dump files which got emailed back to MM ... do you want me to try and stop these being sent while i am testing my things?