We Recommend

Programming in Objective-C Programming in Objective-C
Programming in Objective-C is a concise, carefully written tutorial on the basics of Objective-C and object-oriented programming. The book makes no assumption about prior experience with object-oriented programming languages or with the C language (upon which Objective-C is based). And because of this, both novice and experienced programmers alike can use this book to quickly and effectively learn the fundamentals of Objective-C.


Ballyhoo


Posted By

sudarkoff on 02/16/08


Tagged

cocoa applescript


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

tcol


Running a pre-canned AppleScript


Published in: Objective C 


URL: http://www.borkware.com/quickies/single?id=307

  1. #define runScriptName @"checknewnow"
  2. #define runScriptType @"scpt"
  3.  
  4.  
  5. - (IBAction)runScript:(id)sender
  6. {
  7. /* Locate that darn thing*/
  8. NSString *scriptPath = [[NSBundle mainBundle]
  9. pathForResource: runScriptName
  10. ofType: runScriptType];
  11. NSURL *scriptURL = [NSURL fileURLWithPath: scriptPath];
  12.  
  13. initWithContentsOfURL: scriptURL
  14. error: nil];
  15. [as executeAndReturnError: NULL];
  16. [as release];
  17. }

Report this snippet 

You need to login to post a comment.