How to Install custom script

Get help for different MediaMonkey 5 Addons.

Moderators: jiri, drakinite, Addon Administrators

MPG
Posts: 418
Joined: Tue May 13, 2008 11:22 pm

How to Install custom script

Post by MPG »

Hi,
I have created a custom script that I want add to MM5. How do I do it?
I should mention that I have a single file with the extension of .js
TIA
MPG
Triumph - Hold On: Music holds the secret, to know it can make you whole.
drakinite
Posts: 965
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: How to Install custom script

Post by drakinite »

There are a few different ways, but they all revolve around the structure of an MMIP (MediaMonkey Install Package), which is essentially a renamed zip file. All the info you'll need is on the wiki, but most important is this section: https://www.mediamonkey.com/wiki/Gettin ... _Structure

1. MediaMonkey has a special structure for allowing addons to append their code to an existing script via the _add suffix. So for example, if you have code specifically related to the TrackListView control (controls/trackListView.js), you'll put it in a file named trackListView_add.js within a "controls" subfolder. When MM loads, it'll append that code to trackListView.js and run it. If your code involves new actions, you'll need to define them in a file called actions_add.js (in the folder root).
2. If your code is relatively simple and doesn't involve any controls or actions, you can put it in a file named init.js in the folder root. MediaMonkey will automatically run addons' init.js if it exists.

For more references, take a look at addons within the SampleScripts folder in your MM install.
Image
Student electrical-computer engineer, web programmer, part-time MediaMonkey developer, full-time MediaMonkey enthusiast
I uploaded many addons to MM's addon page, but not all of those were created by me. "By drakinite, Submitted by drakinite" means I made it on my own time. "By Ventis Media, Inc., Submitted by drakinite" means it may have been made by me or another MediaMonkey developer, so instead of crediting/thanking me, please thank the team. You can still ask me for support on any of our addons.
Post Reply