Automator: Download invoices (PDFs) from Websites in the backgroud

Hi everyone!


I hope you're doing well.


I wanted to create an Application in Automator that downloads my monthly invoices for my tax office.

I'm a content creator and use for example: Adobe, Alfahosting (Webhost), Paperspace (VPN) etc.


Is there a guide or can it be a downloaded workflow where that Automator application

checks for the latest invoice of that month on those specific websites?


It's important to run Automator automatically in the background so no browser pops up and does it all that way.

I used ChatGPT to help me with this but it get's confusing when CGPT doesn't understand something right.


I then want to use Hazel to organize it all into Monthly folders of each year.


Thank you guys for your help in advance.


I appreciate your time and hope to hear from you.

MacBook Pro 14″, macOS 13.3

Posted on Apr 17, 2023 6:07 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 17, 2023 1:20 PM

Automator is not your friend here.


Automator can be used to download a set of URLs, but it works well for preset URLs, but fails miserably when it comes to logically and dynamically determining a variable file name (e.g. file names that vary by date).


The second issue is going to be the nature of the documents - as tax documents they're not likely to be public, so they're going to be behind some authentication system, and getting Automator to push through that is going to be a challenge.


IF you can wean a set of URLs, then it may be possible to get Automator to drive Safari to initiate the downloads, but that's about the extent of what you'll be able to do.


You might get a little further with Shortcuts, but my inclination is that you need to go deeper, with something like AppleScript which has actual logic tools available for sorting out some of the nuances of what you're asking for.



6 replies
Question marked as Top-ranking reply

Apr 17, 2023 1:20 PM in response to iSaanro

Automator is not your friend here.


Automator can be used to download a set of URLs, but it works well for preset URLs, but fails miserably when it comes to logically and dynamically determining a variable file name (e.g. file names that vary by date).


The second issue is going to be the nature of the documents - as tax documents they're not likely to be public, so they're going to be behind some authentication system, and getting Automator to push through that is going to be a challenge.


IF you can wean a set of URLs, then it may be possible to get Automator to drive Safari to initiate the downloads, but that's about the extent of what you'll be able to do.


You might get a little further with Shortcuts, but my inclination is that you need to go deeper, with something like AppleScript which has actual logic tools available for sorting out some of the nuances of what you're asking for.



Apr 26, 2023 8:21 AM in response to VikingOSX

The following curl syntax would silently download an explicit PDF file location on a remote web service to a local filename:


curl -s https://some/path/to/foo.pdf -o localfoo.pdf


There must be a specific PDF filename in that URL path because if the PDF is being served by a website using Content Management Software (CMS) such as Drupal, it will hide the actual PDF filename behind a link, and curl won't fetch that PDF.


More problematic is how you can check the last modified date of that remote PDF invoice before code logic determines it can be downloaded.

Apr 26, 2023 7:25 AM in response to VikingOSX

Zsh or AppleScript sound more like it then if it would work.

Do you think there's a community/forum out there that already has those type of scrips online?

This way I or anyone who wants to use such thing can just replace the

"template URLs" or given URLs in general of that script.


I were looking for days but couldn't find much actually which won't make much sense

since this is general stuff for all of us at some point.



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Automator: Download invoices (PDFs) from Websites in the backgroud

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.