Multi Commander > Script

[SOLVED] Start MC with folder and file HIGHLIGHTED ??


Is there a way to start MC with a folder name and specific file within that folder to automatically select when the Explorer panel opens?

What I meant to query:
Is there a way to start MC with a folder and specific file HIGHLIGHTED ??
I want my user to be able to quickly locate a file within a directory.

[ SOLVED ] ==========================================================

I have a facility that presents a file (selected from Windows Explorer
via the context menu) in Multi Commander's Left panel directory listing,
with another "target directory" in the Right panel.

The problem was that once selected, I needed to keep the user's focus
on the file: It was not easily visible once the file's owning directory
was listed.
The solution I found is as follows:

Just prior to executing MC, my Windows batch file executes:

   set xShareFileId=%srcFile%

This sets the Environment variable with the file's drive:\path\name.

Then, the batch files executes MC with the additional operand:


And, within MC, the "xShareFileId" script has been coded as follow:

   # xShareFileid - Highlight specified file (from batch file)
   # get fileid from environment
   @var $xShareFileId = TranslateEnvString("%xShareFileId%");

   # get drive, fullPath, filename
   @var $fileInfo[] = PathGetParts( $xShareFileId );
   @var $source = $fileInfo[1];
   @var $fileName = $fileInfo[2];

   # list directory, with file hilighted
   MC.Explorer.Goto LEFT={$source} ITEMFOCUS={$fileName}
Hope some of you find this useful,

Mathias (Author):
Look at

There are multiple way depending on configuration..

Just as paramters or -L / -R parameters if you open new instance.
or /OPEN parameter if you want to modify a currently running instance.


[0] Message Index

Go to full version