applescript - 电子邮件开头的附件

时间:2015-06-03 20:53:07

标签: email applescript

我正在运行一些AppleScript。目的是打开Mac Mail并使用位于用户的附件创建新邮件。桌面。

它目前正在工作,但是......在电子邮件签名之后插入了附件,我们需要将附件放在电子邮件签名的前面(在电子邮件的开头)。

提前感谢您提供任何帮助!

代码低于......

set theAttachment to "{theDesktopPath and file name}"
set RecipientAddress to "joe@joe.com"
set RecipientName to "Joe"
set TheSubject to "Estimate"

tell application ”Mail”
set newMessage to make new outgoing message with properties {subject:theSubject, visible:true}
tell newMessage
make new to recipient with properties {name:recipientName, address:RecipientAddress}
tell content of newMessage
make new attachment with properties {file name:theAttachment as alias} at after the last paragraph
end tell
end tell
activate
end tell

1 个答案:

答案 0 :(得分:0)

改变"在最后一次"到第一个"之前像这样:

set theAttachment to "{theDesktopPath and file name}"
set RecipientAddress to "joe@joe.com"
set RecipientName to "Joe"
set TheSubject to "Estimate"

tell application "Mail"
    set newMessage to make new outgoing message with properties {subject:TheSubject, visible:true}
    tell newMessage
        make new to recipient with properties {name:RecipientName, address:RecipientAddress}
        tell content of newMessage
            make new attachment with properties {file name:theAttachment as alias} at before the first paragraph
        end tell
    end tell
    activate
end tell