Re: NSAppleScript seems slow...
Re: NSAppleScript seems slow...
- Subject: Re: NSAppleScript seems slow...
- From: John Anderson <email@hidden>
- Date: Mon, 10 Mar 2003 11:07:46 -0800
I use a similar model to run some scripts in my application, and it's
fine. Maybe it's just the beep function that's slow in this context?
Perhaps you could try just setting a few bogus script variables or
something instead, and see what your speed is like for that.
John Anderson
On Monday, March 10, 2003, at 10:37 AM, email@hidden wrote:
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.
_______________________________________________
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.