[Helma-user] Invisible steamroller! Applescript+Helma
Robert Huemer
hr at conspirat.com
Wed Nov 21 21:18:50 CET 2007
hi breton,
i have done it this way:
var rr = java.lang.Runtime;
var rtime = rr.getRuntime();
var child = rtime.exec("osascript path/to/applescript.scpt");
var output = new java.io.BufferedReader(new
java.io.InputStreamReader(child.getInputStream(), "UTF-8"));
var result = output.readLine();
output.close();
return(result);
robert
On 21.11.2007, at 12:50, Breton Slivka wrote:
> Hello all, I've been using helma for some weeks now, and I have come
> up against a bit of a challenge which is stressing my rather limited
> knowledge of Java.
>
> My main goal is being able to execute an applescript from helma. I
> know this is possible from Java- and is demonstrated in exhibit a:
>
> http://www.oreilly.com/pub/a/mac/2003/02/25/apple_scripting.html?
> page=1
>
> The main problem is all this classpath business. My first instinct was
> to check that the apple classes are just simply there on Mac systems-
> no go. In the article's example, the /system/library/java directory is
> added to the -classpath argument both when compiling and executing the
> java code.
>
> So, from my previous experience with using databases from javascript-
> Adding stuff to Helma's classpath is as easy as dumping jar files in
> helma's lib/ext. Problem is (nearly) all the files in
> /system/library/java are .class files, not jar. On the off chance
> that they might work anyway, I tried copying the directory into
> helma's lib/ext. Still no love from helma- the cocoa classes do not
> appear in helma. I also tried modifying the start.sh, to add a
> -classpath argument, but that didn't really work either.
>
> My next trick will be figuring out how to package all these com.apple
> class files up in a JAR, and add that. however, with encouragement
> from Chris Zumbrunn, I decided to post here first to see if anyone has
> done this before, and could offer some advice and possibly save me
> hours of fruitless blind trial and error.
>
> Thanks all,
> -Breton
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://helma.org/mailman/listinfo/helma-user
More information about the Helma-user
mailing list