Encrypting PDF halfway in a chain of rules breaks it all

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

Moderator: Mr_Noodle

Hello everyone,
As many of us here, I am trying to put together a paperless workflow. I am trying to use Evernote for that, for its search capabilities. However, I am acutely aware of privacy issues, which is why I am automating the encryption of my PDFs through iCloud Keychain and PDFPen before uploading them to EN.

Here is my intended workflow on an Action folder, automated through the use of "Continue matching rules":
- When saving a PDF, I add a Finder tag corresponding to that document's nature. (tax info, etc.)
- Hazel looks into the PDF contents, renames them according to my conventions, then adds a tag "on hold" to invite me to check if the name is OK and remove potential errors.
- I do come back, edit the name if needed, remove the "On Hold" tag to invite Hazel to keep processing files.
- Hazel looks if the tag is on a "sensitive" list (health info, finances…) and if so, asks PDFPen through AppleScript to encrypt the file with the password I use specifically for this.
- Then it should upload the file to a new note in Evernote through AppleScript with the tags I set 

But this is where it breaks down. Since I'm using "Continue matching rules" to chain my rules from top to bottom, the moment a file becomes encrypted, it breaks the second rule since Hazel cannot look into the file contents anymore, and so Hazel stops acting on those files. So the chain stops, leaving me having encrypted files that are not acted upon anymore. When I skip the encryption step, it works fine… most of the time, because:

Additionally, sometimes Hazel seems to get lost; as I remove the "On Hold" tag and change file names, it seems Hazel thinks the files are new and reprocesses them from the beginning, which stucks me in an endless loop… 

Could somebody tell me what I'm doing wrong? (Or if what I'm intending is actually too much…?)

Many thanks! :D
KillerWhale
 
Posts: 9
Joined: Wed Aug 10, 2016 6:10 pm

You shouldn't need to use the "Continue" action since it looks like you are using tags to indicate different stages of your workflow. Also, you can use multiple actions in a single rule and would recommend doing that where possible. For instance, the last two steps in your workflow seem like they can be combined.

You need to provide some indicator (like another tag) at the end to distinguish the files you processed from new ones. Hazel doesn't automatically know that and you have to provide the cues.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thank you for your answer Mr. Noodle.
I guess I'm a little fuzzy then on how Hazel really works regarding "Continue matching rules" – I thought it stopped trying to match files as soon as it got a match for a rule, unless you used that action step.
Am I right, then, in assuming that, if you change a file in any way (like adding a tag, like I do), Hazel will then consider that file "unmatched" again and then start matching it again against all rules? (thus removing, indeed, for my "continue matching rules").
(That would explain a lot :) )
And thanks, I will also try to combine as much as possible.
KillerWhale
 
Posts: 9
Joined: Wed Aug 10, 2016 6:10 pm

That's for the most part correct. Or more accurately, if a file is changed, it goes through all the rules and because it changed, it can end up matching a different rule or no rule at all.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thank you very much! That's exactly what I was doing wrong. I'm going to alter the workflow taking that into account. And let me say again thank you and congratulations for the amazing tool that is Hazel. :D
KillerWhale
 
Posts: 9
Joined: Wed Aug 10, 2016 6:10 pm


Return to Support