[REQ] Add new item in Hotkey list

Help improve MediaMonkey 5 by testing the latest pre-release builds, and reporting bugs and feature requests.

Moderator: Gurus

sonos
Posts: 175
Joined: Wed Aug 07, 2013 11:54 am

[REQ] Add new item in Hotkey list

Post by sonos »

To complete tags I often use the action 'Edit tags - open track Folder in MP3Tag ...'. Now I wanted to define a hotkey, but I can't find one in the hotkey list of actions.

Therefore my wish would be to add an 'action': open track Folder in MP3Tag ... to this list.

Carsten
Lowlander
Posts: 56656
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: Add new item in Hotkey list

Post by Lowlander »

Users can't add new hotkey actions.
sonos
Posts: 175
Joined: Wed Aug 07, 2013 11:54 am

Re: [REQ] Add new item in Hotkey list

Post by sonos »

Sorry, I expressed myself in a misleading way. I do not wish to add this entry myself. Rather, it is my wish that this entry should be added to this list.
Ludek
Posts: 4964
Joined: Fri Mar 09, 2007 9:00 am

Re: [REQ] Add new item in Hotkey list

Post by Ludek »

Therefore my wish would be to add an 'action': open track Folder in MP3Tag ... to this list.
Hi Crasten, I guess this action was added by an addon/script?

At first the action needs to be in the actions and then have attribute 'hotkeyAble: true'

See: [MM5 install folder]/sampleScripts/hokteyAction/

You can move it from the /sampleScripts/ to /scripts/ folder to have this sample script active..

The code is just:

Code: Select all

actions.myCustomAction = {
    title: 'My Custom Action',
    hotkeyAble: true,
    execute: function () {
        messageDlg('This action was created by hotkeyAction script.', 'information', ['btnOK'], {
            defaultButton: 'btnOK'
        }, undefined);
    }
}

hotkeys.addHotkey('Ctrl+Shift+Q', 'myCustomAction');
sonos
Posts: 175
Joined: Wed Aug 07, 2013 11:54 am

Re: [REQ] Add new item in Hotkey list

Post by sonos »

Hi Ludek,
thank you for help to add the hotkey.
I just inserted the following line:

Code: Select all

hotkeys.addHotkey('Ctrl+Shift+O', 'openFolderMP3Tag');
with reference to the already existing action part

Code: Select all

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(AppPathMT, AppParameters)	
        });       
    }
}
I have omitted the part

Code: Select all

actions.myCustomAction = { ....}
Carsten
Ludek
Posts: 4964
Joined: Fri Mar 09, 2007 9:00 am

Re: [REQ] Add new item in Hotkey list

Post by Ludek »

OK, so I guess that you just need to add the

Code: Select all

 hotkeyAble: true,
to the actions.openFolderMP3Tag object//
sonos
Posts: 175
Joined: Wed Aug 07, 2013 11:54 am

Re: [REQ] Add new item in Hotkey list

Post by sonos »

Hi Ludek
Interestingly, it also works without

Code: Select all

hotkeyAble: true,
Nevertheless, I have added this to the

Code: Select all

actions.openFolderMP3Tag = { --.
inserted
This is how it looks now:

Code: Select all

actions.openFolderMP3Tag = {
    title: _('Open Track-Folder in MP3Tag ...'),
    icon: 'openMP3Tag',
    disabled: uitools.notMediaListSelected,
    visible: window.uitools.getCanEdit,
    hotkeyAble: true,
    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(AppPathMT, AppParameters)	
        });       
    }
}
hotkeys.addHotkey('Ctrl+Shift+O', 'openFolderMP3Tag');
Any comments? And thank you again
Carsten
Ludek
Posts: 4964
Joined: Fri Mar 09, 2007 9:00 am

Re: [REQ] Add new item in Hotkey list

Post by Ludek »

Hmm,
I guess that once 'hotkeyAble: true' is missing then it won't show in Options > Hotkeys as availbale hotkey action.
Post Reply