【发布时间】:2021-01-03 14:09:29
【问题描述】:
我有一个自动生成电子邮件的applescript。以前,脚本会查找以“Ep”开头的任何段落,并将该段落的前两个单词加粗。
但是现在,电子邮件正文发生了变化。我们正在从电子邮件正文中删除“Ep”部分,因此我想将任何以 三位数 开头的段落的前两个单词加粗。我四处搜索,但我不知道如何让 applescript 查找以任意三位数开头的 段落。
以前的代码(基本上)是:
tell application "Mail"
activate
set emailSubject to (" Daily Reports") as rich text
set emailContent to ("Ep123 - XYZ: This is just an example
This line shouldn't be bold
Ep980 - ABC: This is a second example")
set theMessage to make new outgoing message with properties {visible:true, subject:emailSubject, content:emailContent}
tell theMessage
set font of (words 1 thru 2 of (every paragraph where the first word starts with "Ep")) to "Helvetica Bold"
make new to recipient at end of to recipients with properties {address:"test@example.com"}
end tell
end tell
我们将不胜感激。
【问题讨论】:
标签: macos email formatting applescript