Mac 调用 osascript 不显示通知

我在终端或者ide中调用osascript我的电脑没有弹出通知

我在终端中尝试了:

/usr/bin/osascript -e 'display notification "Hello" with title "Test"'

/usr/bin/osascript -e 'display notification "With sound" with title "Test" sound name "default"'

/usr/bin/osascript -e 'display notification "Subtitle" with title "Test" subtitle "From osascript"'

这几个命令 能够在

log stream --predicate 'process == "osascript" OR senderImagePath CONTAINS "osascript" OR subsystem == "com.apple.usernotifications"' --info


这个log中看到osa的相关日志 但是我的桌面和通知中心没有显示弹窗通知


我没有开勿扰模式

同时我在我的设置里找不到终端或者脚本编辑器的通知选项


[标题经过版主编辑]

原标题:调用 osascript 不显示通知

MacBook Pro 16″, macOS 15.5

发布日期 2025年8月22日 上午6:05

回复
问题被标记为 排名最靠前的回复

发布日期 2025年8月22日 上午7:52

到系统设置中的通知(Notifications)中,把Script Editor的通知准许打开

如果在通知中没有Script Editor,你们打开Script Editor执行你的任何一个命令,系统会弹出让你设置。

回复量:1

这个主题已被系统或社区团队关闭。 你可以为你认为有帮助的任何帖子投票,也可以在社区中搜索其他答案。

Mac 调用 osascript 不显示通知

欢迎来到 Apple 支持社区
Apple 客户在其产品方面互相帮助的论坛。使用您的 Apple 帐户开始畅游其中吧!!