Re:Adding AppleScript ability to a java application
Re:Adding AppleScript ability to a java application
- Subject: Re:Adding AppleScript ability to a java application
- From: email@hidden
- Date: Sun, 13 Oct 2002 04:15:10 -0400
On Sat, 12 Oct 2002 11:49:38 -0700, Christopher Coulon <email@hidden>
asked,
>
imageJ is a public domain software for image analysis that
>
runs on Jaguar but is not scriptable. Its author, Wayne
>
Rasband of NIH suggested to me that I should change the
>
source code (available from
>
http://rsb.info.nih.gov/ij/download/src/)
>
to add AppleScript features to this java-based application.
>
I need someone to show me an example of how to add script
>
ability to this application so that I can take it from there
>
and create the ability to run imageJ from AppleScript.
>
Thanks in advance for any help.
I can't speak to OS X from direct experience, but I did try
Apple's MRJ ability to script Java. Apple had AppleScript
and Java pretty well hooked up there. See
http://developer.apple.com/java/applescript/
for the background. You can script the Applet Runner, and
you can script standalone Java applets you create with JBindery.
Essentially, any Java applet created with MRJ has its public
classes, properties, and methods exposed. MRJ creates this
terminology dynamically so you can open the applet's
"dictionary" from Script Editor and address Apple Events to it.
Technote 1162 (
http://developer.apple.com/technotes/tn/tn1162.html)
has all the gory details. The biggest drawback is that the
dictionary exposed EVERYTHING, and you needed to trim the
dictionary back if you wanted something some other scripter
could deal with.
In OS X, there are some promising notes in AppleScript Studio,
but I can't say I've used them. The following long URL gives
information about the "call method" command, which allows you
to talk to Java and Objectionable-C code.
http://developer.apple.com/techpubs/macosx/CoreTechnologies/
AppleScriptStudio/BuildApps_AppScrptStudio/chapter04/
Accessing_C_dio_Scripts.html
This page tells us, "The Multi-Language application, distributed
starting with AppleScript Studio 1.1, demonstrates how to call
other languages from an AppleScript Studio application."
More generally, the Java Foundation API provides all the pieces
needed to make a Java application scriptable under Cocoa.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.