Adding a simple script to a menu - any menu! (2024.2.0.3184)

To discuss development of addons / skins / customization of MediaMonkey v5 / v2024

Moderators: jiri, drakinite, Addon Administrators

Corneloues
Posts: 28
Joined: Thu Oct 22, 2009 4:41 am

Adding a simple script to a menu - any menu! (2024.2.0.3184)

Post by Corneloues »

HI I'm a very long-term MM4 user and have dabbled on and off with v5 and now 2024.

One of the things that has been holding me back is my library of VBScripts that I needed to convert to JavaScript.

I've now bitten the bullet and created my first script. Complete with info.json.

However, when I open MM the script never shows. I've tried every conceivable way of adding the script - even creating an mmip and adding it manually from the Addons dialog. It installs, MM restarts, but no script is visible.

I've even tried using ChatGPT and Copilot and have tried different methods of creating actions and adding to menus, but still nothing.

I've pasted the very simple "smoke test" json and js below. Can someone please tell me where I'm going wrong?

I'm not intending on making the scripts public. I just want to add them myself as I can do in MM4.

TIA,

Roy

info.json

Code: Select all

{
    "id": "SmokeTest",
    "version": "1.0.0",
    "title": "Smoke Test",
    "description": "Smoke test for menu registration.",
    "author": "Soundchaser",
    "type": "script",
    "main": "main.js",
    "minAppVersion": "5.0.0"
}
main.js

Code: Select all

// Simple function to test execution
function smokeTest() {
    app.showPopupMessage("Smoke test executed.");
}

// Register the action
actions.smokeTest = {
    title: "Smoke Test",
    icon: "",
    execute: smokeTest
};

// Register the menu item
window._menuItems.push({
    action: "smokeTest",
    path: "Tools/SmokeTest"
});
MiPi
Posts: 912
Joined: Tue Aug 18, 2009 2:56 pm
Location: Czech Republic
Contact:

Re: Adding a simple script to a menu - any menu! (2024.2.0.3184)

Post by MiPi »

Hi,
I recommend to start here: https://www.mediamonkey.com/wiki/Gettin ... 8Addons%29
Part "Actions, Hotkeys & Menus" describes how to add items to menus.
Post Reply