2011年8月14日日曜日

[AppleScript] Growlのサブルーチン化

Growlで通知を出すときの決まり文句。お世話になりそうです。

初回実行後に登録アプリ名でGrowlのアプリケーションごとの設定欄に現れます。音などはそちらで設定するしかなさそう。

サンプルのTweetの部分はGrowlへの登録アプリ名になります。

またサンプルのYoruFukurouは夜フクロウさんのアイコン指定。

思いのほか弄れるところはあるようで、詳しくは本家で都度確認、わかり次第追記の方がよさそう。


--実行部
my growlRegister()
growlNotify(grrTitle, grrDescription)

--サブルーチン部
using terms from application "GrowlHelperApp"
on growlRegister()
tell application "GrowlHelperApp"
register as application "Tweet" all notifications {"Notification"} default notifications {"Notification"} icon of application "YoruFukurou.app"
end tell
end growlRegister
on growlNotify(grrTitle, grrDescription)
tell application "GrowlHelperApp"
notify with name "Notification" title grrTitle description grrDescription application name "Tweet"
end tell
end growlNotify
end using terms from

0 件のコメント:

コメントを投稿