mskmsiva Posted January 18, 2012 Posted January 18, 2012 Hi all,All I want to do is to bring an application on top as focussed and the only active window using VBScript
gunsmokingman Posted January 18, 2012 Posted January 18, 2012 Could you provide more infomation about what you want.Here is a Vbs Script that uses AppActivate and SendKeys Method 1:\ Open Notepad2:\ Add Some Text 3:\ Save And Closes the new Text flle AppActivate And Sending Keystrokes to a ProgramSave As Demo_SendKey.vbsDim Act :Set Act = CreateObject("Wscript.Shell")Act.Run("Notepad.exe"),1,False Do Until Success = True Success = Act.AppActivate("Notepad") Wscript.Sleep 1000 Loop Act.SendKeys "This is a test of AppActivate." WScript.Sleep 1000 Act.SendKeys "{ENTER}" Act.SendKeys "T" :WScript.Sleep 500 Act.SendKeys "e" :WScript.Sleep 500 Act.SendKeys "s" :WScript.Sleep 500 Act.SendKeys "t" :WScript.Sleep 500 Act.SendKeys "%F" Act.SendKeys "{DOWN}" :WScript.Sleep 500 Act.SendKeys "{DOWN}" :WScript.Sleep 500 Act.SendKeys "{DOWN}" :WScript.Sleep 500 Act.SendKeys "{ENTER}" :WScript.Sleep 500 Act.SendKeys "Demo_Send_Key.txt" Act.SendKeys "{ENTER}",500 Act.SendKeys "%F" :WScript.Sleep 1000 Act.SendKeys "{DOWN}" :WScript.Sleep 500 Act.SendKeys "{DOWN}" :WScript.Sleep 500 Act.SendKeys "{DOWN}" :WScript.Sleep 500 Act.SendKeys "{DOWN}" :WScript.Sleep 500 Act.SendKeys "{DOWN}" :WScript.Sleep 500 Act.SendKeys "{DOWN}" :WScript.Sleep 500 Act.SendKeys "{ENTER}" :WScript.Sleep 500Rename Demo_SendKey.vbs.txt to Demo_SendKey.vbs to make active.Demo_SendKey.vbs.txt
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now