I have a button that puts the full path (no filename) to the clipboard. 99% of the time this is to a path on the local network with a mapped drive letter
M:\Mypath\Somepath
I have an application that balks at that and wants the equivalent UNC path which is
\\Wdata\ic2\Mypath\Somepath
i.e.
\\Wdata\ic2
= M:\
is there a way to put the equivalent UNC path to the clipboard even though the lister is looking at the mapped drive letter?
Assuming you are using the Clipboard COPYNAMES
command you could simply add a REGEXP
argument to change the path.
Have a look here for a more advanced approach:
Unless you're using an old or custom menu, the default Edit > Copy Full Pathnames menu item should already do what you want.
It runs Clipboard COPYNAMES=unc
cool and thanks it worked, I edited a copy of my custom button
So now I have another custom button that just copies the path to the clipboard, here is what I have:
Clipboard SET {sourcepath}
Tip: path nofilename to clipboard works on dir tree and empty folder
I want to make a copy of this button which supplies UNC instead of the mapped drive button
I tried
Clipboard SET=UNC {sourcepath}
Clipboard SET {sourcepath=unc}
but they did not work as clearly I don't know what I am doing
Try this:
Clipboard FILE {sourcepath} COPYNAMES=unc
it is not working for me
What happens?
I get the full path of the file without the filename but with the mapped drive letter instead of the UNC
It should put the current folder path into the clipboard. You don't need to select any file, if that's what you're doing.
It works OK here and converts it to the UNC path. Tested with Opus 12.20.
I was selecting a file but even if just selecting a folder I still get the mapped drive letter, version is 12.1
could that be it?
Yes, it would be that.
Yaaay! 12.2 and it works now, thanks so much Leo
getting tired fo me or want some more on this?
what controls that the path gets double quotes or not ?
You mean 12.20, I hope.
The command I gave should not put quotes around the path.
right, that is what I see, no quotes, I have another button that does put quotes, was curious
Quotes will be added automatically if there's a space in the path.
I tested that and they aren't with the command under discussion,
here is what i got
C:\Users\xx\Dropbox (zzz)\ICI_RND\0-00(MonitorController)\DataSheets
my other button with the drive letter does put the quotes if and only if there are spaces
the other button has this
Clipboard SET {sourcepath}
this is that one, how come it had the command window but the next screen shot after this does not?
on this shot i put the command where it says Function but on the prior shot I only get drop downs for Function
Clipboard COPYNAMES=unc
never puts quotes around the path.
Clipboard SET xyz
puts whatever xyz
is into the clipboard.
{sourcepath}
, unless told not to, puts quotes around the path if it has spaces in it, since most commands need that.
So Clipboard SET {sourcepath}
puts quotes around the path if it has spaces in it. Which is also why the similar command on the default toolbars starts with @nofilenamequoting
to prevent that, since you're unlikely to want quotes around the path when you're asking Opus to put it into the clipboard.