-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrowl handler.applescript
66 lines (45 loc) · 2.74 KB
/
growl handler.applescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--Start setup should change
property growlAppName : "hoge" --Application Name
property allNotification : {"通知", "完了", "エラー"} --Growl Notifecation Name
property defaultNotification : {"通知", "完了"} ---Growl Notifecation Name Contain allNotification
property growlIcon : "Finder" --Growl Icon
property growlTitle : "タイトル" --Growl Title
--End setup
notification("本文", "通知") --use example
on notification(ntext, selectNotification) --ntext=display text selectNotification=notification name
if GrowlRunning() then
tell application "Growl"
register as application ¬
growlAppName all notifications allNotification ¬
default notifications defaultNotification ¬
icon of application growlIcon
end tell
tell application "Growl"
notify with name ¬
selectNotification title ¬
growlTitle description ¬
ntext application name ¬
growlAppName
end tell
else
display dialog ntext giving up after 2 buttons {"OK"} default button 1
end if
end notification
on GrowlRunning()
if runningProcess("GrowlHelperApp") then
return true
else if runningProcess("Growl") then
return true
else
return false
end if
end GrowlRunning
on runningProcess(appName) --return true or false
tell application "System Events"
if application process appName exists then
return true
else
return false
end if
end tell
end runningProcess