Created
August 2, 2012 23:57
-
-
Save briangonzalez/3242283 to your computer and use it in GitHub Desktop.
Running Applescript from Cocoa
This file contains hidden or 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
NSString *someScript = [[NSBundle mainBundle] pathForResource:@"some_script" ofType:@"osascript"]; | |
NSString *contents = [NSString stringWithContentsOfFile:someScript encoding:NSUTF8StringEncoding error:nil]; | |
NSAppleScript *script =[[NSAppleScript alloc] initWithSource:contents]; | |
[script executeAndReturnError:nil]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment