[英]Change the icon of an applescript-called notification
With OSX Mavericks we now can make notifications with applescript pretty easily. 使用OSX Mavericks,我们现在可以非常轻松地使用AppleScript进行通知 。 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?
有没有办法实现这个目标?
display notification
will take application icon. display notification
将采用应用程序图标。 You can set icon in bunlde content of applescript application. 您可以在applescript应用程序的bunlde内容中设置图标。
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
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).
将所需图片复制为图标(⌘+ C),右键单击已保存的应用程序/脚本文件,“获取信息”,单击左上角的文件图标,粘贴(⌘+ 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).
如果保存为脚本包,则还可以将包内的icns文件交换到您自己的(在Resources文件夹中)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.