When I try to access a Java class (java.awt.Robot) in my EFS script I get the following error message (in the formula output window): "ReferenceError: Packages is not defined.
A snippet of the EFS code is as follows:
myFunction () {
var myRobot;
myRobot = new Packages.java.awt.Robot();
myRobot.mouseMove(200, 900);
myRobot.mousePress(InputEvent.BUTTON1_MASK);
myRobot.mouseRelease(InputEvent.BUTTON1_MASK);
myRobot.keyPress(KeyEvent.VK_B);
myRobot.keyPress(KeyEvent.VK_U);
myRobot.keyPress(KeyEvent.VK_Y);
myRobot.keyPress(KeyEvent.VK_ENTER);
return;
}
The error message occurs on the line: myRobot = new Packages.java.awt.Robot();
If I remove the Packages piece, the error message says "java is not defined." The function is supposed to move the mouse cursor to the specified location on the screen (where I have an empty Notepad editor window located) and left click in the editor window (to give it the current focus) and then it effectively causes the keyboard keys 'B', 'U', and 'Y' to be pressed, causing the word "buy" to be entered into the editor followed by the Enter key.
I have the Java 2 Platform Standard Edition Runtime Environment, Version 5 (JRE 1.5.0 [Build 1.5.0_11b03]) installed on my machine and I'm running Windows XP Version 2002 Service Pack 2 and Version 8.0 (Build 872) (July 20, 2006) of eSignal.
I was wondering if there is some environment variable missing or do you need to have more than the Java SE Runtime environment installed on your machine?
I was referring to Chapter 9 "LiveConnect Overview" in the Core JavaScript Guide Version 1.5 on how to do this. They don't make any mention in there about what you have to have installed on your machine Java-wise or any specific environment settings that may be required. Any help would be appreciated. Thank you in advance.
Craig Benson
A snippet of the EFS code is as follows:
myFunction () {
var myRobot;
myRobot = new Packages.java.awt.Robot();
myRobot.mouseMove(200, 900);
myRobot.mousePress(InputEvent.BUTTON1_MASK);
myRobot.mouseRelease(InputEvent.BUTTON1_MASK);
myRobot.keyPress(KeyEvent.VK_B);
myRobot.keyPress(KeyEvent.VK_U);
myRobot.keyPress(KeyEvent.VK_Y);
myRobot.keyPress(KeyEvent.VK_ENTER);
return;
}
The error message occurs on the line: myRobot = new Packages.java.awt.Robot();
If I remove the Packages piece, the error message says "java is not defined." The function is supposed to move the mouse cursor to the specified location on the screen (where I have an empty Notepad editor window located) and left click in the editor window (to give it the current focus) and then it effectively causes the keyboard keys 'B', 'U', and 'Y' to be pressed, causing the word "buy" to be entered into the editor followed by the Enter key.
I have the Java 2 Platform Standard Edition Runtime Environment, Version 5 (JRE 1.5.0 [Build 1.5.0_11b03]) installed on my machine and I'm running Windows XP Version 2002 Service Pack 2 and Version 8.0 (Build 872) (July 20, 2006) of eSignal.
I was wondering if there is some environment variable missing or do you need to have more than the Java SE Runtime environment installed on your machine?
I was referring to Chapter 9 "LiveConnect Overview" in the Core JavaScript Guide Version 1.5 on how to do this. They don't make any mention in there about what you have to have installed on your machine Java-wise or any specific environment settings that may be required. Any help would be appreciated. Thank you in advance.
Craig Benson
Comment