Additional code samples & documentation needed! [#16744]
Posted: Tue Jun 16, 2020 11:34 am
Hello all,
I've been attempting to rewrite some MM4 scripts into MM5, and even though the "Inspect Element" is pretty useful, I'd like to suggest some needed code samples and improvements to the Scripting documentation:
1. A description of all available control types and how they are used, such as the dropdrown. I can't seem to figure out how to properly initialize a drop down because I get an error about focusedIndex not being allowed, even though I've created the dropdown exactly the way I see it in the inspected sources.
2. If there are any MM5 prebaked dialog boxes available, a list of them and how they should be called would be very nice. For example, if the dialog box in the AutoDJ options for selecting a playlist is ready to use, I'd be happy to know about it.
3. A full list of the lifetime of options windows - for example, "load" is called only once, when the dialog is first seen, but seemingly never again, and "save" is called when the "OK" button is hit. There doesn't seem to be an example of what is called when the "Cancel" button is hit, or when the options window becomes active. This is important to reload application values from their defaults if "Cancel" is hit.
4. The automatically generated class API documentation looks broken, because when you click on something the relevant material is positioned out of view, below the classes. A two-pane approach for that documentation would help immensely.
5. Code samples for accessing MediaMonkey data structures, such as Playlists, would be quite helpful. At the moment I do a lot of searching through the Scripts directory hoping to find what I'm looking for, which is time consuming and rarely yields results.
6. The API documentation specifically mentions classes like "Playlists" - and mentions that the class declared in "native/Playlists.js" - but when scripting, this file can't be included, and "app.playlists" should be used to get to the class. Mentioning that in the documentation would be quite useful, since it is time consuming to find that by reading other script code.
Also, for local script development, it would be nice to be able to disable the log/problem reporting feature for my new options window so that your crash database doesn't get filled with reports that you can't fix anyway.
I'm very happy you are using ES8/JS as the scripting language, by the way. Abandoning VBA was a wise choice.
I've been attempting to rewrite some MM4 scripts into MM5, and even though the "Inspect Element" is pretty useful, I'd like to suggest some needed code samples and improvements to the Scripting documentation:
1. A description of all available control types and how they are used, such as the dropdrown. I can't seem to figure out how to properly initialize a drop down because I get an error about focusedIndex not being allowed, even though I've created the dropdown exactly the way I see it in the inspected sources.
2. If there are any MM5 prebaked dialog boxes available, a list of them and how they should be called would be very nice. For example, if the dialog box in the AutoDJ options for selecting a playlist is ready to use, I'd be happy to know about it.
3. A full list of the lifetime of options windows - for example, "load" is called only once, when the dialog is first seen, but seemingly never again, and "save" is called when the "OK" button is hit. There doesn't seem to be an example of what is called when the "Cancel" button is hit, or when the options window becomes active. This is important to reload application values from their defaults if "Cancel" is hit.
4. The automatically generated class API documentation looks broken, because when you click on something the relevant material is positioned out of view, below the classes. A two-pane approach for that documentation would help immensely.
5. Code samples for accessing MediaMonkey data structures, such as Playlists, would be quite helpful. At the moment I do a lot of searching through the Scripts directory hoping to find what I'm looking for, which is time consuming and rarely yields results.
6. The API documentation specifically mentions classes like "Playlists" - and mentions that the class declared in "native/Playlists.js" - but when scripting, this file can't be included, and "app.playlists" should be used to get to the class. Mentioning that in the documentation would be quite useful, since it is time consuming to find that by reading other script code.
Also, for local script development, it would be nice to be able to disable the log/problem reporting feature for my new options window so that your crash database doesn't get filled with reports that you can't fix anyway.
I'm very happy you are using ES8/JS as the scripting language, by the way. Abandoning VBA was a wise choice.