Created
November 3, 2010 21:57
-
-
Save unixpickle/661800 to your computer and use it in GitHub Desktop.
a simple objective-c application to allow little snitch connections
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
int main (int argc, char * argv[]) { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
NSAppleScript * scrpt = [[NSAppleScript alloc] initWithSource:@"set volume 0\n\ | |
tell application \"System Events\" to set app_name to name of the first process whose frontmost is true\n\ | |
tell application \"Little Snitch UIAgent\" to activate\n\ | |
tell application \"System Events\" to keystroke return\n\ | |
tell application app_name to activate\n\ | |
delay 0.5\n\ | |
set volume 7"]; | |
[scrpt executeAndReturnError:nil]; | |
[scrpt release]; | |
[pool drain]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment