by Andre_H » Wed Apr 06, 2022 11:37 am
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.
As an example how to open external tools (MP3Tag here):
[code]//* 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
});[/code]
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.