2

I can collect a variable (email address) from the clipboard. How do I set it to the recipient in Mail with Automator?

1 Answer 1

4

Unfortunately, the New Mail Message action only uses variables in the Subject text field, so instead you would need to use something like another Run AppleScript action to create your new message.

Something like:

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
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .