Copy Multiple File Names to Rename Other Multiple Files

Hi, I have been digging this forum to find if anything similar to this exist.
If there is one, I apologise.

My requirement would be,
If there were multiple folders that are named without any sort of pattern or sorting in one location
and if there are other multiple files (not folders this time)
Is there any way to copy and paste those multiple filenames into another files in the other location?

To simplify whole procedure would be

  • Let's say There are 30 folders with 30 different random names each
  • Copy those 30 different random names
  • There are 30 files in another folder (These files likely to have numberings if it helps? but they are files not folder)
  • Rename those 30 selected files each
  • Now there are 30 folders and 30 files in different locations with same name

There is one for PC which I find extremely useful but I cannot find one for Mac, please do recommend if there is?

Thank you so much...

Hey James,

Welcome to the forum!   :sunglasses:

This job is not a walk in the park, because there are some fiddly details – but it's not ridiculously difficult either.

Here's a start:

Finder ⇢ Get Path Strings of Items in Windows 01 & 02 v1.00.kmmacros (12 KB)

Presently it produces a pop-up window with the path strings of both the target folder and the rename templates folder.

Like so:

image

The macro take the first two windows open in the Finder (index 01 and index 02) and resizes them to be 50/50 on the main monitor.

I would not include this step in the main macro – I'd have a preparatory macro to do that for me when I was setting up the rename action.

Then again I wouldn't use the Finder for this task myself – I'd use BBEdit with two named windows side-by-side:

This would let me control the job more completely, give me access to find/replace, and other editing tools.

Then I'd use AppleScript to grab the lists out of each window and use the template items to rename the pathed items.

Thiis is about as far as I'll go on this task, although I'm happy to answer questions.

Here's a macro that does what you want using Microsoft Excel:

Rename Files Based on Excel File [Example]

I think it could be adapted to Numbers without too much trouble if you don't have access to Excel.

In any case – There's More Than One Way to Do It.

-Chris

Certainly not a piece of cake!
Wow thanks. Though as I am new to this, I still have 0 idea what's going on.
I will fiddle with it and let you know how it went.

Thanks!

Hey James,

I forgot to mention that the window with the items to be renamed needs to be frontmost -- index 1.

The name templates window needs to be window index 2.

-Chris