Reply to java security popup

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Re: Reply to java security popup

21 Feb 2022, 19:33

Title=Security Warning

Class=SunAwtDialog

Process Name=jp2launcher.exe

Handle=0x170a70
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Reply to java security popup

21 Feb 2022, 20:40

OK, that's what I was expecting...specifically, the Title is Security Warning...and that's what my code checks for, so it should work. Now run the script in my previous post (the one with the three MsgBox debugging commands) and let me know what dialogs you get. For example, when I run it here, I get these:

debug1.png
debug1.png (3.69 KiB) Viewed 636 times
debug2.png
debug2.png (3.53 KiB) Viewed 636 times
debug3.png
debug3.png (3.19 KiB) Viewed 636 times

It then sends two Tab keys and the Enter key...works perfectly. Regards, Joe
bobpic1961
Posts: 11
Joined: 19 Feb 2022, 22:29

Re: Reply to java security popup

21 Feb 2022, 21:56

image.png
image.png (50.87 KiB) Viewed 588 times

image.png
image.png (31.45 KiB) Viewed 588 times
image.png
image.png (35.45 KiB) Viewed 588 times
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Reply to java security popup

21 Feb 2022, 23:11

Was the Security Warning dialog on the screen during that time? If so, I can't explain what's happening. You're getting inside the loop that checks for the title (the debug2 MsgBox) and the title check [If (WinExist(Title))] should certainly be true if the Security Warning dialog is on the screen, which would result in the debug3 MsgBox and sending the keys. All I can think of is that you changed the script and are not running what I posted. With that in mind, please post the actual script that you're running. Regards, Joe
SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: Reply to java security popup

21 Feb 2022, 23:46

JoeWinograd wrote:
21 Feb 2022, 23:11
Was the Security Warning dialog on the screen during that time? If so, I can't explain what's happening. You're getting inside the loop that checks for the title (the debug2 MsgBox) and the title check [If (WinExist(Title))] should certainly be true if the Security Warning dialog is on the screen, which would result in the debug3 MsgBox and sending the keys. All I can think of is that you changed the script and are not running what I posted. With that in mind, please post the actual script that you're running. Regards, Joe
Joe and OP, maybe play with adding the below as an alternative... Curious, since you appear to have the exe that launches the window.

Code: Select all

if WinExist("ahk_exe jp2launcher.exe")
{

	WinActivate, ahk_exe jp2launcher.exe
}

Code: Select all

Loop ; run forever - exit via system tray icon
{
	If WinExist("ahk_exe jp2launcher.exe") ; check if window exists
	{
		WinActivate, ahk_exe jp2launcher.exe
		Send,{Tab}{Tab}{Enter} ; need two tabs to get to Continue button
	}
	Sleep,%TimeCheckInterval% ; wait until next check
}
Possibly some mix of both, to see what happens or for greater insurance.

Code: Select all

Loop ; run forever - exit via system tray icon
{
	If WinExist("ahk_exe jp2launcher.exe") AND WinExist(Title); check if window exists
	{
		WinActivate, %Title%
		Send,{Tab}{Tab}{Enter} ; need two tabs to get to Continue button
	}
	Sleep,%TimeCheckInterval% ; wait until next check
}
User avatar
JoeWinograd
Posts: 2214
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Reply to java security popup

22 Feb 2022, 00:33

Hi SOTE,
Yes, I thought about that, which is one reason why I had him run the script that shows the process name (which is typically a more reliable check than the title text), and it goes along with my thought that maybe he changed the title in the assignment statement, perhaps making it lower case (which would fail, since it is case sensitive). I also thought about setting title match mode to 1 (starts with...maybe there are spaces at the end) or 2 (contains) instead of 3 (matches exactly), but at the end of the day, I'd really like to understand why it isn't working as is...it should...and it does here (with a test dialog that has a title of Security Warning). All of that said, your idea is worthy of a test. Regards, Joe

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: apeironn, Bing [Bot], madensuyu1, peter_ahk and 333 guests