首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AppleScript回复回复地址

AppleScript回复回复地址
EN

Stack Overflow用户
提问于 2015-12-02 20:25:53
回答 1查看 350关注 0票数 0

我有一个AppleScript,它回复带有特定文本的ceratin邮件。

代码语言:javascript
复制
on run {input, parameters}

    set myReply to "My Text"

    tell application "Mail"
        set theSelection to selection
        if theSelection is {} then return
        activate
        repeat with thisMessage in theSelection
            set theOutgoingMessage to reply thisMessage with opening window
            repeat until exists (window 1 whose name = "Re: " & subject of thisMessage)
            end repeat
            delay 0.3

            tell application "System Events"
                keystroke myReply
            end tell

            delay 0.5
            send theOutgoingMessage
        end repeat
    end tell

    return input
end run

问题是,它总是回复发件人的地址,而不是回复-地址。

我在哪里可以将地址设置为回复地址?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-12-02 21:00:38

通常,回复消息在默认情况下使用回复地址。也许你有特别的邮件.?无论如何,要强制使用reply- to,您需要在回复之前从thisMessage读取它,然后再分配它。

您不需要测试选择是否是{}:如果它是空的,重复循环将不会启动。

此外,我建议直接将回复电子邮件的内容设置为文本值,而不是使用击键(总是很危险)。

请参见下面的脚本以及建议的更改(测试和确定):

代码语言:javascript
复制
set myReply to "My Text"

tell application "Mail"
activate
set theSelection to selection
repeat with thisMessage in theSelection
    set ReplyAddress to reply to of thisMessage
    set theOutgoingMessage to reply thisMessage with opening window
    repeat until name of front window is (subject of theOutgoingMessage)
        delay 0.3
    end repeat

    set content of theOutgoingMessage to (myReply) as rich text
    set A to to recipient 1 of theOutgoingMessage
        set address of to recipient 1 of theOutgoingMessage to ReplyAddress
end repeat
end tell
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34052335

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档