dimanche 22 mars 2015

How do I automate selecting files in a .jar file?


My .jar file has a number of buttons that, when clicked, prompts me to select a file to load. I need to find a way to get this file selection to be automated, and decided on applescript.


Unfortunately, so far I have not been able to get keystroke to work when the "select file" screen comes up.


So far, I have:




tell application "System Events" to set frontmost of process "java" to true
tell application "System Events"
tell process "java"
keystroke tab & tab & tab & tab & tab & tab
key code 76 using {keystroke space}
end tell
end tell


because using this does not work:




tell application "System Events" to set frontmost of process "java" to true
tell application "System Events"
tell process "java"
keystroke tab & tab & tab & tab & tab & tab
key code 76 using {keystroke space} --- stops here
key code 124
key code 76
end tell
end tell





Aucun commentaire:

Enregistrer un commentaire