Copy Rename Move

Perhaps this is asking too much, but I was wondering if I could combine the function of three existing toolbar buttons into one.

I like to copy one representative image file from my image sub-folders into a collection file for easy searching. I have the image sub-folder open in the source lister and the collection sub-folder open in the destination lister.

I have found Dopus toolbar buttons which do this function in three steps and I am thinking it could possibly be combined into one button.

The first button duplicates the file and renames it with a suffix of _copy.
The second button renames the file with the parent folder name.
The third button move the file to the destination sub-folder.

I have to select the modified file in-between each of the button clicks, so it actually takes five mouse gestures. At a minimum I would like to be able to keep the modified file selected so it is just three button clicks.

[quote]Button 1) COPY DUPLICATE WHENEXISTS=rename AS "{file|noext}_copy{file|ext}"
(select duplicate file)
Button 2) Rename TO="{parent}.{ext}" FILEINFO
(select renamed file)
Button 3) Copy MOVE[/quote]

I tried combining this code into a single button...

but I get the following error message...

I also tried some variations, but got the same error message:

[quote]Copy MOVE Rename TO="{parent}.{ext}"
Copy MOVE Rename AS "{parent}.{ext}"[/quote]

Do I need to use three separate lines of code? If so, I will need to re-select the file in-between as mentioned above. In fact, that appears to be the problem issue in the error message.

Can anyone help with this function?

Thanks much.

There's no Rename argument to the Copy command, so remove that.

TO specifies the destination folder and AS specifies the new name for the file.

I'm not sure exactly what you want though as I'm confused by the idea of copying the file with a new name into a collection. Collections don't store copies of their files, they just point to files which exist somewhere else. Did you mean to say there's a collection in the destination window?

I want to copy a file from the source directory into the destination directory, giving the file the name of the source directory.

for example, in the source folder:
c:\images\mountains\himalayas\03.jpg... etc.

select one of these files and copy into the destination folder as:

Perhaps the term 'collection' means something else that I am not aware of. I am just using it to designate a group of files representing the individual sub-directories with a single image file each.

Copy AS {sourcepath|nopath|noterm}.jpg

Nope... gives this error message:
An error occurred copying 'filename.jpg': the filename, directory name, or volume label syntax is incorrect. (123)

Works for me.

It still doesn't work for me. Can you suggest an alternate syntax?

Not really, since the syntax I already posted is how you do it.

I have not been following this thread, but I have a quick thought as to what may be going wrong.
I think amfonda may be attempting to copy from the root folder of a drive.
I'll have to try to remember, but as I recall Sourcepath|noterm returns a '' for drive letters.


Not sure why they would be doing that, as the request was to use the name of the parent folder for the new filename.

OK, I see what happened. The source sub-directory I was using had a space in the name. Without the space it works just fine. Thanks!! A real time-saver for me. You ARE the Opus. :wink:

As always, paths with spaces need to be enclosed in quotes.

Opus's automatic quoting may be getting confused in this case. You can fix the button like this:

@nofilenamequoting Copy AS "{sourcepath|nopath|noterm}.jpg"
(Click Advanced in the button editor to make it let you enter a multi-line command.)