1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

osascriptの「display notification」が動かない時の対処

Posted at

macOS 15.6ですが、再起動しても、何をしても、osascriptの「display notification」が動きませんでした。

例えば、ターミナルで以下を実行しても、通知が全くでないという場合があります。

osascript -e 'display notification "hello" with title "Test"' -e 'delay 1'

そんな時の対処方法ですが、Script Editor を起動して、以下を入力して実行します。

display notification "Hello"

すると、通知の許可を求めるダイアログが表示されます。それで「許可」にします。

それだけです!

それだけのために、ずいぶん時間を浪費してしまいました。その他、以下のような原因もあるようです:

  • 集中モードになってない?
  • デバイス共有・ミラーリング時の影響がない?
  • システム設定 > 通知で、無効にしていない?
  • フォーカスモード(Do Not Disturb)がオフになっている?

今後のためにメモしておきます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?