gpt4 book ai didi

applescript - 使用 AppleScript 将邮件消息设置为纯文本

转载 作者:行者123 更新时间:2023-12-02 02:12:27 26 4
gpt4 key购买 nike

我有一个 AppleScript,可以很好地整理信息并创建带有附件的电子邮件。

我找不到脚本将消息格式设置为接收收件箱所需的“纯文本”(而不是默认的“富文本”)的方法。

是否有 AppleScript 方法(或技巧)将消息格式设置为“纯文本”?

最佳答案

我在尝试解决这个问题时发现了这个问题。最终我想出了以下解决方案:

tell application "Mail"
set newMessage to make new outgoing message
with properties {visible:true,
subject:"message title",
sender:"sender@from.address",
content:mailBody}
tell newMessage
make new to recipient with properties {address:"mail@recipient.com"}
end tell
activate
end tell

tell application "System Events"
click menu item "Make Plain Text" of ((process "Mail")'s (menu bar 1)'s (menu bar item "Format")'s (menu 1))
end tell

希望有人会发现这很有用,我知道我会在几个小时前发现它!

这已在 Mail 版本 7.3 和 12.4 上进行了测试。较新或较旧的版本可能需要不同的菜单标题。

关于applescript - 使用 AppleScript 将邮件消息设置为纯文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12162392/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com