//* 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.
- MMW 5.0.4.2690 (non-portable, shared DB & files) on Windows 2016 # only essential addons # my 24/7 media server
- MMW MMW 5.0.4.2690 (non-portable, shared DB & files) on Windows 10 # playing, testing skins & addons # my desktop app
- MMA Pro (2.0.0.1063) on Android 10, 11, 12 Phones & Tabs # WiFi Sync # playing - MP3Tag, MP3Diags, MP3DirectCut, IrfanView
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!
Hey guys, FYI I split these two posts off the Addon & Skin Requests thread to keep it on topic.
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.
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.
- MMW 5.0.4.2690 (non-portable, shared DB & files) on Windows 2016 # only essential addons # my 24/7 media server
- MMW MMW 5.0.4.2690 (non-portable, shared DB & files) on Windows 10 # playing, testing skins & addons # my desktop app
- MMA Pro (2.0.0.1063) on Android 10, 11, 12 Phones & Tabs # WiFi Sync # playing - MP3Tag, MP3Diags, MP3DirectCut, IrfanView
(I guess PM stay in outbox until the Receiver gets them)
- MMW 5.0.4.2690 (non-portable, shared DB & files) on Windows 2016 # only essential addons # my 24/7 media server
- MMW MMW 5.0.4.2690 (non-portable, shared DB & files) on Windows 10 # playing, testing skins & addons # my desktop app
- MMA Pro (2.0.0.1063) on Android 10, 11, 12 Phones & Tabs # WiFi Sync # playing - MP3Tag, MP3Diags, MP3DirectCut, IrfanView
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:
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:
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?
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
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.
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.
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
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
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