Re: Status of AppleScript in Java?
Re: Status of AppleScript in Java?
- Subject: Re: Status of AppleScript in Java?
- From: Axel Luttgens <email@hidden>
- Date: Fri, 29 Jan 2016 19:04:01 +0100
> Le 29 janv. 2016 à 16:59, Rob Lewis a écrit :
>
> I understand that once upon a time AppleScript was supported as a ScriptEngine in Java. Currently, however, the available engines (as printed out by a test program) are:
> [nashorn, Nashorn, js, JS, JavaScript, javascript, ECMAScript, ecmascript]
>
> Anyone know if there’s a chance that AppleScript will be revived? […]
I didn’t remember of that anymore…
I guess the engine was provided only by Apple, with its own Java implementation.
The latest version (based on 1.6), downloadable from Apple’s site, still seems to come with that engine.
Indeed, starting with the example from:
https://developer.apple.com/library/mac/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html
I quickly created an "EvalScript.java" file:
import javax.script.*;
public class EvalScript {
public static void main(String[] args) throws Throwable {
String script = "say \"Hello from Java\"";
ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngine engine = mgr.getEngineByName("AppleScript");
engine.eval(script);
}
}
compiled it and ran it: my box told something to me.
HTH,
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden