Open() dont work!
in
Core Library Questions
•
2 months ago
I am traying to make a code that makes that when the computer recive a serial comunication (no matter what), open my mail, but the open() part dont work! here is my code:
- import java.io.File;
- import processing.serial.*;
- import java.awt.Robot;
- Serial myPort;
- Robot robot;
- void setup()
- {
- myPort = new Serial(this, "COM11", 115200);
- try {
- robot = new Robot();
- }
- catch (AWTException e) {
- e.printStackTrace();
- }
- }
- void serialEvent(Serial myPort)
- {
- String acc =sketchPath+"/chrome/";
- println(acc);
- open(acc);
- robot.delay(1000);
- robot.mouseMove(377,40);
- robot.mousePress(InputEvent.BUTTON1_MASK);
- robot.mouseRelease(InputEvent.BUTTON1_MASK);
- robot.delay(1);
- robot.mousePress(InputEvent.BUTTON1_MASK);
- robot.mouseRelease(InputEvent.BUTTON1_MASK);
- robot.delay(1);
- robot.mousePress(InputEvent.BUTTON1_MASK);
- robot.mouseRelease(InputEvent.BUTTON1_MASK);
- robot.keyPress(KeyEvent.VK_G);
- robot.keyPress(KeyEvent.VK_M);
- robot.keyPress(KeyEvent.VK_A);
- robot.keyPress(KeyEvent.VK_I);
- robot.keyPress(KeyEvent.VK_L);
- robot.keyPress(KeyEvent.VK_PERIOD);
- robot.keyPress(KeyEvent.VK_C);
- robot.keyPress(KeyEvent.VK_O);
- robot.keyPress(KeyEvent.VK_M);
- robot.keyPress(KeyEvent.VK_ENTER);
- }
1