Path without drive letter

Is there a way to omit drive letter from the path when using Copy? Or to do a search&replace on it before applying its value? I'd like to copy some files from a collection and recreate their source location structure at destination. Something like ADDTOARCHIVE=fullpaths but without pushing them into an archive. Or like copying in flat view.

I'm not sure if this is exactly what you want to do but if you want to drop the D: off the copied path of

D:\Test Folder\source\0201108031156.gps

so it becomes this

\Test Folder\source\0201108031156.gps

Then you can do using the example in the screen grab below.

Sort of, but not exactly. While the results on clipboard are needed, I fail to see how I can create a batch copy using it. There are many files, almost no two in the same folder. Many of them are not even on the same drive. I have these in a collection:

and the desired results after the copy would be



As you can see, the problem is not so simple :frowning:

It wouldn't be difficult to copy the final names you want to end up with to the clipboard, but to actually copy the files and rename them that way would probably require a script. Unless of course I'm missing something which is entirely possible.

Yes, indeed. Alas, I'm a few cards short of a deck when it comes to write scripts for Opus :slight_smile:

We'll make it so in Opus you can use {filepath|noroot} to get a file's relative path from the root of the drive it is on.

That would be nice, thank you very much, Leo and... well... I don't want to be a pain in the donkey but if you're already at it could you please consider adding something like {sourcepath|:} as well, returning only the drive letter without the colon? That way it would be possible to achieve


[ul]Copy TO "{destpath$}{filepath$|:}{filepath$|noroot}[/ul]

I've made it so you can use {destpath$}{filepath|subdir} to get destination\C;\testfolder1\testfile1.ext1

(Note the semicolon instead of a colon in the result.)

That's even better, thanks. is going to be a beta version, isn't it?

Yep, a beta version.

Stable versions always have a .0 at the end now.

We've been debating whether or not this new feature should convert the : into a ; or remove it entirely.


[ul][li]C:\testfolder1\testfile1.ext1 -- Input[/li]
[li]C;\testfolder1\testfile1.ext1 -- Output #1[/li]
[li]C\testfolder1\testfile1.ext1 -- Output #2[/li][/ul]

What do you all think?

As for me, it does not really matter. With ; it is obvious that we have a full path here but I believe some people would find ; strange in a path. I'd prefer the one with ; but I'm fine with both.

C_\testfolder1\testfile1.ext1 -- Output #3

[quote="leo"]We've been debating whether or not this new feature should convert the : into a ; or remove it entirely.


[ul][li]C:\testfolder1\testfile1.ext1 -- Input[/li]
[li]C;\testfolder1\testfile1.ext1 -- Output #1[/li]
[li]C\testfolder1\testfile1.ext1 -- Output #2[/li][/ul]

What do you all think?[/quote]
An option in preferences for the user to decide what they want to use would be the best option in my opinion. Failing that though, I prefer Output #1

My concern would be the ; looks almost like the : so I'm thinking it would only be a matter of time until someone complained the newly created path doesn't work. So my vote would be for an option like blueroly suggested with _ set as the default.

An option just for this, which is pretty esoteric to begin with, seems like overkill.

It's not functionality anyone is likely to stumble on and use by mistake, so I can't see anyone using it and being confused that the result isn't an absolute path (that's the point, after all). The manual will give an example and point out the semicolor explicitly.

Seems like it's 50/50 ; and _ so we'll probably stick with ; since that's already coded and documented. :slight_smile:

[quote="leo"]An option just for this, which is pretty esoteric to begin with, seems like overkill.
True, but you could add a new esoteric section in the preferences dialog!!!!

Let me go further :slight_smile: You have that nifty little dialog for advanced Rename. With RegExp and file information fields it is so vastly powerful that Copy seems to be a weakling compared to it. But what if I want to use what Rename offers without actually moving those files. I want them to be left where they were. I certain cases that can be achieved by copying them first and then renaming them next. But sometimes that's not an option. So why not give Copy some of the skills Rename already has?

Yes, I know, I should wake up :laughing:

I assigned

Copy CREATEFOLDER {destpath$}{sourcepath$|subdir}

to the drop menu for All files and folder.

It works selecting multiple files and folders even if they are in a collection and their locations are the same. But when I try to drop two of them with different locations from "coll://Find Results" the action is doomed to utter failure.

While there are {filepath} and {allfilepath} to pass files and pathnames one at a time or all at once, {sourcepath} lacks the same functionality. The result is "coll;\Find Results" structure created in the destination folder. It seems that {sourcepath} resolves to actual file location in the first case and to "collection path" in the latter, that is, it cannot pass source paths for multiple files one at a time. I guess {sourcepath} is meant to point to source Lister path rather than to the actual location of the source file but then it should return that for the first case as well. And since {filepath} does not have modifier to remove the filename from the end of the path the original goal still cannot be achieved :frowning:

Can you confirm that, Leo?

Not true. :slight_smile: Use {filepath$|..|subdir} to get the path to each file's parent, converted into subdir format.