Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleEvents from a multiplatform Java app?



Dear Alexander

I have seen BrowserLauncher.java by Eric Albert do some nice apple event construction and handling. May not be what you want though. It's available from:

http://browserlauncher.sourceforge.net/


A/Prof David Darby Chief Medical Officer CogState Ltd Level 7, 21 Victoria St Melbourne VIC 3000 Australia Ph 613-9664-1300 Fx 613-9664-1301 M 0419-136-847 Em email@hidden

On 28/09/2004, at 4:54 PM, Alexander Lohse wrote:

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


_______________________________________________ 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
References: 
 >AppleEvents from a multiplatform Java app? (From: Alexander Lohse <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.