Multi Commander Support Forum

Multi Commander => Script => Topic started by: espkk on April 18, 2016, 12:11:53

Title: ${focusfilepath} tag
Post by: espkk on April 18, 2016, 12:11:53
How to get value of "${focusfilepath}"?

In this code it always returns nothing
Code: [Select]
@var $cmdargs = "powershell dir " + GetTagValue("${focusfilepath}") + "-Recurse | Unblock-File";
MC.Run CMD="powershell" arg="{$cmdargs}"
Title: Re: ${focusfilepath} tag
Post by: Mathias (Author) on April 18, 2016, 12:39:55
if you are in MulitScript you got function for that and do not have to use the GetTagValue function..
http://multicommander.com/docs/multiscript/functions/getfilefromview

Like  GetSourceFocusPath();

And as I sad in previous post.. You can't currently append to a result of a function because of a temp variable issue
So get the focuspath into a variable

@var $focusfile = GetSourceFocusPath();
@var $cmdargs = "powershell dir " + $focusfile + "-Recurse | Unblock-File";
MC.Run CMD="powershell" arg="{$cmdargs}"
Title: Re: ${focusfilepath} tag
Post by: espkk on April 18, 2016, 12:58:22
I read about this function, but it is only "Get the full path to the item in focus in the source view." AFAIU. What about target view?
Title: Re: ${focusfilepath} tag
Post by: espkk on April 18, 2016, 13:05:03
Ok, I misunderstood the meaning of func names, it works, thanks  :)