Great to have you migrating your scripts!
1) The answer to your question about _add files and init.js can be found here:
https://www.mediamonkey.com/wiki/Gettin ... dons)#Code
There's nothing intrinsically special about local.js; it's just an extra script you can call with
localRequirejs (more info here:
https://www.mediamonkey.com/wiki/Import ... #requirejs)
2) Could you show me more of your code? Does it await the tracklist's whenLoaded() ?
3) If you've created
actions.ReplaceString and it already has code to open the dlgReplaceString dialog inside its
execute function, you could do the following instead of your provided toolbutton code:
Code: Select all
window.uitools.addToolButton('righttoolbuttons', 'javascript', actions.ReplaceString.execute);
Just make sure that you define
actions.ReplaceString inside actions_add.js. If it's created in a different file, it might not load properly.
4)
https://www.mediamonkey.com/wiki/Gettin ... oring_Data
If your dialog has an OK button, then you should listen to its "click" event and do all your business code there. You can then retrieve the values of your controls (i.e. checkboxes, dropdowns, text inputs, etc.) and store them with
app.setValue. For an example, check out the
Split Multi-Value Fields addon.
5) You can use any vector graphics editor, such as Adobe Illustrator (paid) or Inkscape (free). Looks like there's also a free web-based one:
http://svgeditoronline.com/editor/
Sometimes the SVG code that's output from those programs doesn't play nice with MediaMonkey, so you might have to edit the code after the fact. If an icon doesn't display properly, try changing the <svg> at the top with this:
Code: Select all
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1000 1000" style="enable-background:new 0 0 1000 1000;" xml:space="preserve">
The viewBox attribute might lead to the icon scaling wrong, so you might need to change the numbers around a bit.
It's definitely not an exact science, but with some trial and error, you can get it to work!