macos - 使用 Applescript 时为 Microsoft Outlook 选择邮箱
问题描述
我正在使用 Applescript 在 Microsoft Outlook 中自动起草和发送电子邮件。虽然一切都按预期从我自己的帐户发送电子邮件,但我想调整脚本以从我可以在 Outlook 中访问的其他帐户发送电子邮件。我找到了这篇文章,但是那里显示的方法对我来说会产生错误。
https://macscripter.net/viewtopic.php?pid=185222#p185222
如何调整下面的脚本以选择正确的邮箱来发送我的电子邮件?当我使用下面的脚本时,当我尝试保存它时会生成以下错误。
语法错误 预期的类名,但发现已识别
我已经用谷歌搜索了这条错误消息,但找不到与我更改发送电子邮件的帐户的任务相关的任何内容。
set theAccount to the first exchange account whose name is "second.account@company.com"
set recipientAddress to "first.last@company.com"
set theSubject to "This is only a test"
set theContent to "<html><body><p>This is only a test.</p></body></html>"
tell application "Microsoft Outlook"
set newMessage to make new outgoing message with properties {account:theAccount, subject:theSubject, content:theContent}
tell newMessage
make new recipient at newMessage with properties {email address:{address:recipientAddress}}
end tell
save in drafts
end tell
解决方案
推荐阅读
- delphi - Delphi Tchart在打印时未显示图例中的所有项目
- google-bigquery - 如何授予查看者从 Data Studio 更改 BigQuery 参数的权限
- java - 如何在 Spring Boot 应用程序的所有 API 方法中自动添加 Dropwizard Metrics @Timed?
- django - django 使用表单添加多个模型图像实例
- javascript - 循环只显示一个 Unicode 字符
- python - 保存文件时如何避免保存子文件夹?
- huawei-mobile-services - HUAWEI Scan Kit执行startScanFromFragment方法报错
- php - 带有 getDQL 查询的 symfony 子查询
- elasticsearch - Vega-Lite / Kibana:如何制作一个显示聚合之间计算的表格?
- ajax - Codeigniter 3 多种表单,带有 ajax 和 csrf 令牌仅在一种表单上工作