Page 1 of 1
Change icon in a notification using osascript

Posted:
Thu Nov 22, 2018 9:22 pm
by RMeira
Hi,
I'm using do while true; osascript command sleep 60 done to display a notification every 1 minute. Is it possible to change the icon on this notification. It appears as a text edit icon. In fact, I want to use Hazel icon - as a display notification action from Hazel.
Can you help me?
Thanks in advance.
Meira
Re: Change icon in a notification using osascript

Posted:
Fri Nov 23, 2018 1:12 pm
by Mr_Noodle
It's not clear to me where the notification is coming from. Is it your script or are using Hazel's "Display notification" action?
Re: Change icon in a notification using osascript

Posted:
Fri Nov 23, 2018 1:34 pm
by RMeira
I created a rule with some conditions and the action is a notification. However, Hazel notification happens only once. I need this notification every 5 minutes while that condition is true. So, instead of Hazel notification, I'm using a shell script like this: while <my script condition> do osascript 'display notification....' done. It's working perfectly. I just want to change this notification icon. It's a macOS standard icon. I want to use the same Hazel notification icon. Can you help me?
Thanks in advance.
Re: Change icon in a notification using osascript

Posted:
Mon Nov 26, 2018 12:47 pm
by Mr_Noodle
In general, if a rule continues to match a rule, it won't fire again. It will have to at least match a different rule or match no rule in between. In addition, the notification system may not show repeated notifications. The app sending the notifications doesn't really have control over this.
That all said, you can't control the icon either as it is derived from the app triggering the notification.