Launching LibreWolf Pid trouble

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
PuzzledGreatly
Posts: 1303
Joined: 29 Sep 2013, 22:18

Launching LibreWolf Pid trouble

16 May 2023, 19:46

LibreWolf portable won't launch in a maximized state. So I tried the following:

Code: Select all

run, C:\PortableApps\LibreWolf\LibreWolf-Portable.exe,,, LWpid
winwait ahk_pid %LWpid%
soundbeep
sleep 1000
winmaximize, ahk_pid %LWpid%

^+home:: winmaximize, a
^+p:: winmaximize, ahk_pid %LWpid%
I never hear the soundbeep and the ^+p hotkey doesn't work but the ^+home one does. How can I maximize the LibreWolf window without having to use a hotkey? Thanks
User avatar
mikeyww
Posts: 27373
Joined: 09 Sep 2014, 18:38

Re: Launching LibreWolf Pid trouble

16 May 2023, 22:14

If you're not sure of your variables' values, display them. That will point you to the problem in your script, although you already know that the problem is on line 2, since you said that the problem occurs between line 1 and line 3.

You could try something like this.

Code: Select all

#Requires AutoHotkey v1.1.33
app := "C:\PortableApps\LibreWolf\LibreWolf-Portable.exe"
; app := A_WinDir "\System32\notepad.exe"
Run % app
WinWaitActive % "ahk_exe" app,, 10
If !ErrorLevel {
 WinMaximize
 SoundBeep 1500
} Else MsgBox 48, Error, An error occurred while waiting for the window.
User avatar
PuzzledGreatly
Posts: 1303
Joined: 29 Sep 2013, 22:18

Re: Launching LibreWolf Pid trouble

16 May 2023, 22:37

Thanks, I ran your script and got the error message, but by that time LibreWolf had launched.
User avatar
mikeyww
Posts: 27373
Joined: 09 Sep 2014, 18:38

Re: Launching LibreWolf Pid trouble

17 May 2023, 05:27

My hunch would be that your portable EXE runs another EXE. If you run Window Spy, you will be able to see the WinTitle of the program itself.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], MattThePrintingNerd, MrHue, Vgtrd and 142 guests