Open java app and insert text

Hello All!
I'm looking for a little help on an exact problem that seems to have been solved here before (but doesn't work for me).
Here's the original archived thread:
https://discussions.apple.com/thread/2631967?start=0&tstart=0
The question asked is exactly the same....
I have a java app for a Speco Technologies DVR. After opening the app, you must type in a rather long url and then click connect. If you enter the url, then quit the app, when you relaunch it, it does not remember the url that had been entered the previous time.
I would like to create a script that will launch the Java app and then input the url (text string). I cannot get this to work.
I've gotten as far as this:
on run
tell application "Finder" to activate open document file "DVRVIEWER(DO_NOT_DELETE).jar" of folder "Applications" of startup disk
delay 5
set myString to "192.168.0.118"
repeat with currentCharacter in every character of myString
tell application "system events"
keystroke currentCharacter
end tell
delay 0.25
end repeat
tell application "system events"
keystroke return
end run
AppleScript has a Syntax Error of "Expected end of line, etc. but found command name."
Does anyone ( taylor.henderson where are you! ) have a fix, or even a better way to do this? Can I edit the existing .jar to have the info directly in there?
I would actually love to add another section in there that fills in the username and password after entering in the IP address!
Just for clarification on how this goes:
Launch .jar.
Window Launches and prompts for IP address
Enter in IP address
Press RETURN
Windows disappears and new window appears and prompts for username and password
Enter Username
Press TAB
Enter Password
Press RETURN
Thank you guys, I'm sure it's easy, but hey, for me Photoshop and Illustrator are a breeze :-0
-AndyTheFiredog

Hi
andythefiredog wrote:
Is it possible to use similar commands to maximize the java window?
Yes.
You must enable the checkbox labeled "Enable access for assistive devices" in the Universal Access System Preference pane
Add these lines after the last line wich contains "keystroke return"
  delay 2
  tell (first process whose frontmost is true) to click button 2 of window 1 -- zoom
Here's my test script ( the Speco camera demo), that works without problems here, I use the application "DVRJavaView4.1.jar", this script checks the existence of ui element (more reliable) rather than any delay.
on run
     do shell script "/usr/bin/open '/Applications/DVRJavaView4.1.jar'"
     tell application "System Events" to tell (first process whose frontmost is true)
          repeat until exists window "Please Input DVR address"
               delay 1
          end repeat
          keystroke "millapt.ddns.specoddns.net"
          keystroke return
          repeat until exists button "OK" of window 1
               delay 1 -- wait until the login window is frontmost
          end repeat
          keystroke "user"
          keystroke tab
          delay 0.1
          keystroke "4321"
          delay 0.1
          keystroke return
          repeat until name of window 1 starts with "DVRJavaView"
               delay 1 --wait while the login window is frontmost
          end repeat
          click button 2 of window 1 -- zoom
     end tell
end run

Similar Messages

Maybe you are looking for

  • Replacing "T" Mag Safe Adapter

    Typically, I do not participate on these sorts of boards; however, I have had a pretty unfortunate experience today with Apple which I'd like to not only communicate but also seek help. As a preface, the city I live does not have an official Apple St

  • How to save groups-tabs for next time use?

    I make some groups-tab by function of sites , like Email-group, News –group. If close FF beta 9, and option of startup is "show a blank page " or "show my home page", these groups were not be saved. If startup is "show my windows and tabs from last t

  • Windows Search and pooled VDI Clients

    Hello The management of our customer want to use necessarily the Windows Search on floating VDI Clients. What's the best way in your opinion to enable this? The Search Index (Database) will be computer-based and should not be generated after each p

  • Trim mode with merged clips

    I'm cutting a feature film on FCP 5.0.4 editing 23.98 NTSC DVCAM. The audio was recorded on a hard disk recorder with independent timecode and the clips were merged using slates. If I enter trim mode by double clicking on the video track (with the pu

  • Close but no cigar. (Installing Panther on Beige G3)

    Hi Folks, Last time I posted here back in October, I was having trouble with a USB 2 PCI card with my Biege G3 running OS 8.6. Got an old USB 1.1 card since then and it is working fine...Now I am upgrading even farther. I've been reading the posts he