I got a folder with a large amount of files with different suffixes in several sub folders.
My automator workflow works as follows:
- Ask for Finder Items
- Get Folder Contents (sub folder option checked)
- Filter Finder Items (for a specific file-suffix)
- Copy Finder Items
This works like a charm. But all files are copied in the same root destination folder. I need to keep the the sub folder structure. For Example:
sourceFolder
subfolderA
fileA.jpg
fileB.xls
fileC.xls
subfolderB
fileC.jpg
fileD.xls
fileE.xls
Expected result (filter for file suffix .xls):
destinationFolder
subfolderA
fileB.xls
fileC.xls
subfolderB
fileD.xls
fileE.xls
Current result:
destinationFolder
fileB.xls
fileC.xls
fileD.xls
fileE.xls
Update
I'm a developer. So a shell or AppleScript will be also accepted. 🙂
Best Answer
Note the
/
at the end of the source path, it's important. This solution would add all empty directories, if you don't want them, look at the option--prune-empty-dirs
.With brace expansion you can actually include more filetypes at once, rather than having
you can use