NSAppleScript seems slow...
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.