Multi Commander Support Forum

Multi Commander => Support and Feedback => Topic started by: macmore on February 06, 2014, 22:27:23

Title: Focused Path Field
Post by: macmore on February 06, 2014, 22:27:23
Is there a variable I can pass to an external command that represents the folder path of the focused file without the file name?  If the focused file is "C:\MultiCommander\xyz.txt", I want "C:\MultiCommander".
Title: Re: Focused Path Field
Post by: Jungle on February 07, 2014, 04:18:46
It depends on a task. Look here:
MultiTags (http://multicommander.com/docs/multitags)
MultiScript - Get Source/Target file Functions (http://multicommander.com/docs/multiscript/functions/getfilefromview)
Title: Re: Focused Path Field
Post by: macmore on February 08, 2014, 18:27:32
I found ${focusfilepath} there, but what I need is ${focuspath}.
Title: Re: Focused Path Field
Post by: Jungle on February 08, 2014, 19:01:11
macmore
What about {$sourcepath}?
Title: Re: Focused Path Field
Post by: macmore on February 18, 2014, 16:57:59
{$sourcepath} did not work.  It is blank.
Title: Re: Focused Path Field
Post by: Mathias (Author) on February 18, 2014, 18:13:47
A type from Jungle, it is "${sourcepath}"
 ( $ before the { } tag. )

But It depends on where you use it and what UserDefinedCommand type you use..
If you are creating a UserDefinedCommand of External type then use the MultiTags (http://multicommander.com/docs/multitags) as Jungle say..


Title: Re: Focused Path Field
Post by: macmore on February 19, 2014, 00:56:13
${sourcepath} is blank too.  I am using it as a Program parameter to a Quick Launch program.
Title: Re: Focused Path Field
Post by: macmore on February 19, 2014, 06:32:46
From the documentation
http://multicommander.com/docs/filetypesetup:

Quote
Under "Program Parameters" you enter the parameters you want to send to the program (if the Program type is "External Program"). There are a couple of tags you can also select that will for example expand to the selected file path. You will get a list of them by pressing the [<] button.

When I click the [<] button, I don't get a list of tags.  Is there something wrong with my configuration?
Title: Re: Focused Path Field
Post by: Mathias (Author) on February 19, 2014, 06:51:09
${sourcepath} is blank too.  I am using it as a Program parameter to a Quick Launch program.

That is because the QuickLaunch Bar is not a script.

It is like the QuickLaunch bar that you had/have in Windows on the taskbar, a place to quickly launch programs.
And you can drag and drop files on an icon and they will be sent as parameters to the program.
If you want it to interact with MC then you need to create a UserDefinedCommand and then add that to the Quicklaunch bar.

Here is a example, Create a new UserDefinedCommand of "CustomCommand" type
then enter
Code: [Select]
MC.Run CMD="C:\Bin\Notepad++\notepad++.exe" ARG="${sourcepath}"Then Right click on QuickLaunch bar and select insert User defined command.
The Right click on the quicklaunch program icon for the command and select customize and then you can modify the icon.
Title: Re: Focused Path Field
Post by: Mathias (Author) on February 19, 2014, 06:55:16
From the documentation
http://multicommander.com/docs/filetypesetup:

Quote
Under "Program Parameters" you enter the parameters you want to send to the program (if the Program type is "External Program"). There are a couple of tags you can also select that will for example expand to the selected file path. You will get a list of them by pressing the [<] button.

When I click the [<] button, I don't get a list of tags.  Is there something wrong with my configuration?

FileTypeSetup is found under Menu > Configuration > FileTypeSetup. It is where you configure default program to be used for Viewers and Editor based on file type.
It has nothing to do with the QuickLaunchBar. it does not support any script tags (Except Windows Enviroment strings. )