Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Help

Status
Not open for further replies.

scott257us

Technical User
Joined
Nov 14, 2006
Messages
3
Location
US
I am having problems with the scripted attached to below,
everything works with the exception of the TABS and ENTER. I have used the same format on other programs but with JDE it just doesn't seem to work. But if I hit the keys on the keyboard they work.??? Please help sorry I left off the code, here it is

Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "jde"
Wscript.Sleep 5000
objShell.SendKeys "password"
objshell.sendkeys "{TAB}"
objshell.sendkeys "{TAB}"
objshell.sendkeys "{ENTER}"
WScript.Quit



Thank You,

scott257us
 
here's the syntax for AppActivate:
WSHShell.Run ("jde.exe")
WshShell.AppActivate ("jde's window title")

the window title must match exatly what shows up on the window when it's run.
 
i tend to chuck the AppActivate in a loop (to handle composure time)
'cant recall what it returns on success but i am sure you can find that out
For i = 1 To HowLongWillIWait
If obj.AppActivate("windowname") = 0 Then
Exit For 'terrible i know
End If
Wscript.Sleep 1000 'terrible i know
i = i + 1
Next
 
AppActivate returns a Boolean indicating success(True) or failure(False).

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
which would implicity be converted to a 0 or 1 ;-)
 
which would implicity be converted to a 0 or [!]-[/!]1
 
thanks PHV, good job i was check for 0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top