forked from gnachman/iTerm2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GrowlTrigger.m
41 lines (34 loc) · 906 Bytes
/
GrowlTrigger.m
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
//
// GrowlTrigger.m
// iTerm
//
// Created by George Nachman on 9/23/11.
//
#import "GrowlTrigger.h"
#import "iTermGrowlDelegate.h"
#import "PTYSession.h"
#import "PTYTab.h"
@implementation GrowlTrigger
- (NSString *)title
{
return @"Send Growl Alert…";
}
- (BOOL)takesParameter
{
return YES;
}
- (NSString *)paramPlaceholder
{
return @"Enter message to growl";
}
- (void)performActionWithValues:(NSArray *)values inSession:(PTYSession *)aSession
{
iTermGrowlDelegate *gd = [iTermGrowlDelegate sharedInstance];
[gd growlNotify:[self paramWithBackreferencesReplacedWithValues:values]
withDescription:[NSString stringWithFormat:@"A trigger fired in session \"%@\" in tab #%d.",
[aSession name],
[[aSession tab] realObjectCount]]
andNotification:@"Customized Message"
andSession:aSession];
}
@end