Keep both files when moving a file to a folder


I'm looking to move a file to a location where there's already an older version of that file with the same filename. When performing this action manually, the Finder presents the option to "Keep Both", "Stop", or "Replace".

I'd like to automatically select the "Keep Both Files" option so the Finder will enumerate the filename appropriately. Is there a built-in action to accomplish this?

Your request is in conflict with the title of your topic:
Keep both files when moving a file to a folder

So, do you want to Replace OR Keep Both files?
Are you looking to automate selection of the proper button, OR do you want a Macro that will do the entire operation?

Please read:
Tip: How Do I Get The Best Answer in the Shortest Time?

Apologies. I meant I'd like to "Keep Both Files".

And I'd like to automate the entire operation if possible.

Thank you for the help.

If you just want to replace the file unilaterally, Trash (or if you are more brave, Delete) the file target file before the move. Turn off reporting and notification on the Trash/Delete action action.

If you are moving a file with an unknown name, into a directory and not specifying the target name, then you will have to get the name of the file first, so you can trash/delete it in the destination directory.

I'm hoping to "Keep Both Files". (My original post was wrong, which I've since fixed).

When Keeping Both Files, the Finder places a version number at the end of the filename which I'd like to maintain.

It would be easier to add a timestamp onto the file name in Keyboard Maestro. Clicking the Keep Both button should be possible, but it is trickier to do since you would have to detect that condition and then click the Keep Both button.

Thank you, Peter.

That's a great idea and it implemented nicely.