Change the icon of an applescript-called notification

流过昼夜 提交于 2019-12-14 03:43:41

问题


With OSX Mavericks we now can make notifications with applescript pretty easily. However, there doesn’t seem to be a way to change the icon that appears to a custom one. Is there a way to accomplish this?


回答1:


display notification will take application icon. You can set icon in bunlde content of applescript application.

set fileName to choose file "Select a Folder"
display notification "Parag Bafna" subtitle "Its working" & fileName

display notification    text    required
with title  text    optional
subtitle    text    optional
sound name  text    optional



回答2:


You change the icon by simply changing the icon of the script/app itself. Copy a picture you want as icon (⌘ + C), Right click your saved app/script file, "get info", click the upper left file icon, Paste (⌘ + V). If you save as a script bundle, you can also swap the icns file inside the bundle to your own (inside the Resources folder).



来源:https://stackoverflow.com/questions/19627018/change-the-icon-of-an-applescript-called-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!