Macos osx邮件中自动设置回复邮件头
比如说,我使用谷歌账户myaccount@google.com对于工作,我为我正在从事的各种项目使用别名。因此,对于project1,我使用myaccount+projet1@google.com,用于project2 myaccount+projet2@google.com等等我不需要在邮件中添加额外的帐户,因为GMail忽略了“+”符号后面的内容。 现在,在邮件帐户的配置中,我将所有地址(包括带别名的地址)放在“电子邮件地址”字段中,用逗号分隔。因此,我可以通过我的任何电子邮件myaccount+project*@google.com发送消息 我的问题是关于“回复”标题,为了在正确的文件夹中接收邮件,我必须手动选择该标题。我查看了设置,找不到解决方案。您知道自动执行此操作的方法吗(将“答复”标题设置为与“发件人”标题相同)?也许是苹果脚本? 我知道我可以使用“defaultwrite”命令,但这只允许为所有电子邮件指定一个特定的“reply to”标题,这不是我要找的Macos osx邮件中自动设置回复邮件头,macos,email,imap,Macos,Email,Imap,比如说,我使用谷歌账户myaccount@google.com对于工作,我为我正在从事的各种项目使用别名。因此,对于project1,我使用myaccount+projet1@google.com,用于project2 myaccount+projet2@google.com等等我不需要在邮件中添加额外的帐户,因为GMail忽略了“+”符号后面的内容。 现在,在邮件帐户的配置中,我将所有地址(包括带别名的地址)放在“电子邮件地址”字段中,用逗号分隔。因此,我可以通过我的任何电子邮件myaccou
提前谢谢。这是我的在制品,我现在就把它贴出来,以防我再也没有完成它。希望我能用一个读取必填字段的示例来更新它,而不是硬编码 (第三次,可能是最后一次更新) 抱歉,如果这不能完全满足您的需要,但它确实满足了我的需要,我相信您的要求比我的简单
-- Reply to current message with additional header changes.
-- (To be triggered from Keyboard Maestro, or ControllerMate on Alt-R)
-- function to read/focus/change data in message field
-- usage: set fieldValue to message_field("reply_to", false)
-- message_field("reply to", "moron")
on message_field(fieldname, newValue)
local tElements, tElement, tField, tValue, tClass
tell application "System Events"
tell process "Mail"
set frontmost to true
set tElements to scroll areas of window 1
repeat with tElement in tElements
set tName to get name of tElement as string
try
set tField to text field 1 of tElement
ignoring white space and punctuation
if (name of tField as string = fieldname) then
try
set tValue to get value of tField as string
on error
set tValue to ""
end try
set focused of tField to true
if (newValue ≠ false) then
set value of tField to newValue -- as string
end if
exit repeat
end if
end ignoring
end try
end repeat
end tell
end tell
return tValue
end message_field
-- split function (julifos @ macscripter.net)
to split(someText, delimiter)
set AppleScript's text item delimiters to delimiter
set someText to someText's text items
set AppleScript's text item delimiters to {""} --> restore delimiters to default value
return someText
end split
-- Get information from current/selected message
tell application "Mail"
set theSignatureName to "Signature #1"
set theMessages to the selected messages of the front message viewer
set theMessage to first item of theMessages
-- Get the email address (ours, hopefully) the message was sent to
set theMessageWasTo to address of first to recipient of theMessage as string
-- Unfortunately, it seesm that Mail doesn't honour the existing Reply-To header
-- when a reply is triggered from a script, instead of from the Reply menu.
-- So here is a bit of a dance to get it.
set theMessageHeaders to headers of theMessage
try
set theMessageReplyToWas to first item of {reply to} of theMessage -- (thx to Brian Christmas)
tell me to set theMessageReplyToWas to item 1 of split(theMessageReplyToWas, ",")
on error
set theMessageReplyToWas to sender of theMessage
end try
-- you can also use: set temp to {deleted status, all headers, was replied to, flag index, date received, message id, background color, subject, read status, flagged status, message size, date sent, junk mail status, source, sender, was forwarded, was redirected, content} of foo
-- set Theheaders to all headers of theMessage -- If you want to get all the headers in text form and process manually
-- set mySource to source of theMessage -- If you want the message source
set theOutgoingMessage to reply theMessage with opening window
-- I want to set "Reply-To" to be the address the message was sent to
tell me to message_field("reply to", theMessageWasTo)
tell theOutgoingMessage
-- I don't like this, as it adds an extra recipient
make new to recipient with properties {address:theMessageWasTo}
-- so I'll do it my way
tell me to message_field("to", theMessageWasTo)
end tell
-- It's easier if you just want to change the sender or signature or something
-- set message signature of theOutgoingMessage to signature theSignatureName
-- set sender of theOutgoingMessage to "Federico Viticci "
end tell
-- Now all that remains is to set the focus back to the body of the message.
+1我也想知道答案,或者另一个软件的名称。对我来说,这似乎很简单:如果一条消息的标题是:myaccount+xyz@gmail,然后我想将回复设置为:myaccount+xyz@gmail.+1只是因为OP太无知了,不能亲自投票给你。@特洛伊人太好了,我只是在等一位applescript专家来,把它全部减少到10行代码。我还想自动为邮件帐户添加别名。但是嘿。