0

使用OS X 10.9 Maverick,我正在尝试编写AppleScript通知事件。

我已经使用以下代码成功发送了标题和副标题:

set emailFrom to "Johnny Appleseed"
set emailTitle to "The Email Subject"
set emailMessage to "Hello, this is a test"

display notification with title emailFrom subtitle emailTitle

我正在尝试显示 emailFrom、emailTitle 和 emailMessage,所以它的格式如下: 在此处输入图像描述

AppleScript 通知中心文档仅讨论标题和副标题。

我尝试添加message到显示通知,但没有奏效。

set emailFrom to "Johnny Appleseed"
set emailTitle to "The Email Subject"
set emailMessage to "Hello, this is a test"

display notification with title emailFrom subtitle emailTitle message emailMessage

如何将“消息”部分添加到通知中?

4

1 回答 1

7

试试这种方式:

display notification "Notification Text" with title "Title" subtitle "SubTitle"

=>

set emailFrom to "Johnny Appleseed"
set emailTitle to "The Email Subject"
set emailMessage to "Hello, this is a test"

display notification emailMessage with title emailFrom subtitle emailTitle
于 2013-11-08T16:20:50.473 回答