Author Topic: MC commands (on the fly) from command line?  (Read 17298 times)

mcuser

  • Newbie
  • *
  • Posts: 6
    • View Profile
MC commands (on the fly) from command line?
« on: January 20, 2015, 14:48:10 »
I understand it's possible to do MC commands from within MC, I also understand it's possible to prefigure such commands and then run them from the command line (both variants not tested).

What I am interested in, though, is sending MC commands from the command line = from the Windows "run" command window, not in any prefigured way, but as is needed in the particular situation.

I tried (always from that Windows "run" dialog):

MC.Explorer.SetViewFilter FILTER="a*.*"

> "not found"

C:\Programs\MultiCommander\MultiCommander.exe MC.Explorer.SetViewFilter FILTER="a*.*"

> displays MC but does not execute the filter command (which is assumed to work upon the list pane which currently has focus)

Do I need to do something similar to this, in some slightly different syntax, or is it not possible to execute MC commands if their precise "content" has not been prefigured before?

And in case that latest, negative answer to my question applies:

What would be the keyboard shortcut for selecting the current file pane's filter field, and/or how to change that shortcut to something of your choice? (I found the keyboard configuration, but I didn't find a "focus filter field of current pane" command there.) (The shortcut shift-control-f does not put focus into that field, but opens an (unwanted) menu.)

Thank you so much for your help!

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4491
    • View Profile
    • Multi Commander
Re: MC commands (on the fly) from command line?
« Reply #1 on: January 20, 2015, 14:57:33 »
No. you can not run MultiCommander script command from the Windows CommandLine

Often when CommandLine is mention in MC it is the CommandLine Field in MC that is referred
(The text field below the toolbar.. to the right of the Back/Forwards, History, Favorites buttons.. )

But you can not run Script command directly in the MC Commandline field. you can use command link
Cd, mkdir, cf,  you can type/paste a path there and it will go to that path. and much more.
But you can run MC script from there if they are connected to an alias.

Create a UserDefinedCommand of "CustomCommand" type and there you can have : MC.Explorer.SetViewFilter FILTER="a*.*"
Then you need to connect this command to something. You can add this command to the Button Panel. To the MenuBar. To a Hotkey or to an Alias.
If you connect a Command to an alias. you can type the name of that alias in the CommandLineField to activate it.
So if yo connect the command to an alias named "F1" (for filter 1)
you can then type F1 in the commandline field to run it

---
Ctrl+F moves the input focus to the Filter Field of the panel that is currently in focus.

« Last Edit: January 20, 2015, 15:03:25 by Mathias (Author) »

mcuser

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: MC commands (on the fly) from command line?
« Reply #2 on: January 20, 2015, 15:21:28 »
Hi Mathias,

Thank you so much for answering. I feared it was "no", having "got" these explanations for "pre-figured" commands from the help file, but I had hoped to have overlooked some more flexible possibility; prefigured commands would not be realistic for me since for such filters, I would have dozens of them and would create them from a macro script I then would like to pass over to MC.

This being said, it's always possible to pass such a "filter line" into the "current" filter field, thus my question for a possible keyboard shortcut to set focus to that field? This being said, it would always be possible, from MY macro program, to put focus to that field without having a shortkey (screen elements Edit1/2, respectively), but if there is some, please tell me/us (especially since most macro programs do not allow for setting focus to some specific screen element, except for doing it by the respective shortkey of the application in question).

So, my only real problem now is with the file/folder entry formatting: When you set the "hidden" or "system" attribute to "yes"/checked, the formatting you will have preset for that attribute will be displayed, but when you uncheck those attributes, the formatting which had been correct for the special attribute, will stay for some time, i.e. for quite many minutes, and even independently of switching to some other folder and then back. IF that is a bug, and if you could exterminate it, this would be awfully kind of you, but this being said, please don't feel being put into a hurry by my insisting on this issue: Your making available not only different colors, but also bolding and other formatting for special attributes, is more than most file commanders do, let alone free ones! Also, I would like to confirm that the "regular" formatting is correctly displayed then after closing MC, and reopening it, but of course, I would really be helpful for such attributes-linked formats to be updated back to regular as soon as you update the file attribute in question.

EDIT: Control-f, oh! That's simple, could have found that out myself, dumb of me. Thank you very much!
« Last Edit: January 20, 2015, 15:24:15 by mcuser »

mcuser

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: MC commands (on the fly) from command line?
« Reply #3 on: January 20, 2015, 15:55:07 »
I've got some more "newbie's" problems I'm afraid of.

Set View filter = ^f is in the help file, http://multicommander.com/docs/keyboard-shortcuts/CommanderStyle

I now made a link to this important page.

On the other hand, I don't find the shortkey to set focus, i.e. to "go to" the MC command line?

Also, I had thought that internally, it was possible to execute internal commands, but

MC.Explorer.SetViewFilter FILTER="a*.*"

within the MC command line does nothing, i.e. no filtering of the currently active pane, just the command line gets empty after my "return key" pressing. Do I do something wrong here, or is this not possible? (Here again, for there filtering, the filter field works perfectly, but I would like to know in general.) Also, shortening the line to Explorer.SetViewFilter FILTER="a*.*" or then to SetViewFilter FILTER="a*.*" does not work any better.

I very much hope I just didn't grasp the correct format for such internal commands yet?

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4491
    • View Profile
    • Multi Commander
Re: MC commands (on the fly) from command line?
« Reply #4 on: January 20, 2015, 16:49:32 »
This being said, it's always possible to pass such a "filter line" into the "current" filter field, thus my question for a possible keyboard shortcut to set focus to that field? This being said, it would always be possible, from MY macro program, to put focus to that field without having a shortkey (screen elements Edit1/2, respectively), but if there is some, please tell me/us (especially since most macro programs do not allow for setting focus to some specific screen element, except for doing it by the respective shortkey of the application in question).
? I dont know..  I don't really understand what you are trying to do.

So, my only real problem now is with the file/folder entry formatting: When you set the "hidden" or "system" attribute to "yes"/checked, the formatting you will have preset for that attribute will be displayed, but when you uncheck those attributes, the formatting which had been correct for the special attribute, will stay for some time, i.e. for quite many minutes, and even independently of switching to some other folder and then back. IF that is a bug, and if you could exterminate it, this would be awfully kind of you, but this being said,
So if a file have R--- attribute and you change that by removing it "R" (readonly) it is not changed in the filelist. ?
Hmm I'm not able to recreate that. For me it is updating. Anything special with the filesystem you do changes on ?

On the other hand, I don't find the shortkey to set focus, i.e. to "go to" the MC command line?
It depends on what kind of default setup you use.. Explorer or CommanderStyle.
With commander style all key presses are forwarded to the command line field.
But you can also change focus with the key to the left of the "1" key (under the ESC key.. on normal keyboard)
You can also assign another key to it in the Keyboard customization dialog.

Also, I had thought that internally, it was possible to execute internal commands, but

MC.Explorer.SetViewFilter FILTER="a*.*"

within the MC command line does nothing, i.e. no filtering of the currently active pane, just the command line gets empty after my "return key" pressing. Do I do something wrong here, or is this not possible? (Here again, for there filtering, the filter field works perfectly, but I would like to know in general.) Also, shortening the line to Explorer.SetViewFilter FILTER="a*.*" or then to SetViewFilter FILTER="a*.*" does not work any better.
Nope.. As I said you need to create a user command then you can assign an alias (Short name) to that command aand when typing that name in the command line the command will be run..