Copying filenames from one folder to the next

Im interested in creating a macro that would copy the filenames of the items within a folder and applying that naming-scheme to a subset of folders, each contaning the same number of items.

So in this example the items in folder 01 has the correct filenames. Now I want to copy those filenames to the rest of the folders 02-06 that each has 4 files but the incorrect filenames.

Any pointers appreciated!

Sorry, but I'm not clear on your objective.

You can't copy "filenames" to a folder. You can copy ONLY actual files and folders.
However, you can rename files/folders. Is that what you want, to rename the existing files in the other folders?

If you want to rename the files in the other foldes (02-06), then you need to be more specific about your renaming scheme. How would the macro know which file to rename to "file1", etc?

Please show a real-world example of:

  1. The current files in one of the target folders.
  2. The new name for each file, e.g. "My Original File One" --> "file1"

Do the files have extensions? Even if you don't show them in the Finder, it is important to know what they are when doing the rename process.

You're right Michael, renaming the files is what I want. I will try and explain it better.

I need the files in 02-04 to be renamed in order, top to bottom, with the names collected from the first folder (01)

Example;
[02] originalfile 1.rtf --> file1.rtf
[02] originalfile 2.rtf --> file2.rtf

[03] originalfile 1.rtf --> file1.rtf
etc..

I have enabled the option to show filenames if that makes it easier.

Ordered by what field? Name, Date Updated, Date Created, other?

Are the target files actually named "originalfile 1.rtf" etc?
Or is that just something you made up for posting?

So, to be clear, I need to know which approach you want:

  1. Sort the files in each target folder by TBD field, and rename to the files in the Source folder (01), also sorted by the same field.
    OR
  2. Rename the files in the target folder using the number in the existing name
  • So, rename "originalfile NNN.rtf" to "fileNNN.rtf"
    where "NNN" can be any number embedded in the file name.
  1. Something else?
  • Please specify

In all cases, I need to know how you will specify the Source folder (01), and the Target folders (02, 03, ...).

  • Do you always have exactly 4 folders, with the Source folder always named "01", and the Target folders always named "02", "03", and "04"?
  • IF so, then you could specify the parent folder of all 4 folders, and use the subfolders in it. Correct?
  • Something else?

A working macro for something pretty similar is here:

You may have to adapt the macro a bit.

I think its approach 2)

The names in this example I just made up for this thread, they will wary. I was hoping to have the macro treat the first folder (where the cursor is) as the source and however many folders are beneath (graphically speaking) as target folders.

The background for this is that in my work I often get projects divided into folders like this. The names of the folders and files within them will wary every time. The files are ordered by name and the amount of files are split up evenly between the folders.
The first thing I do then is to manually rename files in the first folder to fit my workflow better. I make sure to rename the files so that they dont swith order which would make this macro impossible I think.

My goal was then to able to have this picture below as a starting point, with 01 as the source folder and then with a keystroke rename the files in the target folders beneath (02-04 in this case) with the exact same names, not subtract or add anything.