Change icon in a notification using osascript

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Change icon in a notification using osascript 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
RMeira
 
Posts: 15
Joined: Thu Apr 27, 2017 3:22 pm

It's not clear to me where the notification is coming from. Is it your script or are using Hazel's "Display notification" action?
Mr_Noodle
Site Admin
 
Posts: 11226
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

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.
RMeira
 
Posts: 15
Joined: Thu Apr 27, 2017 3:22 pm

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.
Mr_Noodle
Site Admin
 
Posts: 11226
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support