Applescript referencing a Java Applet

I need help. Im writing a script to use keystroke inputs (variables set from an Excel spreadsheet) and input them into a Java Applet using the GUI “system events” application. I know this is rather crude but I do not own nor can I modify the Java Applet in any way. I can set the variables and even direct the Applescript to input them, but I cannot figure out how to reference the Java Applet window to bring it active so my inputs flow into it. Any help would be appreciated.


Operating System: Mac OS X (10.7)


use an UI inspector like Apple’s UIElementInspector or Prefab’s UI Browser to check
whether the java applet is recognized at all