Start after loaded website Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jonyjohny
Posts: 14
Joined: 05 Mar 2018, 06:06

Start after loaded website

08 Mar 2018, 14:31

Hi :)
I want that after the moment when the page loads, appear the message about this.But I have a problem, I don't know how to loop checking the time of loading the file and run formula only when website is loaded. I thought I would link it to the RunWait command, but I have no idea how. I this moment I wrote it and I stoped in it...

Code: Select all

	FileGetTime, X, C:\Users\Admin\AppData\Local\Google\Chrome\User Data\Default\Current Session, M 

	ControlClick, x832 y333, Google Chrome,, Left, 1, NA

	FileGetTime, XX, C:\Users\Admin\AppData\Local\Google\Chrome\User Data\Default\Current Session, M

	If time X>XX
	msgbox, tak
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Start after loaded website

09 Mar 2018, 01:50

I doubt that the modification time of a folder will change bc one of the files it contains has been modified. Go for the ComObj > "wait page loaded" approach.
User avatar
Jovannb
Posts: 268
Joined: 17 Jun 2014, 02:44
Location: Austria

Re: Start after loaded website

09 Mar 2018, 02:44

Hi,

in my case, that does the trick

Code: Select all

wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := false 													; false, to not see the window
wb.Navigate("www.apa.at")

While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy 	; wait till IE-Page is loaded
   sleep 100
regards

J.B.
AHK: 1.1.37.01 Ansi, 32-Bit; Win10 22H2 64 bit, german
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Start after loaded website  Topic is solved

09 Mar 2018, 02:59

Code: Select all

#SingleInstance, Force
SetBatchlines, -1
	wb := ComObjCreate("InternetExplorer.Application")
	wb.Visible := true 													; false, to not see the window
	wb.Navigate("www.washingtonpost.com")

	StartTime := A_TickCount
	While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy 	; wait till IE-Page is loaded
	   ElapsedTime := A_TickCount

	MsgBox, % Round((ElapsedTime - StartTime)/1000,2) " seconds have elapsed."
	Return
Jovannb's code (above) - tweaked.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], hiahkforum, jchestnut, mcd, Sem552, ShatterCoder and 97 guests