Hello,
I want to set the focus to the opened Firefox window.
This code ist not working for me, it's opening a new firefox window, what I don't want to:
This code is not working:
The both codes don't do what I want to have.
That is what I want:
I start .vbs, Firefox opens, if it isn't already opened, if a Firefox window is opened, the focus should be on the opened Firefox window and it shouldn't open a new window.
Thank you very much for your help.
Best regards,
Dani
I want to set the focus to the opened Firefox window.
This code ist not working for me, it's opening a new firefox window, what I don't want to:
Code:
Dim ws
Set ws = Wscript.CreateObject("Wscript.Shell")
ws.Run("Firefox.exe"),1,False
Do Until Success = True
Success = Act.AppActivate("Firefox")
Wscript.Sleep 1000
Loop
Wscript.Sleep 1000
ws.sendkeys "^l"
ws.sendkeys "https://google.de"
ws.SendKeys "{ENTER}"
Set wshshell = Nothing
wscript.quitCode:
dim ws
Set ws = WScript.CreateObject("WScript.Shell")
ws.run """C:\Program Files\Mozilla Firefox\firefox.exe"" ,1,False
Wscript.Sleep 1000
ws.sendkeys "^l"
ws.sendkeys "https://google.de"
ws.SendKeys "{ENTER}"
Set ws = Nothing
wscript.quitThat is what I want:
I start .vbs, Firefox opens, if it isn't already opened, if a Firefox window is opened, the focus should be on the opened Firefox window and it shouldn't open a new window.
Thank you very much for your help.
Best regards,
Dani