Skip to content

Instantly share code, notes, and snippets.

@briangonzalez
Created August 2, 2012 23:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briangonzalez/3242283 to your computer and use it in GitHub Desktop.
Save briangonzalez/3242283 to your computer and use it in GitHub Desktop.
Running Applescript from Cocoa
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