AppleScript的回复回复地址 [英] AppleScript to reply to reply-to address
问题描述
我有一个AppleScript其回复一个邮件ceratin与特定的文本。
I have an AppleScript which replies to a ceratin mail with a specific text.
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
问题是,它总是回复给发件人的地址并没有给答复地址。
The problem is it always replies to the senders address and not to the reply-to address.
我在哪里可以将地址设置为回复地址?
Where can I set the address to the reply-to address?
推荐答案
一般情况下,使用了回复消息,默认情况下,回复地址。可能是你有特殊的电子邮件....?不管怎么说,强制使用的答复的话,你需要的答复之前,thisMessage读它,然后分配它。
Usually, the reply message used, by default, the reply-to address. May be you have special emails....? Anyways, to force the use of reply-to, you need to read it from thisMessage before the reply, and then assigned it.
您不需要测试,如果选择的是{}:如果是空的,重复循环将无法启动
You do not need to test if selection is {}: if it is empty, the repeat loop will not start.
此外,而不是使用按键(总是危险的),我建议只是回复邮件的内容是直接设置为文本值。
Also, instead of using keystroke (always dangerous), I suggest to just set the content of the reply email to your text value directly.
请参阅脚本波纹管与建议的修改(测试OK):
See script bellow with the changes suggested (tested and OK) :
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
这篇关于AppleScript的回复回复地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!