aboutsummaryrefslogtreecommitdiffstats
path: root/On Task.m
diff options
context:
space:
mode:
authorTeddy Wing2012-07-21 01:34:14 -0400
committerTeddy Wing2012-07-21 01:34:14 -0400
commit02a72745332764ca4e7ed48b0d26fe5e083ecefc (patch)
tree42d744d5c41339f58bf740047df2a9514b1de169 /On Task.m
parent87306f8ca78901b1d6e79dc74428d32e29193f63 (diff)
downloadOn-Task-02a72745332764ca4e7ed48b0d26fe5e083ecefc.tar.bz2
Got system beep to play (the one I wanted). Finally.
Diffstat (limited to 'On Task.m')
-rw-r--r--On Task.m16
1 files changed, 14 insertions, 2 deletions
diff --git a/On Task.m b/On Task.m
index 8b06bfc..a4e67e5 100644
--- a/On Task.m
+++ b/On Task.m
@@ -1,4 +1,4 @@
-#import <Foundation/Foundation.h>
+#import <AppKit/AppKit.h>
#import "NSFileManager+DirectoryLocations.h"
@@ -14,13 +14,25 @@ int main (int argc, const char * argv[]) {
[df setDateFormat:@"yyyyMMddHHmmss"];
NSString *date = [df stringFromDate:[NSDate date]];
- // Take screenshot
+ // # Take screenshot
NSTask *takeScreenshot = [[NSTask alloc] init];
[takeScreenshot setLaunchPath:@"/usr/sbin/screencapture"];
[takeScreenshot setArguments:[NSArray arrayWithObjects:@"-SxC", [supportPath stringByAppendingString:[NSString stringWithFormat:@"/%@.png", date]], nil]];
[takeScreenshot launch];
+ [takeScreenshot waitUntilExit];
[takeScreenshot release];
+
+ // # Play system beep
+ NSSound *beep = [NSSound soundNamed:@"Tink"];
+ [beep play];
+ while ([beep isPlaying]) {
+ // Don't exit the program before the sound finishes
+ }
+
+
+ // # Open text log
+
[df release];
[pool release];