AppleScript Crashed Question

I ran an applescript script in a Mac application,but the software crashes when it runs. This is the information I got, but I can’t get more useful information from it. Please help me, thank you.

Crashed: com.apple.root.default-qos
0 AppleScript 0x1057cae80 UASStartTellScope1(TUASCommand*) + 90
1 AppleScript 0x1057bb7d8 ReductionProc + 610
2 AppleScript 0x1057cb91d TASParser::Parse(TTerminology*, TUASValue*, char const*, unsigned long) + 1309
3 AppleScript 0x1057b330f ASCompile(AEDesc const*, int, unsigned int*) + 533
4 AppleScript 0x1057ae099 AppleScriptComponent + 1741
5 AppleScript 0x1057c8673 AGenericCall::Delegate(ComponentInstanceRecord*) + 37
6 AppleScript 0x1057c862b AGenericManager::HandleOSACall(ComponentParameters*) + 55
7 AppleScript 0x1057c7c30 GenericComponent + 108
8 OpenScripting 0x7fff915a5a4b OSACompile + 57
9 Foundation 0x7fff938715f1 -[NSAppleScript compileAndReturnError:] + 139
10 Foundation 0x7fff938718cb -[NSAppleScript(NSPrivate) _executeWithMode:andReturnError:] + 68

this is my code:

var returnString = ""
let myAppleScript = .....
var error: NSDictionary?
if let scriptObject = NSAppleScript(source: myAppleScript) {
if let outputString=scriptObject.

executeAndReturnError

(&error).stringValue {returnString = outputString} else if (error != nil) {returnString = "\(error!)"}}
Answered by DTS Engineer in 613627022
There are two possibilities here:
  • Your script is doing something that causes the AppleScript compiler to crash (A).

  • There’s something specific to your environment that triggering this crash, and the AppleScript compiler is just an innocent bystander (B).

I recommend that you extract your script and its compilation code out into a small test project. If that still crashes, it’s solid evidence for A. If it doesn’t, at least you have a known good starting point for some differential debugging.

Make sure to run your test project using the standard memory debugging tools to see if they can provoke the crash.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer
There are two possibilities here:
  • Your script is doing something that causes the AppleScript compiler to crash (A).

  • There’s something specific to your environment that triggering this crash, and the AppleScript compiler is just an innocent bystander (B).

I recommend that you extract your script and its compilation code out into a small test project. If that still crashes, it’s solid evidence for A. If it doesn’t, at least you have a known good starting point for some differential debugging.

Make sure to run your test project using the standard memory debugging tools to see if they can provoke the crash.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
I think I know what caused this problem.thank your eskimo.
AppleScript Crashed Question
 
 
Q