copy files without directory structure

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

copy files without directory structure Sat Jun 13, 2015 3:34 am • by reagan9000
Hi - I've set up a rule to copy iCloud photo stream images to a target directory, so that Adobe Lightroom can import them. My rules are:

Source folder = ~/Library/Application Support/iLifeAssetManagement/sub (which contains a number of subfolders each containing an iCloud Photostream image)
Kind is Folder
Run rules on folder contents
Copy to folder <my target directory> with the options if file exists, do not copy the file and do not copy if duplicate.
Copy folder structure is *not* selected

When this runs, the subfolders are copied as well as the image files inside them. I want to copy just the image files over to the target directory, not the subfolders that they're contained in.

Is there a way to do this in Hazel?
Thanks!
reagan9000
 
Posts: 6
Joined: Sat Jun 13, 2015 3:28 am

Re: copy files without directory structure Mon Jun 15, 2015 12:20 pm • by Mr_Noodle
Your rule is set up to match folders. Read the sticky article on going into subfolders. As described there, you will want to have a separate rule to match the folders (to tell Hazel to go into them) and the files themselves.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: copy files without directory structure Tue Aug 04, 2015 11:31 pm • by reagan9000
Thanks very much - the stickied article on subfolders was really useful. I now have 2 rules for the iCloud Photostream folder:

1) Find Photostream Folder:
If Kind is Folder then
Run rules on folder contents

2) Copy Photostream Image:
If Kind is Image and
Subfolder Depth is greater than 0
Copy to folder (my backup folder) with options if file exists do not copy the file and do not copy if duplicate

I didn't realize that one could create multiple rules that worked together - I thought all the testing logic and actions had to be in a single rule.
reagan9000
 
Posts: 6
Joined: Sat Jun 13, 2015 3:28 am


Return to Open Discussion