使用AppleScript通过通知中心发送消息
使用OSX10.9Maverick,我试图编写一个AppleScript通知事件 我已使用以下代码成功发送标题和副标题:使用AppleScript通过通知中心发送消息,applescript,Applescript,使用OSX10.9Maverick,我试图编写一个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 我正在尝试显示
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 Notification Center文档仅讨论标题和副标题
我已尝试将消息添加到显示通知中,但不起作用
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
如何将消息部分添加到通知中?请尝试以下方法:
display notification "Notification Text" with title "Title" subtitle "SubTitle"
=>
请注意,这似乎是中的一个新功能。这对我来说在OSX 10.8.5上不起作用。从10.10开始,也可以用JavaScript实现这一点。我发布了这个问答,展示了如何:。
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