Unfortunately is not matter of ‘Focus’ since: 1) is not active; and 2) I do get notifications if I invoke Display Notifications from the Script Debugger. But I do not get any notification when I run the same command from Terminal.
Any other idea?
Then execute the command again in the Script Editor (not Script Debugger) and see if the notification is displayed. If not, then check the notification setting of the Script Editor. It seems that osascript is running in its context and there are separate settings for notifications for each app.
Otherwise you could try the following again:
osascript <<EOF
display notification "Hello from me" with title "Hello"
delay .5
EOF
I was searching all over the internet trying to figure out why the osascript command wasn’t working. I had it embedded in a Python script that I was running via launchd on my MacBook to automate a task and trigger a notification every minute.
And this solution worked perfectly, i needed to run an osascript command in the script editor once to grant permission. This is a really silly mistake from apple if you ask me, the system should prompt for permission when you are trying to run it from the terminal. But well, im still new to programming so i dont know lol.
If you ever organize group work sessions over other channels (discord, etc) please let me know, I’m looking to join a team to collaborate and share what I’ve been learning.