Multi Commander > Support and Feedback

Copying path to clipboard with forward slashes

<< < (3/3)

karthik:
Thanks, Mathias and Jungle.

I can write similar scripts to get finename alone, path alone, etc. And I can assign shortcut hotkeys to these. suppose I assign the default
(Ctrl+P, Ctrl+Shift+P, Alt+Shift+P) shortcuts will it create any problems in terms of MC working and functions?

Is there a way by using multiscript I can get the output of Ctrl+P or Ctrl+Shift+P? In that case, I can use that (instead of GetSelectedPaths()) and replace the backward slashes by forward slashes.

Thanks.

Mathias (Author):
See Doc lots of function for getting different filename part

GetTargetFocusName() / GetTargetFocusName() will give you the current file that are in focus, without path


karthik:
Thanks Mathias.

This works fine but when I select the ".." directory and execute this script I do not get the source path. Where as when I do Ctrl+P when ".." is selected I get the source path. Is there a way to modify the script to get the source path even for ".." directory with this script?

Essentially I am trying to have a replacement for Ctrl+P and make the script do whatever Ctrl+P will do but with forward slashes instead of backward slashes.

Thanks.

Mathias (Author):

--- Quote from: karthik on January 23, 2013, 05:31:58 ---Thanks Mathias.

This works fine but when I select the ".." directory and execute this script I do not get the source path. Where as when I do Ctrl+P when ".." is selected I get the source path. Is there a way to modify the script to get the source path even for ".." directory with this script?

Essentially I am trying to have a replacement for Ctrl+P and make the script do whatever Ctrl+P will do but with forward slashes instead of backward slashes.

Thanks.

--- End quote ---


If current item is the ".." item then get current path else get full path with filename, just like Ctrl+P


--- Code: ---@var $path = GetSourceFocusName();

if( StrIsEqual($path,"..") )
{
   $path = GetSourcePath();
}
else
{
  $path = GetSourceFocusPath();
}

--- End code ---

karthik:
That helps a lot. Thanks much.

Navigation

[0] Message Index

[*] Previous page

Go to full version