Author Topic: Creating User Defined Menu Items  (Read 19873 times)

Pawel

  • Junior Member
  • **
  • Posts: 26
    • View Profile
Creating User Defined Menu Items
« on: January 25, 2017, 13:15:26 »
Hi,
I am new to Multi Commander. But, it will soon change :P
I have a question... I am creating user defined menu, with menu commands (running programs).

I need to open directory in Multi Commander Explorer Panel (not in Windows Explorer).
How to do this?

What I do:
Defining User Command:

  <userdefinedcommand name="Open Directory" id="3c7cf12e862c4b38b1aacf8b25bd61ba" type="external">
    <tip>Open directory...</tip>
    <command>C:\Users\Pawel\Desktop</command>
  </userdefinedcommand>

And use it in Menu:
<menuitem name="Open Directory" id="3c7cf12e862c4b38b1aacf8b25bd61ba"/>

It works, but it open directory in Windows Explorer!
I want to open it in left or right panel of Multi Commander...

I hope it can be done easily...

Thanks for help,
-Pawel




Jungle

  • Contributor
  • VIP Member
  • *****
  • Posts: 555
  • Old Skull
    • View Profile
Re: Creating User Defined Menu Items
« Reply #1 on: January 25, 2017, 13:27:17 »
Create User Defined command with type Custom Commands:
Code: [Select]
MC.Explorer.Goto PATH="e:\temp"
In User Commands editor you may view all available commands and their params/

Pawel

  • Junior Member
  • **
  • Posts: 26
    • View Profile
Re: Creating User Defined Menu Items
« Reply #2 on: January 25, 2017, 14:07:59 »
Thanks!
Yes, I found it... I should search better.
-Pawel

Pawel

  • Junior Member
  • **
  • Posts: 26
    • View Profile
Re: Creating User Defined Menu Items
« Reply #3 on: January 29, 2017, 12:49:26 »
More questions is coming...

1. How to get system directories?
I am creating user defined menu where I want to add possibility to open all most important system directories.
Is it possible to use SHGetSpecialFolderPath(https://msdn.microsoft.com/pl-pl/library/windows/desktop/bb762204(v=vs.85).aspx) function to get directories (https://msdn.microsoft.com/pl-pl/library/windows/desktop/bb762494(v=vs.85).aspx) with Multi Commander MultiScript?

If not, how to get those directories (desktop, pictures, music, video, favourites, fonts, my doscuments, system, windows, startmenu, appdata, etc...)

2. I was trying to add & (ampersand) to the user menu (to make it work with keyboard) -> it seems to be impossible... is it?

Thanks for any help,
-Pawel
« Last Edit: January 29, 2017, 14:39:45 by Pawel »

Jungle

  • Contributor
  • VIP Member
  • *****
  • Posts: 555
  • Old Skull
    • View Profile
Re: Creating User Defined Menu Items
« Reply #4 on: January 29, 2017, 18:51:06 »
1. You may get some paths by expanding environment variables like %WINDIR%

2. You may use ampersand in the custom command name
« Last Edit: January 29, 2017, 18:55:19 by Jungle »

Pawel

  • Junior Member
  • **
  • Posts: 26
    • View Profile
Re: Creating User Defined Menu Items
« Reply #5 on: January 29, 2017, 21:08:18 »
1. You may get some paths by expanding environment variables like %WINDIR%
Yes. I do. But this is not everything I need (in fact only few)... I am looking for other possibility (I see Multi Commander has built in access (via Internal Commands\File Utils\<Command>) to many System Directories.
Hope, someone will find better solution. If any exists :)


2. You may use ampersand in the custom command name
Yes! Thanks. I have added it manually (&Text) and didn't notice Multi Commander saves it as "&amp;Text"

-Pawel

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4487
    • View Profile
    • Multi Commander
Re: Creating User Defined Menu Items
« Reply #6 on: January 31, 2017, 08:00:07 »
Getting special folders is not support from multiscript  (only the one exposed from environment variables)
I it can be useful, So I will add it to my list of MultiScript command to add. so in the next version that will be possible.. (I think)

Yes if you manually are editing the xml file you need to type &amp; to get a & because & in xml are a special characters and must be encoded in a special way.

Pawel

  • Junior Member
  • **
  • Posts: 26
    • View Profile
Re: Creating User Defined Menu Items
« Reply #7 on: February 01, 2017, 22:59:02 »
Cool!
I am waiting :)
Keep up good work!

-Pawel