• 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
AS & Cocoa & macOS - anyone aware of changes?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AS & Cocoa & macOS - anyone aware of changes?


  • Subject: AS & Cocoa & macOS - anyone aware of changes?
  • From: Stephen Cronin <email@hidden>
  • Date: Mon, 17 Oct 2016 15:25:30 -0700

This is a bit off straight AS but there are knowledgeable folks here so I ask your indulgence.

I have Cocoa code that build custom NSAppleScript events buy invoking subroutines in complied .scpt files which are included inside the Cocoa application.   This code has worked for years.

I’ve upgraded to Xcode 8.0 & macOS 10.12
Now this code is crashing with [NSApplicaton _crashOnException] that I can’t trap with a @try.

Anyone have any suggestions?
Thanks for your time!
Steve

__________
// to avoid linking issues
#ifndef kASSubroutineEvent
#define kASSubroutineEvent (FourCharCode)'psbr'
#endif
#ifndef kASAppleScriptSuite
#define kASAppleScriptSuite (FourCharCode)'ascr'
#endif
#ifndef keyASSubroutineName
#define keyASSubroutineName (FourCharCode)'snam'
#endif
…
    NSAppleEventDescriptor *currentProcess  = [NSAppleEventDescriptor currentProcessDescriptor] ;
    NSAppleEventDescriptor *executeSubroutineEvent = [NSAppleEventDescriptor appleEventWithEventClass:kASAppleScriptSuite eventID:kASSubroutineEvent targetDescriptor: currentProcess returnID:kAutoGenerateReturnID transactionID:kAnyTransactionID];
    NSAppleEventDescriptor *handlerName = [NSAppleEventDescriptor descriptorWithString:handler.lowercaseString];
    [executeSubroutineEvent setParamDescriptor:handlerName forKeyword:keyASSubroutineName];
    NSAppleEventDescriptor* list = [NSAppleEventDescriptor listDescriptor];
    int i=0; va_list ppp; va_start(ppp, firstParam);
    NSAppleEventDescriptor * aParam = firstParam;
    while (aParam) {
        [list insertDescriptor:aParam atIndex:++i];
        aParam = va_arg(ppp, NSAppleEventDescriptor *);
    }
    [executeSubroutineEvent setParamDescriptor:list forKeyword:keyDirectObject];
    errorDict = nil;
    NSAppleEventDescriptor *eventResult = [compiledAppleScript executeAppleEvent:executeSubroutineEvent error:&errorDict];
    if ((!eventResult.descriptorType) || (errorDict!=nil)) {

it crashed on the 'eventResult' line: EXC_BAD_INSTRUCTION

#0 0x00007fff90cca28e in -[NSApplication _crashOnException:] ()
#1 0x00007fff90d9034e in __37+[NSDisplayCycle currentDisplayCycle]_block_invoke.31 ()
#2 0x00007fff92cf3f67 in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#3 0x00007fff92cf3ed7 in __CFRunLoopDoObservers ()
#4 0x00007fff92cd4b79 in __CFRunLoopRun ()
#5 0x00007fff92cd45b4 in CFRunLoopRunSpecific ()
#6 0x00007fff92275f6c in RunCurrentEventLoopInMode ()
#7 0x00007fff923c2017 in GetNextEventMatchingMask ()
#8 0x00007fff923c1f15 in WNEInternal ()
#9 0x0000000104e83f9a in AEDefaultActiveProc(void*) ()
#10 0x0000000104e88955 in InternalComponentActive(unsigned int) ()
#11 0x0000000104ebd51b in UASRemoteSend(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigned char*) ()
#12 0x0000000104e93c6c in UASActor_Send(unsigned char, unsigned char, unsigned char) ()
#13 0x0000000104e9f521 in UASExecute1() ()
#14 0x0000000104e70d7e in ASExecuteEvent(AEDesc const*, unsigned int, int, unsigned int*) ()
#15 0x0000000104e692dc in AppleScriptComponent ()
#16 0x0000000104e839e5 in AGenericCall::Delegate(ComponentInstanceRecord*) ()
#17 0x0000000104e839ab in AGenericManager::HandleOSACall(ComponentParameters*) ()
#18 0x0000000104e82fac in GenericComponent ()
#19 0x00007fff925fca5f in OSAExecuteEvent ()
#20 0x00007fff947cd913 in -[NSAppleScript(NSPrivate) _executeAppleEvent:withMode:error:] ()
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: AS & Cocoa & macOS - anyone aware of changes?
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: About path to temporary items.
  • Next by Date: Re: AS & Cocoa & macOS - anyone aware of changes?
  • Previous by thread: Re: About path to temporary items.
  • Next by thread: Re: AS & Cocoa & macOS - anyone aware of changes?
  • Index(es):
    • Date
    • Thread