Page 1 of 1

Wait until a google chrome page charge then continue

Posted: 22 Oct 2019, 05:03
by guguf
Hi Everyone,

I have an issue, i would like to know if it's possible to put something in the script that say to wait until the page charge in Google Chrome ?

Code: Select all

^+i::
IfWinExist ahk_exe chrome.exe
{
winactivate, ahk_exe chrome.exe
winwaitactive, ahk_exe chrome.exe
}
Else
{
Run, C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
}
Sleep 1000
IfWinExist, Validate an IBAN ahk_class Chrome_WidgetWin_1
{ 
WinActivate Validate an IBAN
Send {TAB 14}
Sleep 300
Send {enter}
Sleep 500
Send {TAB 21}
Send %clipboard%
Send {enter}
}
Else
{
Send ^t
Sleep 500
[b]Send https://www.ibancalculator.com/iban_validieren.html[/b]
Send {enter}
Sleep 2000
Send {TAB 21}
Send %clipboard%
Send {enter}
}
return
I put in bold the link (the one that Google Chrome need to wait after the enter key)

Thank you for your help.

Best regards,
Guguf

Re: Wait until a google chrome page charge then continue

Posted: 27 Oct 2019, 03:04
by guguf
Hi,

Any idea?

Re: Wait until a google chrome page charge then continue

Posted: 27 Oct 2019, 04:52
by AHKStudent
Wait until the page loads? You are looking for that?

With Chrome (without using a Chrome driver) you can only guess by adding a sleep.

If you use COM you could wait more accurately

Re: Wait until a google chrome page charge then continue

Posted: 27 Oct 2019, 06:42
by DRocks
Use image search and identify the Tab icon.

Theres a loading animation going on that icon when the Tab is loading. When its done the icon returns to normal without animation.

Make a Loop that will break when the normal icon image is found (not loading any more) or break if its been looping for more than a certain amount of times.

Tell me if you need more details

Re: Wait until a google chrome page charge then continue

Posted: 02 Nov 2019, 14:22
by guguf
Hi,

Yes I think it's a good idead and how I do that ? ^^'

Best regards,
Guguf

Re: Wait until a google chrome page charge then continue

Posted: 03 Nov 2019, 10:39
by SpeedMaster
guguf wrote:
02 Nov 2019, 14:22
how I do that ?
There is a good coding tutorial for that here:
https://www.autohotkey.com/boards/viewtopic.php?f=7&t=65554