hazel's folder v automator's folder action

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

Moderator: Mr_Noodle

hazel's folder v automator's folder action Wed May 06, 2015 3:56 pm • by seasea
hello

I am new to hazel and haven't found a good book or guide yet. I've searched and all roads lead me to this forum and super mr_noodle. if anyone has any suggestions rather than reading online help pages, please lmk.

I learn best with things in context
eg
hazel's folder v automator's folder action
eg
yesterday I got caught, with assuming hazel's folder is SAME as automator's folder action. my bad. so now I have a flood of questions: how do I get hazel to action only on new items in folder not process existing files in folder (eg automaters folder action)? or is my thinking flawed and I am best to use Automator when I want this triggering event and hazel has her own better suited activities?
eg
if hazel processes all records on a folder, is there any other way to iniate hazel? eg right click, droplet and hazel rule is triggered, create a service and call hazels rule , use dropzone fantastic API with hazels lovely rules (apple script programmable) etc..

eg i am trialing hazel and wanted to get my head around. hazel definitely easier to use than Automator workflow for basic rules. more intuitive flow for me in rule setup eg all or any, nested rules, series of actions etc.. but what doesn't hazel do (common FAQ on what people get caught on)

eg OSX messaging is better as file names shown (not sure if possible to show OSX message for batch v individual)

and I get Automator has other things hazel doesn't do. so they are a nice team.
seasea
 
Posts: 10
Joined: Tue May 05, 2015 7:12 am

To only act on new files, load the sample rules (check the gear/cog pulldown) and look at the "Newly added files" rule. As for what Hazel doesn't do, not really something that can be written out. You need to provide specific cases and I can tell you whether it's doable. Not really understanding the OSX messaging thing. Can you elaborate?
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: hazel's folder v automator's folder action Fri May 08, 2015 8:34 pm • by seasea
Thankyou Mr_Noodle. I followed your suggestion but it did not work for me
The sample rule for newly added files has below condition to determine files the rule apply to:
Date Added is after Date Last Matched.

Is Date Last Matched stored in Hazel somewhere?
Is Date Added the individual file modified date, or where is this from?


>Hazel continued to process all records in folder as none of them have been matched.
>The folder will always contain records (files) that have been processed before Hazel installed.
>The folder will contain records I process manually. an exception but still a valid use-case
>The folder will have very old created files, that have yet to processed.

So I understand does Hazel have the Folder Action, Automator has?
----
Regarding the OSX Notifications.
>Hazel is processing/providing OSX notification at the record level e.g. e.g file that is processed.
>If I am processing say 30 records (files) it is more helpful to receive 1 OX notification sharing the result of the batch of 30 records rather than 30 individual OSX notifications. In automator I could set, process as a group.
1) Does Hazel have a setting to process in a group?
2) Does Hazel have ability to return 1 OSX message for a batch of records processed

Thankyou for your help.
seasea
 
Posts: 10
Joined: Tue May 05, 2015 7:12 am

Hazel stores the date last matched internally. Date added is stored by the system. It is different than Date modified.

> So I understand does Hazel have the Folder Action, Automator has?

Sorry, I don't understand the question here. Can you re-phrase?

There's no notion of batches. You may want to consider having rules match folders and whatever actions process all its files. In that case, you can have on notification for that whole batch. Otherwise, there is no notion of batches and in many cases, it doesn't make sense (i.e. if you have a stream of files coming in, what determines the end of one batch and the beginning of another?).
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: hazel's folder v automator's folder action Mon May 11, 2015 10:35 pm • by seasea
Thankyou Mr_Noodle

1) I am not sure what is unclear. Perhaps you can explain what you do not understand as I do not know what is confusing.

Using the last date matched as your first suggestion, to attempt to mimic OSX Automator Folder Actions - did not work. I think i wrote this. So I am unclear what is unclear. Terribly Sorry.

It did not work, as Hazel, when I used this rule as per the sample, processed all records in the folder. I only wanted Hazel to process the new files added to the folder. This is what OSX Automator Folder Action handles. New Files Added to the Folder

I have turned Hazel OFF and paused any further exploring/testing as this is the most basic feature for me. Days passed and it remains unclear. If I cannot get this to work or receive help I understand, or find a book to explain the basics, then I am at a loss how to proceed.

If you can tell me how to do it with Hazel so it works, process only new files added to a folder, that would be great.

Thankyou for your time
seasea
 
Posts: 10
Joined: Tue May 05, 2015 7:12 am

"Date added is after date last matched" should work. If it doesn't, you need to provide diagnostics indicating otherwise. Go through the troubleshooting guide stickied at the top of this forum and go from there.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: hazel's folder v automator's folder action Fri May 15, 2015 4:59 pm • by seasea
testing update:

1) "Date added is after date last matched" only works if the folder is empty before starting to use Hazel. If the folder has existing files then Hazel does not work using "Date added is after date last matched". Per diagnostics.

So one has to trick/dummy Hazel to do Folder Action that Automator can do e.g. color label all the existing files in the folder and use that as a condition in the rule.

2) The other item observed, the Folder Action (Automator) gets triggered almost immediately. Where-as Hazel took a good 2 minutes to do the same action. I wondered if there was any information on why the difference.

I sense the message Hazel is giving me, that it is designed for background processing rather than add something to folder and you want something to happen immediately. Perhaps Folder Action (Automator) is still the best for this desired automated action.

Thankyou for your help.
seasea
 
Posts: 10
Joined: Tue May 05, 2015 7:12 am

I suspect something else is going on. Are your rules matching files directly in the folder being monitored, or in a subfolder? Is the folder on a network share or is there anything else about the folder of note?
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:...there is no notion of batches and in many cases, it doesn't make sense (i.e. if you have a stream of files coming in, what determines the end of one batch and the beginning of another?).


Mr. Noodle, I have this same request for a feature, and I completely understand your clear point that generally it's impossible for files to be received into a Hazel watched folder at the same time, because a group of files always move or copy sequentially, even if it appears to happen at the same time in the case of a move (like mv rename path), so what would designate "the end" of incoming file, ie. how does Hazel know which is the last file?

However, although you say Hazel has no notion of a "Batch" per se, you also say Hazel internally tracks completion of a file so that it does not process that same file more than once.

This means Hazel already has some level of "Batch" status awareness that it has already completed processing all files in its watch folder, and some actions can take a long time.

If this awareness status could be unlocked and made available to the User it would be wonderfully useful because it means a Script, Notification, or URL could be triggered after the last file is processed in that folder so that another App can act on all of those files as a group with ready status. One possibility, perhaps, is a configurable delay trigger after first file received and all files matched, and another possibility is a trigger after X number of items in folder done.

For example, I have a Filemaker Database that needs to catalog a group of files as a whole batch. However, it should only run after a series of automated actions in Hazel but I am stuck until I have a way to trigger the AppleScript open URL after the last file Hazel processes.
chaseholden
 
Posts: 9
Joined: Wed Oct 12, 2016 1:18 pm

If there is a pause in files coming in, yes, Hazel can detect that but many times, that does not correlate with what most users would think of as a batch. Really, the program putting the files in there is the only reliable way to detect batches. Anything Hazel does will be a bad guess and will result in more frustration and support when it consistently doesn't work.
Mr_Noodle
Site Admin
 
Posts: 11240
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron