JSR-223 support inside Field Alpha 12

10 views
Skip to first unread message

Tom Fuerstner

unread,
Jul 18, 2011, 6:15:32 AM7/18/11
to Field-development
as the alpha12 version is the most recent version to download: is this
version already supporting JSR-223 Scripting Engines?

my attempt to call the according classes always results in the error:
"can't load AppleScriptScripting "


br,

/tom_fuerstner

Marc Downie

unread,
Jul 19, 2011, 1:11:20 PM7/19/11
to field-de...@googlegroups.com

Field doesn't have any particular support for arbitrary JSR 223 engines (although you can just write the code that calls into them, Field can see the JSR 223 classes). Each of the languages the "lambda" palette wraps a 223 engine in enough sugar to make it more interesting. 

Now Field does have an "applescript" text transform (http://openendedgroup.com/field/wiki/MayaIntegration#AppleScripteverybodyelse) — that actually shells out to "osascript".

What code are you actually running? and what is the complete stacktrace?

Marc.


--
You received this message because you are subscribed to the Google Groups "Field-development" group.
To post to this group, send email to field-de...@googlegroups.com.
To unsubscribe from this group, send email to field-developm...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/field-development?hl=en.


Tom Fuerstner

unread,
Jul 20, 2011, 12:22:59 PM7/20/11
to field-de...@googlegroups.com
hi marc,

what i do is loading some external java classes into Field that run another java-based language (Hypertalk in this case ) inside Field.

The main interpreter class knows how to deal with a specific statement of the kind of: do "script statement" as "jython".

This happens by using JSR-223 classes within the external Hypertalk interpreter. 

The code sequence is simple:

import javax.script.Invocable;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

...

public static ScriptEngineManager manager = new ScriptEngineManager();
public static ScriptEngine sengine = manager.getEngineByName("jython");

...
 
private static final ExternalLanguage e_jython = new ExternalLanguage() {
public XOMVariant execute(String script) {
 
try {
Object result = sengine.eval(script);
return null;
} catch (ScriptException e) {
throw new XNScriptError("Error running JSR-223 Jython Scripting Engine: "+e.getMessage());
}       
 
}
}; 


so, i don't even ask the program to the JSR-223 'applescriptscripting engine'  and then it gets loaded anyway.

that's my problem

cheers,

/tom

--
Tom Fuerstner

-------

(c)2010  ><{{{{{{°> tom surfs along!

-------

Keep it private!  So, please use my PGP public key for important messages!

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)

mQENBE0AguYBCACs8I7yPOBywdSD/NK6egvugcPv4uRMdcA2rpKOfJpLAVJRE7gj
RYiV/kujaO/vXylBekzwVP18S1RiCDVWpvlBDhpINX4ot25Uylg0GGReASNTqEC5
hadf78E3opU8KryPPb6LTZCjfNrvUjbDB+FyLAWbFbIjrPE1hLVwBl6ScYWmYytt
ZRYYe6x3J6pJ8rNP5HDv/9hCxlysayQkqvNwaL7H6OlzehD1GozDEldX53lkD5Nv
pajk7SnJAWIFigi+b+jd2YkXAbckMPxKngbqYs16xbBcDLjIQEFjIehiLEG+792p
8rFlOnVRLES5IIrL7IPgmoXkXzX9/DvAy5erABEBAAG0IE5lc3RvciBTaWxrIDxp
LnNjcmlwdEBnbWFpbC5jb20+iQE4BBMBAgAiBQJNAILmAhsvBgsJCAcDAgYVCAIJ
CgsEFgIDAQIeAQIXgAAKCRC4if464wm3EFo3B/sGCAsh60b+xv/CJ3rsvlIXMlXU
mUblS24cPxo87z7sli+y8w30NIHpvUOXZNgxBeLIYeSajcefpP73RKJNz1RG48iH
yUUkHTApfvP3ELXyNC5AmGfUYJpbXJqNtm+KL/48/QKfNpszvYuVGn3Om4AuIqXt
Oh//LJ+Zr3IPULsXey6SSBVwLoVB/07hiO3z31K+JdkhIV+dnpPiU6E2dH3mztqc
OzjqDlkQYW2ov9MZ3U+zhhcRTcFpnv8yHuziOxf7yHXco2JSqXQ6ZzlOx5wzz7H1
TNy1dJpi+e1ztZQblUxiNlpoEzEWvulHPe+Eh+0kzp6KkbAm+wTGKFCauN68uQEN
BE0AguYBCAC2Lkj7PDPiPwXixs7B5yc++PBiQoE/9tCwvzhumoQB0IqhErAOnLXw
+auQ9YByo4XLbP2QsrQ8rAG9r+GIesv5/eCEA3TT6szKcDRIVrU6q2+ADjxQvRGW
YDtOeGyhBwgc1FXT+HN5xxalsV3hro7zyUCNKkg6+KmwA+O19jbqtQJEWOmkUjZ5
UvmXw9U6OHpoX7KkWyw4tA58hEtMZh3pirENyhQib3asGLVjuwq3ytv6ESmljxpD
55412ZEznwS4UeIwZdODPKu80vnXdSu6lC8Rctkikd5xDJRiQiCskpSry1bY2m9F
bdOkSakLuA8CKF2g+u5W3XZNzeDYRZv7ABEBAAGJAj4EGAECAAkFAk0AguYCGy4B
KQkQuIn+OuMJtxDAXSAEGQECAAYFAk0AguYACgkQqsxcWG12BlFZggf/eBb3OjpU
bYIUc9yljonj7v7492wazpdXMxMXzDKzgHpmPGoyJvVE0yztLcNYo94XowmLtJnf
Soeg4VuOkR39fTEHn4gaBEjItkU6FP7ExZeStSL45htjwbmAn1pqrQQRSdf9ZR9/
AR+YZdFtESuYW2n6T39pkTDIVh9RPTCGD7ue+akCJJ2MlLhRU1jzk64T5Q7Q0cLV
n9AieP5abgR1A6IHTbcWiNcHwuD56zDG+WT8vJ1Lf/WD2LwVsoihDyAWvpMxM7i/
JI1J+QckaO83OMqcVikpBgV9e9cAACJOiIvv8VauFxAh89kaT4DWByasFh+FFGXa
0zR2xQ/aCyKkr522B/92Dmus6eFC2jLr/aF1MyRlX7lqR5UTT/pLp2WaJQKtlnA4
WRfHksK3SYjSLfiaJStbQNW644WcJNcMB0n8L4GCmvhxezBORXKmvhjgu6GkhsWA
Jtu0edRs8hixA2vZCyPHXNu5OqIJQ1V3v8HTswC1mWLX7gvMF1NgIn1Cfo46cYVP
piafgtN1XYBI9oY0VpuIra1jJJmunamJhCMxKFIhPSs3VVUs1gjaK8qGhxWApxyn
nAMbTzyeVoIdeDvm8E9j0hfJ0UqpSIfJy/W6MJ3bp7+5CuJlDEZz0nRQfKsHo2EM
fW9k6abAY/0+HGyGu5c7RjqDWOdXIvvfLC5792kr
=aiEC
-----END PGP PUBLIC KEY BLOCK-----

Reply all
Reply to author
Forward
0 new messages