Running a pre-canned AppleScript


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.