Skip navigation.
 
mlUsing AppleScript Scripts in Cocoa Applications - TN2084 error or just me?
FROM : Mohsan Khan
DATE : Sun Apr 27 20:27:18 2008

Hi,

I'm trying to call an AppleScript from my Cocoa application, I've 
copied the code from http://developer.apple.com/technotes/tn2006/tn2084.html
  but my application will crash once called.

I did change the script to:
NSAppleScript* scriptObject = [[NSAppleScript alloc] initWithSource: 
@"beep"];

Calling this line will crash my app:
returnDescriptor = [scriptObject executeAndReturnError: &errorDict];

Did I miss something, because I have no idea what the console messages 
mean?


Console messages:
"Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/
Contents/MacOS/Adobe Unit Types:  dlopen(/Library/ScriptingAdditions/
Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no 
suitable image found.  Did find:
   /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/
Adobe Unit Types: no matching architecture in universal wrapper
MyApp: OpenScripting.framework - scripting addition /Library/
ScriptingAdditions/Adobe Unit Types.osax declares no loadable handlers.
2008-04-27 20:17:15.095 MyApp[7531:10b] Error loading /Library/
ScriptingAdditions/FITS.osax/Contents/MacOS/FITS:  dlopen(/Library/
ScriptingAdditions/FITS.osax/Contents/MacOS/FITS, 262): no suitable 
image found.  Did find:
   /Library/ScriptingAdditions/FITS.osax/Contents/MacOS/FITS: no 
matching architecture in universal wrapper
MyApp: OpenScripting.framework - scripting addition /Library/
ScriptingAdditions/FITS.osax declares no loadable handlers."