I've created a flow where:
- Emails are received containing linked buttons (HTML)
- A mail rule triggers an Applescript that sends the source code to Automator
- Automator Extracts URLs from the code
- Automator Filters URLs to just ".PDF" extensions (the file type I'm trying to download)
- Automator downloads the URL (PDF)
From there I have a workflow that automatically prints new files saved in a particular folder (my ultimate goal).
This works perfectly for what I need except in the source code of the email, the link is included twice. The system thinks it them has to download two copies of the file and as a result, two copies are printed.
I'm trying to figure out a solution where, either:
- Between steps 4 & 5 above, only the first line is downloaded
- Between steps 4 & 5 above, duplicates are removed
- Upon download, the folder deletes duplicates
- Or another solution I haven't thought of that would achieve this
Any help is greatly appreciated!