Multi Commander > Support and Feedback

User Defined Command to go into sub-directory. **Resolved**

(1/1)

jdabramson:
After reading up a bit, this may be solvable by issuing a User Defined Command rather than QuickLinks previously questioned.

What User Defined Command can be created do the following?


* get the current path of the selected pane
* append a predefined path to the existing path
* open the new path to the selected pane
My company has a project folder structure that is the same for every project.  In this case, I have the following projects as an example.
   
Here are three projects:

"F:\31\31935\3193518"
"F:\31\31936\3193602"
"F:\31\31940\3194011"

Every Project has the same folder structure and here are the typical folders I access.

\01_PM\BILLING\
\01_PM\CONTACT\
\02_COMM\MINUTES\
\03_PROJECT_EXECUTION\02_PHOTOS\
\03_PROJECT_EXECUTION\05_PRJ_FUNDING\
\03_PROJECT_EXECUTION\06_PERMITS\
\05_DELIVERABLES\

Therefore the following are my I would set to the following User Defined Commands as shortcuts to go to the subdirectories and execute each as appropriate after navigating to the project directory.

i.e.
existing_path = F:\31\31940\3194011

BILLING         existing_path\01_PM\BILLING\
CONTACT         existing_path\01_PM\CONTACT\
MINUTES         existing_path\02_COMM\MINUTES\
PHOTOS         existing_path\03_PROJECT_EXECUTION\02_PHOTOS\
PRJ_FUNDING      existing_path\03_PROJECT_EXECUTION\05_PRJ_FUNDING\
PERMITS         existing_path\03_PROJECT_EXECUTION\06_PERMITS\
DELIVERABLES    existing_path\05_DELIVERABLES\

Mathias (Author):
There are two way depending on how good error handling you want..

1.
You can in the command line field type "cd temp\myfolder" and it will take you to "<currentpath>\temp\myfolder"

But instead of typing that in the commandline field you can automate that with a "Custom Commands" type Command..

--- Code: ---MC.CmdLineRun CMD="cd Temp\myfolder"
--- End code ---


However if path "mtemp\yfolder" does not exists, but temp\ exists, it will go into temp\ anyway.. there is no check if path exists.

2. User defined command of "MultiScript" type


--- Code: ---@var $currentPath = GetSourcePath();
@var $newPath = $currentPath ^ "Temp\\MyFolder1"

if( FileExists($newPath) == 2 )
{
 MC.Explorer.Goto PATH="{$newPath}" SOURCE
}
--- End code ---
It will only go to the path if the path exists, else it does nothing.

jdabramson:
Worked perfectly... Thank you for taking your time to post the reply.

Navigation

[0] Message Index

Go to full version