#import <Foundation/Foundation.h>
NSString *goodScript = @"on test()\n return \"Hello world\"\nend test\ntest()\n";
NSString *errorScript = @"on test()\n error number -1\nend test\ntest()\n";
int main(int argc, const char * argv[])
{
@autoreleasepool {
NSDictionary *errorDict;
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:goodScript];
NSLog(@"Script: \n%@", goodScript);
NSAppleEventDescriptor *result = [script executeAndReturnError:&errorDict];
NSLog(@"Result: %@", result);
NSLog(@"Dictionary: %@", errorDict.description);
}
return 0;
}
On 22 Apr 2013, at 3:28 PM, Chris Paveglio <
email@hidden> wrote:
Does anyone have any info on using NSApplescript in straight Objective C? I’m converting an app that used garbage collection with an NSApplescript object, compiling for 10.6 it worked fine. Now I’ve upgraded
the code to 10.7 and using ARC and of course no GC. No change to that code. The app breaks on an exception on the line
[script
executeAndReturnError:&errorInfo];
Running the compiled script from Script Debugger works with no errors, so it’s not the script itself.
Is this a known thing that ARC doesn’t work with NSApplescript? Or is it likely something else?
Chris
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden