Copy all Files directly in TargetFolder

I use the following macro to copy the files from the DCIM folder of my inserted memory card to a destination directory.

In doing so, the action also creates the same subfolders that exist in the folder.

Example Result in Folder _NewShootings:

How can I copy the images directly to the parent folder without creating the subfolders?

Thank you for your time and support!

Thanks @tiffle for your answer, unfortunately I did not have the chance to look at your answer in detail before it was deleted again.

I have not found a real solution, rather a workaround that helps me in my specific case. Therefore I close the post here, thank you for your attention.

Hi @micha_ontour, thanks for the response. My original post didn’t solve your problem unfortunately but I do have a Keyboard Maestro-based solution that I can share with you once I get back to my desk later today.

As promised, here is my approach to your problem.

It comes in two parts:

  1. A utility subroutine.
  2. The macro that does the copying and which calls the utility subroutine.

The utility subroutine produces a list of all the files contained in a folder and all its sub-folders recursively. It does this by making use of the macOS shell command find.

This is the subroutine:
[SUB] Get Recursive File List.kmmacros (3.3 KB)

subroutine image

KM 1 2022-03-30_11-17-54

The macro that does the copying is here:
Test Copy Files Without Folder Structure.kmmacros (3.3 KB)

macro image

KM 0 2022-03-30_11-15-43

In this macro you need to change the values of the source and target folders in the actions (1) and (2) while action (3) is the actual call to the above subroutine.

I've tested this on my system (KM v10, macOS 10.14.6) but as with anything that involves copying files, you should test this first on your system to ensure it does what you wish.

Let me know if this is useful!

1 Like

Thank you so much @tiffle, works like a charm. Awesome! Exactly what I was looking for...

1 Like