When I call uigetdir, how can I enter a directory path using Java Robot?
Mostrar comentarios más antiguos
I'm trying to use Java Robot to enter a directory path into the "Select Directory" pop-up that appears when uigetdir is called.
I've tried the following code but the robot "types" the letter h before the pop-up appears and the letter i appears after the pop-up is manually closed.
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
robot = Robot();
robot.keyPress(KeyEvent.VK_H);
robot.keyRelease(KeyEvent.VK_H);
uigetdir;
robot.keyPress(KeyEvent.VK_I);
robot.keyRelease(KeyEvent.VK_I);
What I would want is the robot to type in hi in the "Select Directory" pop-up in the "File Name" field.
I really appreciate any help you can provide.
1 comentario
Cinimod
el 11 de Jun. de 2013
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Robotics en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!