Copy files with new extension if it does not exist in the dest. folder

Advanced Renamer forum
#1 : 13/01-22 07:16
Jonas
Jonas
Posts: 2
Hi

I have three folders, the second one is being synchronized from the first one.
I want to copy the files from the second one to the third one, given a new extension if it does not exist in the third folder - if it does exist, renaming and copying are dropped.

An example:
Before renaming and copying to the third folder.
Folder 1:
File1.txt
File2.txt.
File3.txt
File4.txt

Folder 2:
File1.txt
File2.txt.
File3.txt
File4.txt

Folder 3:
File1.txt
File2.txt.

After renaming and copying the content of folder 3 must be:

Folder 3:
File1.txt
File2.txt.
File3.new
File4.new

Any ideas?
/Jonas


13/01-22 07:16 - edited 13/01-22 07:17
#2 : 13/01-22 17:25
David Lee
David Lee
Posts: 844
It is straightforward to copy only the new files - simply set the Name collision rule to "ignore" and select "Skip erroneous files" when ARen throws a "File already exists" error. The problem is to rename the extensions of the copied files.

A workaround would be to tag the files in Folder 2 by setting the Modified Date timestamp to a year in the future - say 2030 using the Timestamp method at the same time that you copy the files to Folder 3 (using Batch mode Copy).

Timestamp method...
Apply to: Modified date and time
Select: Absolute date and time
Enter 2030 into the "Year" box - all other boxes can be left blank

Then rename the new files in Folder 3 with a second pass using a Script method to identify the files that were copied in the first pass and replacing their extensions.

Batch mode: Rename
Script method...

if (app.parseTags('<Year Modified>') == '2030') return 'new';

Apply to: Extension

Note that ARen will change the timestamps in Folder 2 BEFORE the files are copied - so all files in Folder 2 as well as the new ones on Folder 3 will retain the new Modified date.


13/01-22 17:25