Page 1 of 1

Waiting to act until multiple files match the right criteria

PostPosted: Fri Apr 07, 2017 11:59 am
by Manny_Mora
Hello All,

I had a question about combining pdfs and I wasn't able to find an answer when I searched, most likely because I don't know how to word my question effectively :P My family and I run a small, eco-friendly pest control business. I am just beginning to help in the office and I am trying to automate as much as possible. Here is a common scenario that repeats every day for me.

Scenario:

Phase 1

On Sunday night I log into my company's website and download 3 separate appointment lists. 1 appointment list for each technician.

Hazel currently watches the downloads folder and looks into all pdfs to find these appointment lists. Based on the information it finds, it then renames the file according to the appropriate work date and tech name and moves them to a folder called "Unprocessed".

The end result is a have a folder that looks like this:

2017-04-01 -- ANTHONY -- Appointment List.pdf
2017-04-01 -- SALVADOR -- Appointment List.pdf
2017-04-01 -- MASATO -- Appointment List.pdf


Phase 2

On Monday after the work day ends, I download 6 more pdf reports which show what work was actually done and technician notes to the office based on that day's work

I have a hazel rule for each of these as well, they all get renamed as YYYY-MM-DD -- (Tech Name) -- (Report Type). So as Monday comes to an end the unprocessed folder looks like this:

2017-04-01 -- ANTHONY -- Appointment List.pdf
2017-04-01 -- ANTHONY -- Completed Appointments.pdf
2017-04-01 -- ANTHONY -- Notes to Office.pdf
2017-04-01 -- MASATO -- Appointment List.pdf
2017-04-01 -- MASATO -- Completed Appointments.pdf
2017-04-01 -- MASATO -- Notes to Office.pdf
2017-04-01 -- SALVADOR -- Appointment List.pdf
2017-04-01 -- SALVADOR -- Completed Appointments.pdf
2017-04-01 -- SALVADOR -- Notes to Office.pdf

--- So here is where I get lost ---

I would like a hazel to watch the "Unprocessed" folder and look for files with the same Date AND Technician Name, then trigger my Automator workflow (which I already made) to combine those files so I have a folder that looks like this

2017-04-01 -- ANTHONY -- Workday Reports.pdf
2017-04-01 -- MASATO -- Workday Reports.pdf
2017-04-01 -- SALVADOR -- Workday Reports.pdf

I have no idea how to go about doing this?

Any help would be much appreciated

Manny

Re: Waiting to act until multiple files match the right crit

PostPosted: Mon Apr 10, 2017 11:12 am
by Mr_Noodle
Note that Hazel rules can only apply its actions to one folder or file. In the end it can only send one item to your Automator action.

Will your Automator action work if you send it a folder? If so, you can consider putting those files into its own folder and send that to Automator. You can use "Sort into subfolder", having it sort based on the date and technician. Search for "match patterns" in the help for details on how to do that.

Re: Waiting to act until multiple files match the right crit

PostPosted: Thu Apr 13, 2017 11:49 am
by Manny_Mora
Thank you very much for the support! That worked perfectly. Keep up the great work

Manny