如何在变量中设置Automator中的特定电子邮件地址?


2

我可以从剪贴板中收集变量(电子邮件地址)。如何在Mail with Automator中将其设置为收件人?

Answers:


3

遗憾的是,“新邮件消息”操作仅使用“主题”文本字段中的变量,因此您需要使用其他类似于运行AppleScript操作的内容来创建新消息。

就像是:

on run {input, parameters}



          set theFile to item 1 of input

          set theRecipient to item 2 of input



          tell application "Mail"

    set theMessage to make new outgoing message with properties {visible:true, subject:"My Subject"}

    tell content of theMessage

      make new attachment with properties {file name:theFile} at after last paragraph

    end tell

    tell theMessage

      make new to recipient at end of to recipients with properties {address:theRecipient}

    end tell

          end tell

end run
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.