sync based on color

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

Moderator: Mr_Noodle

sync based on color Sun Jul 22, 2012 12:35 pm • by joost
I want to synchronize files from a source folder and its sub-folders to a sync folder based on the color settings of the files in the source. E.g., if a file's color is purple than sync it with the destination. Only the properly colored files are to be synchronized, all others should not show up at the destination. I want the destination to have the same folder structure as the source.

The only thing I seem to be able to put together is a rule that copies the expected files but also non-purple files in that same folder a purple file is in.

Code: Select all
If all of the following conditions are met for any of its sub-files or folders
  Kind is not folder
  color label is purple
Then
Sync


When I add
Code: Select all
Date Last modified is after date last matched
the rule doesn't work at all. Would love to have some help !

joost
joost
 
Posts: 4
Joined: Sun Jul 22, 2012 12:19 pm

Re: sync based on color Mon Jul 23, 2012 4:44 pm • by Mr_Noodle
Do not use the "any of its sub-files" pop-up. Read the sticky article about sub-folders at the top of this forum. That is what you probably want to use here.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: sync based on color Mon Jul 23, 2012 7:39 pm • by joost
I had read that article but not fully understood/appreciated it at first. So now things are starting to work. The rule set works with the exception that it does not recreate the folder/subfolder structure in the destination - not sure if this is possible.

Say my sources is this:
Folder/sub-folder
file-A (purple)
file-B (not purple)

I want my destination to look like:
Folder/sub-folder
file-A (purple)

What it is now is:
Folder/
file-A (purple)

When Folder/sub-folder does not contain a purple file, I don't want the folder/sub-folder structure be created at the destination.

Too complicated for Hazel?
joost
 
Posts: 4
Joined: Sun Jul 22, 2012 12:19 pm

Re: sync based on color Tue Jul 24, 2012 2:26 pm • by Mr_Noodle
You want to use the source folder attribute. Search for "source folder" in the help as there's an example there.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: sync based on color Tue Jul 24, 2012 4:12 pm • by joost
hmm, I must be _not too smart_...

For "do the following to the matched file or folder" I used:
1. "sync" into destination folder
2. "sort into subfolders" with the source folder option set to "use path from monitored folder".

This syncs the files over to the destination without subfolders as I had before, but on top also reorganizes my _source_ files with an extra set of subfolder nesting. In other words, the subfolder action seems to work but not on the destination, rather on the source. Is there a "source folder" option directly associated with the sync function? I didn't see it if there is.

Playing around with it, I could not get this to work as I wanted to.
joost
 
Posts: 4
Joined: Sun Jul 22, 2012 12:19 pm

Re: sync based on color Tue Jul 24, 2012 5:26 pm • by Mr_Noodle
Oops. I should've been more specific. You don't want to use sync for this. Sync is good if you want to sync a whole tree but since you are cherry picking what files to copy over, you should just use the copy action. Also, another difference between sync and copy is that actions after a sync operate on the original files whereas the actions after a copy operate on the copy.

So, do a copy and then sort into subfolder using the source attribute.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: sync based on color Tue Jul 24, 2012 6:35 pm • by joost
Cool, that works, thanks. It leaves me with a question though; what really is the difference between a copy and a sync? It seems a sync is a copy, replacing the destination, whereas a copy has the option to rename or replace.

Hazel-help describes the sync to be similar to a copy also. Would be nice to know the precise differences if any.

Thanks for the help so far!
joost
 
Posts: 4
Joined: Sun Jul 22, 2012 12:19 pm

Re: sync based on color Wed Jul 25, 2012 4:00 pm • by Mr_Noodle
A copy is, well a copy. Syncing is smarter in that it only copies changes over. It's not as useful for single files (unless the file is very large) but if you use it on a folder, it becomes a lot more efficient if there are a lot of files and a few changes. This will become more important when Hazel starts syncing to remote servers (hint, hint). Also, copy will copy every time and ends up updating the timestamp on the file regardless of whether anything has changed. Since sync only copies changes, the timestamps are only updated on files that have actually changed.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support