ISTech Support Forum
http://www.istechforum.com/YaBB.pl Windows & Network Issues >> General Windows & Network Issues >> vbscript gurus: give evo/dba the focus http://www.istechforum.com/YaBB.pl?num=1243358981 Message started by Kelloggs on 05/26/09 at 10:29:41 |
Title: vbscript gurus: give evo/dba the focus Post by Kelloggs on 05/26/09 at 10:29:41 I am trying to automate dba from another app using vbscript Dim WShell Set WShell = CreateObject("WScript.Shell") WShell.AppActivate "Evo ~ ERP" WShell.SendKeys "x" I cannt get evo to maximize and get the focus :-X :-/ |
Title: Re: vbscript gurus: give evo/dba the focus Post by kkmfg on 05/26/09 at 11:46:28 first off, have you tried testing the return value of AppActivate? It will tell you whether it worked or not. Also, it can activate an app based on only part of the title so maybe WShell.AppActivate "Evo" would work? And, lastly, does typing X really do much of anything in Evo? Why send x? |
Title: Re: vbscript gurus: give evo/dba the focus Post by Kelloggs on 05/26/09 at 12:40:32 Dim WShell Set WShell = CreateObject("WScript.Shell") WShell.AppActivate "Evo ~ ERP" -------------------> use ALT-TAB and you will see the name. It doesnt work with anything other than "Evo ~ ERP" WShell.sendkeys "% " -------------------> Open the Application Context Menu WShell.sendkeys "R" -------------------> the "R" will restore the window (Maximize), but with tas7 doesnt work anyways, i was wondering if someone has try to do it sendkeys to evo.... :P |
Title: Re: vbscript gurus: give evo/dba the focus Post by Kelloggs on 06/01/09 at 12:43:20 This little script will give the focus to evo, then open a sales order. getting there!! Dim WShell Set WShell = CreateObject("WScript.Shell") WShell.AppActivate "Evo ~ ERP" WScript.Sleep 500 WShell.sendkeys "% x" WShell.SendKeys "%" WShell.SendKeys "M" WScript.Sleep 50 WShell.SendKeys "M" WScript.Sleep 50 WShell.SendKeys "O" WScript.Sleep 50 WShell.sendkeys "{ENTER}" WScript.Sleep 1000 WShell.sendkeys "{F2}" WScript.Sleep 50 WShell.sendkeys "35324" WShell.sendkeys "{ENTER}" WScript.Sleep 50 WShell.sendkeys "{ENTER}" :D |
ISTech Support Forum » Powered by YaBB 2.1! YaBB © 2000-2005. All Rights Reserved. |