简体   繁体   English

使用邮件规则/ Applescript / Automator流在HTML按钮后面下载PDF

[英]Using a mail rule/Applescript/Automator flow to download a PDF behind an HTML button

I'm receiving BCC emails from a branded photo activation and tasked with automatically saving a copy of the photo included with each email. 我收到来自品牌照片激活的密件抄送电子邮件,任务是自动保存每封电子邮件中包含的照片副本。

The emails are HTML-coded and the link to the PDF I'm tasked with saving is attached to a button (ie "Click here to see your photo"). 电子邮件是HTML编码的,指向我要保存的PDF的链接附在按钮上(即“单击此处查看照片”)。

I've successfully created the following flow, but it won't download the PDF from the HTML email, it will only download if the PDF is linked in plain text. 我已经成功创建了以下流程,但是它不会从HTML电子邮件中下载PDF,只有在PDF以纯文本链接时才会下载。 Any help would getting the raw email would be greatly appreciated... 任何帮助将获得原始电子邮件将不胜感激...

  1. Mail Rule to run AppleScript on all messages 邮件规则以对所有邮件运行AppleScript
  2. Applescript code: Applescript代码:

      property workFlowPath : quoted form of ("/Users/USERNAME/Documents/Applescript/WORKFLOWNAME.workflow") using terms from application "Mail" on perform mail action with messages theMessages for rule theRule repeat with eachMessage in theMessages (*Get the email Subject *) set input_Argument to content of eachMessage (*Run subroutine for workflow *) my runAutomator(input_Argument) end repeat end perform mail action with messages end using terms from (*Workflow Subroutine *) on runAutomator(input_Argument) (*Path to workflow *) (*Setup and Run the unix command *) set command to "/usr/bin/automator -i " & quoted form of input_Argument & space & workFlowPath do shell script command end runAutomator 
  3. The workflow it triggers runs an automator flow that only saves files ending in ".pdf" to a designated folder 它触发的工作流程运行自动机流程,该流程仅将以“.pdf”结尾的文件保存到指定的文件夹中

You could make the browser select the download button and then activate a left click. 您可以让浏览器选择下载按钮,然后激活左键单击。 The only issue is that you would have to specify a specific part of the website. 唯一的问题是,您将必须指定网站的特定部分。

You could have the words copying down and go to a website called txtformat.com and replace &N with nothing. 您可以将单词复制下来,然后转到一个名为txtformat.com的网站,将&N替换为空。 Then paste the result and return to the email to download. 然后粘贴结果并返回到要下载的电子邮件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM