Multi Commander > User Contributed Content
Copying full paths of selected files with Linux-style path delimiter
(1/1)
xiubo:
I frequently find myself needing to copy full paths of files and paste them into programming environments (e.g. terminals, source codes, etc.). By default, Multi Commander sends Windows-style file paths where backslashes are used as delimiters between folders; unsurprisingly, most programming environments treat those as invalid paths due to the escape-semantics of the backslashes. The following script will copy full paths of currently selected files in the explorer panel and replace the backslashes with forward-slashes before sending them to the clipboard:
--- Code: ---@var $paths = GetSelectedPaths();
@var $result = "";
@var $i;
@var $N = arrayCount($paths);
for ($i = 0; $i < $N; $i++) {
$result = $result + StrReplaceChars( $paths[$i], "\\" , "/" ) + "\n";
}
SetClipboardText(StrTrim($result, "\n"));
--- End code ---
Hope people may find this useful.
Navigation
[0] Message Index
Go to full version