Execute Action once, after several files have been processed

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

Moderator: Mr_Noodle

Good morning,

Long-time lurker, first-time posting. I’ve encountered a scenario I can’t figure out, so I’m reaching out to the community’s collective expertise!

I need to process several PDF files, move them around, and then execute a script. Here are the details:

I receive a 25-page PDF from our accountant. I only need to process the first 5 pages and discard the rest. Once these 5 pages are moved to the correct location, I need to run a script that calls a webhook for further processing.

Here’s my current process:

1) The multi-page PDF is saved to Downloads. I use an Automator workflow that splits the PDF into individual pages and moves them to a new folder.
2) In this new folder, I have a rule that identifies the 5 pages I need, renames them, and moves them to a specific location. A second rule deletes any PDFs that don’t match the criteria for these 5 pages.

The next step is to call a webhook, but I need it to trigger only once, ideally with a 5-minute delay. This delay is necessary because the 5 PDFs are moved to a Google Shared Folder, which is then processed using Make.com. There’s a slight delay when moving files to the Google Shared Folder, so triggering the script after every file is not feasible, as the file might not be in place yet.

What would be the best solution to achieve this? Or should I approach the problem differently and explore other methods?

Thanks so much to everyone who takes the time to read and offer suggestions!
joesky
 
Posts: 2
Joined: Wed Sep 11, 2024 1:53 am

Is the Google Drive accessible locally? You could maybe have Hazel match that folder if it sees five files in there.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Is the Google Drive accessible locally? You could maybe have Hazel match that folder if it sees five files in there.


Thanks for your answer! What would be the purpose of monitoring Google Drive? Maybe launching the webhook when five files are in place? That could work IF the number of files were constant, but it may change, and I’d like to avoid updating the procedure in the future, if possible. Changes in the number of files are rare, but when they happen, I have to remember where the parameter to change is (Hazel, Make.com, Automator... I always use a combination of these software to automate my tasks), and that would be a pain. If I misunderstood your suggestion, please help me figure it out :)
joesky
 
Posts: 2
Joined: Wed Sep 11, 2024 1:53 am

I guess I'm a little hazy on exactly how you know everything is done. I assume that you do this manually now? If so, what are the exact conditions that make you trigger that step?
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Can you extrapolate a bit more. You say you moved them to a google shares folder but then say they are not actually in place
Right away, what does that mean? It looks like you are doing some further automation with make.com so what exactly is happening?

But if all these files are local. Your google folder is local. But the pdfs are being modified with your make.com workflow, you could use a simple date modified trigger to start your webhook. So if file is being modified after you move it, you could do run webhook if date modified is not in last 5 mins. Alternatively you can run the webhook using the date last added is not in the last 5 minutes. Similar.
dhy8386
 
Posts: 96
Joined: Tue Nov 09, 2010 12:19 pm


Return to Support