Copying Folder Structure

Certain actions, such as Move, Copy, and Upload, have an option to copy the folder structure, and not just the file or folder being processed. This option enables you mirror the folder structure at the file’s destination.

To enable this option, click the Options   icon in the action, select “Copy folder structure,” and then choose the structure you prefer from the pop-up menu, as shown below. (By default, this option is disabled and no folder structure is copied, which means any file or folder processed by your rule is placed at the top level of the destination folder.)

When “Copy folder structure” is enabled, the structures you can choose are:


Folder Structure Examples

To illustrate how the three folder structure options work, let’s look at an example (which you can duplicate on your own Mac and try yourself).

We begin with the following structure at the top level of the disk:

Next, we set up Folder A as a monitored folder and then create two rules:

The first rule, which tells Hazel to  process subfolders , looks like this:

The second rule uses the “Move” action (although “Copy” or “Upload” would also work), in this case using a folder named “Backup” as the destination:

Now, we move File 1 into Folder B (as shown below) and let the rule run.

File 1 is moved to the Backup folder in one of three ways, depending on the option used:


Next, suppose we move File 2 into Folder D (as shown below) and let the rule run.

File 2 is again moved to the Backup folder in one of three ways, depending on the option used:

So, if we are moving files to a folder called Backup and using the “from monitored folder” option (the second example just above), we would end up with a folder structure like this:

By getting the path up to (but not including) the monitored folder, Hazel can reproduce the path from Folder B downward in the new location.

SEE ALSO

Action Reference