Copying folder structure (to a point).

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Copying folder structure (to a point). Tue Dec 13, 2011 7:42 am • by eggwayne
I'm trying to setup what is clearly a complex rule in Hazel, and i'm hitting a wall.
I'm not sure if it is at all possible, but figured i'd ask anyway before i give up.

The situation:
I'm running bootcamp and have some shared folders synced via dropbox (running on the mac side).
Some of the files are only readable by the windows side (windows only CAD software), so I copy them to the bootcamp partition when I need to work on them.
The issue is that I sometimes forget to copy them back into the dropbox folders to resync them when I'm done, and it seems like an ideal scenario for Hazel.

So what I've been trying to setup is a rule that will copy the files, but include not just the parent folder, but the parent folders folder, if that makes sense. (note that the folder depth varies too....)

What ive got at the moment is 2 rules running in the watched folder "CAD" on the Bootcamp partition
1: "check subfolders" rule:
if kind is folder run on folder contents

2: "Copy CAD files" rule:
If extension contains "cad"
and Date last modified is after date last matched

then
[copy files] to "Dropbox/Cad"
[sort file into subfolder] with pattern [source folder]

this sort of works, but copies "Bootcamp/CAD/Folder1/Folder2/Cadfile.cad" to "Dropbox/CAD/Folder2/Cadfile.cad"
which is exactly what I've asked it to do i suppose, but not what I want to do.

I'm trying to avoid setting up rules for each subfolder (Folder1 in the above example), because the subfolders are named after projects that we create/delete quite often...

any tips?
or does this just have too many variables?
eggwayne
 
Posts: 2
Joined: Tue Dec 13, 2011 7:24 am

Re: Copying folder structure (to a point). Tue Dec 13, 2011 3:08 pm • by Mr_Noodle
You can try using the "source folder" attribute in the pattern. But there remains an issue that when sorting into a subfolder, you can't replace an existing file so this rule would only work once until you get a bunch of numbered duplicates.

This should be remedied in 3.0 otherwise, for now, you might have to resort to some form of scripting.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Copying folder structure (to a point). Wed Dec 14, 2011 12:17 am • by eggwayne
Ah ok, thanks for that.
I found the Source Folder dropdown that basically equates to "copy distance from watched folder" or somesuch, but was getting a bunch of files with "-1" attached to the end - and it was ever growing.
This explains it.
I'll keep my fingers crossed about 3.0, and i think for now I'll just setup a rule that watches the folder and pops up a growl notification to remind me to copy them myself.

Thanks for the response!
eggwayne
 
Posts: 2
Joined: Tue Dec 13, 2011 7:24 am


Return to Support