Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipse-scripting-dev] Trying to run script


On 15.05.2014 15:28, Dinis Cruz wrote:
Hi, I'm trying to run the http://codeandme.blogspot.de/p/escript-script-example.html script using the Core and Modules features from http://download.eclipse.org/e4/updates/ease/eclipse-e4-ease-nightly/ but am not sure where to put that script  (or any other script)

Scripts are best located in a workspace project as simple files. Create a _javascript_ or plain project and create a file, eg sample.js. Then paste your code to that file. Now you can use quickLaunch and/or run targets to execute your script. You might also want to DnD it into the script shell for execution.

The script itself is rather old, and we did not port the "Sample" module to EASE. However EASE comes with a Resources and a UI module that provide similar functionality. You can find available modules either in the script shell (use the dropdown on the first toolbar icon) or in the Scripting help.

A variation of this question is how to recreate the environment shown in  https://wiki.eclipse.org/E4/Scripting/Tutorials

Well, I have to admit we lack a bit behind with documentation. Best use the script examples located in "org.eclipse.ease.lang._javascript_.examples". But you have to check out the source code for the time being. You may do that online if you wish:
https://git.eclipse.org/c/e4/org.eclipse.e4.scripting.git/tree/Plugins/engines/org.eclipse.ease.lang._javascript_.examples/samples/scripts


Note: The Rhino Script Shell is working OKish, but that only seems to allow the execution of one line at the time. I said OKish, because when I executed the script loadModule('DialogModule');  I got the Unable to find module "/DialogModule error (in the Console window), so don't think all is right with the Rhino Script Shell

The behavior is correct. There exists no such module. You might want to try loadModule("UI") or use the toolbar entry to load modules.

HTH
Christian

Back to the top