So I have simple applescript that returns (return "test") the following:
NSAppleEventDescriptor: 'utxt'("test")
I found this question and tried to replicate what it was doing with the following code
NSAppleScript *scriptObject = [[NSAppleScript alloc]initWithContentsOfURL:[NSURL fileURLWithPath: scriptPath]
error:&error];
returnDescriptor = [scriptObject executeAndReturnError: &errorDict];
NSLog(@"Return Discriptor,%@",returnDescriptor);
NSAppleEventDescriptor *utxt = [returnDescriptor descriptorForKeyword:'utxt'];
NSLog(@"Found utxt Discriptor: %@",utxt);
NSString *scriptReturn = [utxt stringValue];
NSLog(@"Found utxt string: %@",scriptReturn);
but it is not returning anything:
Return Discriptor, Found utxt Discriptor: (null) Found utxt string: (null)