Multi Commander > Support and Feedback
Copy path with spaces
Bernd:
Thank you very much. I changed the script a little by using GetSelectedPaths() instead of GetSelectedFileNames() to get the combination of path/name and voilĂ : I have my first User Defined Command 8)
Bernd:
While I am at it, I want to learn something...
How would I copy only the path name? I don't see a function for it. The only idea I have is to first get an array of all path/name, then of all names, then iterate through the arrays and use StrTrimRight() once to remove the names, then again to remove the \
Or I could use the StrRFind() command to find the first \ from the right and then trim the string with StrSub().
Any better ideas?
Mathias (Author):
--- Quote from: Bernd on November 22, 2020, 13:20:30 ---While I am at it, I want to learn something...
How would I copy only the path name? I don't see a function for it. The only idea I have is to first get an array of all path/name, then of all names, then iterate through the arrays and use StrTrimRight() once to remove the names, then again to remove the \
Or I could use the StrRFind() command to find the first \ from the right and then trim the string with StrSub().
Any better ideas?
--- End quote ---
Check out
http://multicommander.com/docs/multiscript/functions/getfilefromview
There are alot of function to get files names in many different ways.
And if that is not enougth you got lots of PathXXX function, that lets you manipulate paths. By getting parts of a full path.
http://multicommander.com/docs/multiscript/functions/filesystem#pathgetpathpart
Mathias (Author):
--- Quote from: Mathias (Author) on November 22, 2020, 13:36:21 ---
--- Quote from: Bernd on November 22, 2020, 13:20:30 ---While I am at it, I want to learn something...
How would I copy only the path name? I don't see a function for it. The only idea I have is to first get an array of all path/name, then of all names, then iterate through the arrays and use StrTrimRight() once to remove the names, then again to remove the \
Or I could use the StrRFind() command to find the first \ from the right and then trim the string with StrSub().
Any better ideas?
--- End quote ---
That path is normally the same for all selected files unless you are doing it from a search result.
Check out
http://multicommander.com/docs/multiscript/functions/getfilefromview
There are a lot of function to get files and paths names in many different ways.
And if that is not enough you got lots of PathXXX function, that lets you manipulate paths. By getting parts of a full path.
http://multicommander.com/docs/multiscript/functions/filesystem#pathgetpathpart
--- End quote ---
Navigation
[0] Message Index
[*] Previous page
Go to full version