We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › [OSX 10.6] AppleScript integration not working
Page Index Toggle Pages: 1
[OSX 10.6] AppleScript integration not working (Read 1009 times)
[OSX 10.6] AppleScript integration not working
Aug 29th, 2009, 5:45am
 
Hi!

I recently upgraded to OS X 10.6.
I just tried running a simple AppleScript from inside Processing, and it returns an error.
E.g. this program:
Code:
/**
applescript taken from processinghacks.com/hacks:applescript
@author sojamo
*/
import com.apple.cocoa.foundation.*;

void setup() {
size(400,400);
}

void keyPressed() {
// applescript example: ask the finder so say something.
String script = "tell application \"Finder\" to say \"Hello world how are you.\"";
executeScript(script);
}

void draw() {}

void executeScript(String script) {
NSAppleScript myScript = new NSAppleScript(script);
NSMutableDictionary errors = new NSMutableDictionary();
myScript.execute(errors);
}


spits out an error
Code:
[Deprecated] CocoaJava: com.apple.cocoa.foundation.NSAppleScript
NSRuntime.loadLibrary(/usr/lib/java/libObjCJava.dylib) error.
java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/java/libObjCJava.dylib
at ...... blablabla


The same happened to me with other libraries (e.g. processing.serial.*), but worked again after setting the default Java Engine back to 32bit in the Java Preferences App. AppleScript however, is still not working.

Am I the only one Is there a fix

i have tried the workaround discussed here in the forum, but I can neither find the "com" folder, nor create a .jar archive of anything by right clicking it. Something tells me I'm missing a crucial step here.
The link to the workaround: (sorry, can't post acive links yet)
processing.org/discourse/yabb2/num_1225564736.html#5

Thanks for any help!
Page Index Toggle Pages: 1