我有一个AppleScript,它回复带有特定文本的ceratin邮件。
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问题是,它总是回复发件人的地址,而不是回复-地址。
我在哪里可以将地址设置为回复地址?
发布于 2015-12-02 21:00:38
通常,回复消息在默认情况下使用回复地址。也许你有特别的邮件.?无论如何,要强制使用reply- to,您需要在回复之前从thisMessage读取它,然后再分配它。
您不需要测试选择是否是{}:如果它是空的,重复循环将不会启动。
此外,我建议直接将回复电子邮件的内容设置为文本值,而不是使用击键(总是很危险)。
请参见下面的脚本以及建议的更改(测试和确定):
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 tellhttps://stackoverflow.com/questions/34052335
复制相似问题