AppleScript的回复回复地址

编程入门 行业动态 更新时间:2024-10-23 18:26:56
本文介绍了AppleScript的回复回复地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个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的回复回复地址

本文发布于:2023-06-08 21:26:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/589344.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:地址   AppleScript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!