External Tools for MM5

Get help for different MediaMonkey v5 / v2024 Addons.

Moderators: jiri, drakinite, Addon Administrators

Andre_H
Posts: 446
Joined: Thu Jan 21, 2021 2:04 pm
Location: Germany

External Tools for MM5

Post by Andre_H »

As an example how to open external tools (MP3Tag here):

Code: Select all

//* open file or folder of selected track in MP3Tag.*//
// variables ...
var AppPath = "\\\\YourServer\\YourShare\\Mp3Tag\\MP3Tag.exe" 
//var AppPath == "X:\\YourFolder\\Mp3Tag\\MP3Tag.exe"

actions.openFileMP3Tag = {
    title: _('Open track in MP3Tag ...'),
    icon: 'openMP3Tag',
    disabled: uitools.notMediaListSelected,
    visible: window.uitools.getCanEdit,
    execute: async function () {	
	var list = await uitools.getSelectedTracklist().whenLoaded();
        
	if (list.count === 0) {
            return;
        }

        list.forEach(function(itm) {
		var AppParameters = '/fn:"' + itm.path + '"'
		app.utils.shellExecute(AppPath, AppParameters)	
        });       
    }
}

actions.openFolderMP3Tag = {
    title: _('Open track folder in MP3Tag ...'),
    icon: 'openMP3Tag',
    disabled: uitools.notMediaListSelected,
    visible: window.uitools.getCanEdit,
    execute: async function () {	
	var list = await uitools.getSelectedTracklist().whenLoaded();
        
	if (list.count === 0) {
            return;
        }

        list.forEach(function(itm) {
		var AppParameters = '/fp:"' + itm.path + '"'
		app.utils.shellExecute(AppPath, AppParameters)	
        });       
    }
}

window._menuItems.editTags.action.submenu.push({
        action: actions.openFileMP3Tag,
        order: 1,
        grouporder: 2
});

window._menuItems.editTags.action.submenu.push({
        action: actions.openFolderMP3Tag,
        order: 2,
        grouporder: 2
});
Credits to all the guys in the addon subforum, I just jingled it together following the instructions from there.
It's nowhere near the same as the addon linked above, but possibly an approach.
- my 24/7 media server | MMW 2024.0.0.3038 (non-portable, shared DB & files, only essential addons) | Windows 2016
- my desktop app | MMW 2024.0.0.3038 (portable, shared DB & files) | Windows 11
- my mobile app | MMA Pro 2.0.0.1175 on several Android 10, 11, 12 devices | WiFi Sync

- MP3Tag | MP3Diags | MP3DirectCut | IrfanView
tbm72
Posts: 458
Joined: Tue Dec 09, 2008 3:04 pm
Location: UK

Re: MMW5 Addon & Skin Requests

Post by tbm72 »

Andre_H wrote: Wed Apr 06, 2022 11:37 am As an example how to open external tools (MP3Tag here):
This looks very promising thanks! Sorry for the stupid question but how do I go about getting this code into MM? Do I need to look at the scripts folder or does it involve coding as an addon?

Happy to experiment if someone can point me in the right direction!
drakinite
Posts: 987
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: External Tools for MM5

Post by drakinite »

Hey guys, FYI I split these two posts off the Addon & Skin Requests thread to keep it on topic.
Image
Data scientist, 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.
Andre_H
Posts: 446
Joined: Thu Jan 21, 2021 2:04 pm
Location: Germany

Re: MMW5 Addon & Skin Requests

Post by Andre_H »

tbm72 wrote: Wed Apr 06, 2022 4:03 pm Sorry for the stupid question but how do I go about getting this code into MM? Do I need to look at the scripts folder or does it involve coding as an addon?
it's a subfolder under "scripts". if you PM me a mail adress, i can zip and send you the files, it's just 6files and 24kB at all.
- my 24/7 media server | MMW 2024.0.0.3038 (non-portable, shared DB & files, only essential addons) | Windows 2016
- my desktop app | MMW 2024.0.0.3038 (portable, shared DB & files) | Windows 11
- my mobile app | MMA Pro 2.0.0.1175 on several Android 10, 11, 12 devices | WiFi Sync

- MP3Tag | MP3Diags | MP3DirectCut | IrfanView
tbm72
Posts: 458
Joined: Tue Dec 09, 2008 3:04 pm
Location: UK

Re: External Tools for MM5

Post by tbm72 »

Thanks Andre, I seem to have a problem sending PMs for some reason - they just get put in my Outbox but not sent. I'll try again tomorrow.
Andre_H
Posts: 446
Joined: Thu Jan 21, 2021 2:04 pm
Location: Germany

Re: External Tools for MM5

Post by Andre_H »

Mail is on the way.

(I guess PM stay in outbox until the Receiver gets them)
- my 24/7 media server | MMW 2024.0.0.3038 (non-portable, shared DB & files, only essential addons) | Windows 2016
- my desktop app | MMW 2024.0.0.3038 (portable, shared DB & files) | Windows 11
- my mobile app | MMA Pro 2.0.0.1175 on several Android 10, 11, 12 devices | WiFi Sync

- MP3Tag | MP3Diags | MP3DirectCut | IrfanView
tbm72
Posts: 458
Joined: Tue Dec 09, 2008 3:04 pm
Location: UK

Re: External Tools for MM5

Post by tbm72 »

This is great Andre! I've managed to use your code to get an option which opens a selected track in XYplorer which is just what I'm after. The last step I'm stuck on is getting the option to appear under the 'Find more from same>' submenu when I right-click a track.

My slightly edited version of your code at the moment contains this:

Code: Select all

window._menuItems.editTags.action.submenu.push({
        action: actions.openFolderXYplorer,
        order: 1,
        grouporder: 2
});
Which works great but it puts the option as the first entry under the 'Edit Tags>' submenu. What I'd like is for it to be at the bottom of the 'Find more from same>' submenu. I've been reading through the 'Getting Started (Addons)' help page and also tried to decipher the 'actions.js' file but I can't quite find the right code to get it placed under that submenu option. I've tried things like:

Code: Select all

window._menuItems.findMoreFromSame.action.submenu.push
But I just get an error. I'm happy to admit I know nothing about coding but I think I'm almost there! Can anyone give me the final hint to get this code placed under the 'Find more From' submenu?
drakinite
Posts: 987
Joined: Tue May 12, 2020 10:06 am
Contact:

Re: External Tools for MM5

Post by drakinite »

Took a bit to find, but it looks like it's defined in uitools.findMoreMenuActions.explorerFolder. It's a bit more complicated than adding to an array in window._menuItems.x. More info on the override method here: https://www.mediamonkey.com/wiki/Import ... )#Override

Code: Select all

uitools.findMoreMenuActions.explorerFolder.override({
    getMenuItems: function($super, track) {
        var ret = $super(track);
        ret.push({
            title: 'Hello World',
            icon: 'folder',
            execute: function () {
                console.log('Hello World');
            },
            order: 99
        });
        return ret;
    }
});
Change the title, icon, execute, and order inside of that ret.push statement to whatever you like. You could also change it to ret.push(actions.openFolderXYplorer); if you want.
Image
Data scientist, 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.
tbm72
Posts: 458
Joined: Tue Dec 09, 2008 3:04 pm
Location: UK

Re: External Tools for MM5

Post by tbm72 »

drakinite wrote: Thu Apr 07, 2022 1:13 pm Took a bit to find, but it looks like it's defined in uitools.findMoreMenuActions.explorerFolder. It's a bit more complicated than adding to an array in window._menuItems.x. More info on the override method here: https://www.mediamonkey.com/wiki/Import ... )#Override

Code: Select all

uitools.findMoreMenuActions.explorerFolder.override({
    getMenuItems: function($super, track) {
        var ret = $super(track);
        ret.push({
            title: 'Hello World',
            icon: 'folder',
            execute: function () {
                console.log('Hello World');
            },
            order: 99
        });
        return ret;
    }
});
Change the title, icon, execute, and order inside of that ret.push statement to whatever you like. You could also change it to ret.push(actions.openFolderXYplorer); if you want.
Thanks so much for looking into that Drakinite, really appreciate your help. I'll have a good look through that later :)
Ludek
Posts: 5093
Joined: Fri Mar 09, 2007 9:00 am

Re: External Tools for MM5

Post by Ludek »

Alternativelly use this:

Code: Select all

uitools.findMoreMenuActions.xyplorerFolder = {
            getMenuItems: function (track) {
                if (!_utils.isRemoteTrack(track))
                    return [{
                        title: function () {
                            return _('Folder') + ' (XYplorer)';
                        },
                        icon: 'folder',
                        execute: function () {
                        	    bindAction( actions.openFolderXYplorer,  track).execute();	
                        },
                        order: 90
                    }];
            }
        }
And in the execute method of action openFolderXYplorer you can access the track via this.boundObject.
So the path to open will be this.boundObject.path
carbykev
Posts: 9
Joined: Thu Sep 17, 2009 7:13 am
Location: Victoria, Australia

Re: External Tools for MM5

Post by carbykev »

Hello all,

I miss External Tools from MM2,3,4. I've been using free MM since 2003, Gold version since May 2009.

I switched to MMW5 about a year ago and have struggled since editing files. I'm not a programer, etc. I would love to have External Tools in MMW5, as I do a lot of audio editing, etc.

I've looked at the available addon list and it is not there for MMW5, only the last version 1.4 for MMW4.

I don't know how to 'add the script' or get it listed under Tools, or right-click.

Any help would be greatly appreciated. If not I'll either have to go back to MMW4 or try another organizer (don't want to, really love MM!).

Thanks in advance for your help.

Regards,
Kevin
Wherever you go, there you are (Unless you're having an out-of-body experience. In that case, come back soon it's getting cold).
Have, use and love MM Life-time Gold.
Love is the only reason to live, music is the rhythm it moves to.
f1oren
Posts: 1
Joined: Wed Dec 04, 2024 2:03 pm

Re: External Tools for MM5

Post by f1oren »

Hello

Like Kevin I am trying to understand how to add in MediaMonkey 5 the possibility to open files directly in Mp3Tag. Is it possible to have a step-by-step explanation? Thanks in advance
Post Reply