• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSAppleScript seems slow...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSAppleScript seems slow...


  • Subject: NSAppleScript seems slow...
  • From: email@hidden
  • Date: Mon, 10 Mar 2003 19:37:41 +0100

The following is the complete source code of a little Foundation tool I
made to try some applescripting from cocoa...
Sure, it works, with any script (not just my example beep), but the
execution time is always very long... About 5-6 seconds... Same thing
happens in the java-version of the code.
Is it some problem that only I have or is it NSAppleScript that's
really slow?
I thought it might be faster to run a precompiled script but I get an
error when using initWithContentsOfURL of NSAppleScript. Can somebody
shed some light on this issue of mine?


#import <Foundation/Foundation.h>
int main(void)
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSMutableDictionary *errors=[NSMutableDictionary dictionary];

NSDate *startTime=[NSDate date];

NSAppleScript *myScript=[[NSAppleScript alloc]
initWithSource:@"beep(1)"];
[myScript executeAndReturnError:&errors];

NSLog(@"Execution time: %f",[[NSDate date]
timeIntervalSinceDate:startTime]);

[pool release];
return 0;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSAppleScript seems slow...
      • From: Nicholas Riley <email@hidden>
    • Re: NSAppleScript seems slow...
      • From: John Anderson <email@hidden>
  • Prev by Date: nib corruption - please help
  • Next by Date: Re: Grep Support in Cocoa
  • Previous by thread: Re: nib corruption - please help
  • Next by thread: Re: NSAppleScript seems slow...
  • Index(es):
    • Date
    • Thread