• 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
Re: ARC and NSApplescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC and NSApplescript


  • Subject: Re: ARC and NSApplescript
  • From: Ron Reuter <email@hidden>
  • Date: Tue, 23 Apr 2013 09:18:37 -0500

Title: ARC and NSApplescript
As always, I try to write a simple program to test potential problems. Here's my console test, which works fine in 10.7 and 10.8, ARC on, Xcode 4.6.1.

#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;
}

• Ron

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
  • Follow-Ups:
    • Re: ARC and NSApplescript
      • From: Chris Paveglio <email@hidden>
References: 
 >ARC and NSApplescript (From: Chris Paveglio <email@hidden>)

  • Prev by Date: ARC and NSApplescript
  • Next by Date: Re: ARC and NSApplescript
  • Previous by thread: ARC and NSApplescript
  • Next by thread: Re: ARC and NSApplescript
  • Index(es):
    • Date
    • Thread