Hi,
I was searching a lot through the net , but I could not find any hint
how to be able to fire applevents or applescripts from a java
application.
All I found was something like this:
_________________________________________
import com.apple.cocoa.application.NSApplication;
import com.apple.cocoa.foundation.NSAppleScript;
import com.apple.cocoa.foundation.NSMutableDictionary;
public class Scripttest {
public Scripttest() {
System.out.println("Script executed");
NSApplication.sharedApplication();
StringBuffer sb = new StringBuffer();
sb.append("tell application \"Finder\" \n");
sb.append(" activate \n");
sb.append(" make new folder at desktop \n");
sb.append("end tell");
NSAppleScript myScript = new NSAppleScript(sb.toString());
NSMutableDictionary errors = new NSMutableDictionary();
myScript.execute(errors);
}
}
I tried to embedd this in my Crossplattform Application, so I wrote
subs for the imports.
But no result.
Can anyone give me hint how to embedd Appescript in my crossplattform
Java app?
I can go very well with code like:
if (System.getProperty("mrj.version") == null) { ... }
or reflection-method-calls
But I would not like to maintain platformspecific source code.
Regards,
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden