 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Benny-D Guest
|
Posted: Mon Dec 17, 2007 5:03 am Post subject: Such a simple question! How come no one can answer?! |
|
|
Will I ever get an answer to this simple question?
How can I make AHK wait until my a web-page that I am opening through Internet Explorer is fully downloaded? You see what I mean? I want my script to continue running only after the page has been fully opened (displayed, downloaded, etc. - whatever term you would use), which is usually shown by a small process bar (small green squares in one line) in the right lower corner of the screen.
Please note that I don't want to use the Sleep command, which is blind, so to say, as it doesn't really see whether the page is fully opened, but rather just pauses a script for a while.
I want a command (or a script) that would really check if the page is fully displayed and, if it is the case, would allow the remainder of the script to be run.
Thank you all in advance.
, |
|
| Back to top |
|
 |
leggah
Joined: 14 Oct 2007 Posts: 44
|
Posted: Mon Dec 17, 2007 5:30 am Post subject: |
|
|
It's different for every web browser.
| Code: |
Loop
{
IfWinExist Internet Explorer
{
;Write something here to detect whether page loads
goto restOfcode
}
else
{
}
}
restOfcode:
;rest of your script goes here
return
|
|
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Mon Dec 17, 2007 9:20 am Post subject: |
|
|
| Quote: | | Such a simple question! How come no one can answer?! | Where's the beef?? That subject line is useless.
| Quote: | | Will I ever get an answer to this simple question? | If the question would be that simple you wouldn't have to ask, right?
One, if not the main reason will be that this is a FAQ, and even moaning won't cover that you obviously hasn't searched the forum in advance to help yourself.
| Quote: | | I want my script to ... | Nice to know. Where is it? |
|
| Back to top |
|
 |
adamrgolf
Joined: 28 Dec 2006 Posts: 390
|
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1186 Location: switzerland
|
Posted: Mon Dec 17, 2007 9:40 am Post subject: |
|
|
search for internet explorer AND Done in AHK-forum
http://www.autohotkey.com/forum/topic26328.html&highlight=done+internet
http://www.autohotkey.com/forum/topic19256.html&highlight=done+internet
here my bad written script , looks for word Done, must stay at least for 5 seconds
| Code: | ;
;.... Done is present for 5 seconds = ok
;........................................................
F=http://www.t-online.de/ ;test for long loadtime
;F=http://www.bahn.de
IE=%ProgramFiles%\Internet Explorer\IEXPLORE.EXE
IV=Internet Explorer
;LI=Fertig ;german statusbar
LI=Done ;english statusbar
setformat,float,2
LP=250 ;loops
MS=20 ;milliseconds in loop
RES:=((250*20)/1000) ;done is present for 5 seconds >ok
;--------------
#Persistent
SetTitleMatchMode, 2
winset,alwaysontop,on
mousemove,0,0 ;mouse to left corner
Run,%IE% %F%,,max
Winwaitactive,%IV%
IEA:
ifWinActive,%IV%
{
loop,%LP%
{
C++
sleep,%MS%
StatusBarWait,%LI%,0
If ErrorLevel<> 0
Goto,A1
if C=%LP%
Goto,EX
}
Goto,EX
}
A1:
C=0 ;counts new wait for 5 seconds
GoTo,IEA
EX:
SoundBeep,400,150
msgbox, 262208,LoadIE,In statusbar found the word %LI%`n%LI% is OK for %RES% seconds`nContinue with your program here
ExitApp
|
Last edited by garry on Mon Dec 17, 2007 7:33 pm; edited 3 times in total |
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Mon Dec 17, 2007 9:41 am Post subject: |
|
|
[ ] |
|
| Back to top |
|
 |
Benny-D Guest
|
Posted: Mon Dec 17, 2007 10:39 am Post subject: |
|
|
| BoBoĻ wrote: | | Where's the beef?? That subject line is useless. | I deliberately didn't put the subject in there. Why? Because I wanted to catch some people like you. And look, it worked!
| BoBoĻ wrote: | | If the question would be that simple you wouldn't have to ask, right? | Why not? Do you think this is a forum only for hard questions? Plus, look at what kind of answers I got here. They are not simple at all. It proves that my question is not simple. Look, even you failed to provide an answer, but instead were acting like a child who realizes that he is loosing a game, but just can't put up with it.
| BoBoĻ wrote: | One, if not the main reason will be that this is a FAQ, and even moaning won't cover that you obviously hasn't searched the forum in advance to help yourself.  | You can rest assured that I DID search the forum in advance and didn't find the correct answer. | BoBoĻ wrote: |
| Quote: | | I want my script to ... | Nice to know. Where is it? | Why do you need to know that? Just any script. Please read what I wrote there carefully. I need the remainder of my script (any script) to be run right after a web page is fully displayed. That's the main point! Got it? It doesn't really matter what kind of script I have.
By the way, if you take a closer look, you will see that others were able to answer right away and they did give me some interesting solutions, but you... well, actually it was you who were moaning, not me! So, if you can't answer, don't waist your time - don't come here only to moan again!
Have a nice day |
|
| Back to top |
|
 |
Benny-D Guest
|
Posted: Mon Dec 17, 2007 10:42 am Post subject: |
|
|
Been there, done that. Except didn't find the right answer! |
|
| Back to top |
|
 |
DerRaphael
Joined: 23 Nov 2007 Posts: 604 Location: 127.0.0.1
|
Posted: Mon Dec 17, 2007 11:11 am Post subject: |
|
|
there is an example in forum, getting status bar text from msie. prob'ly you should search again? _________________
|
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 1186 Location: switzerland
|
|
| Back to top |
|
 |
Benny-D Guest
|
Posted: Mon Dec 17, 2007 3:07 pm Post subject: |
|
|
| Thank you, garry |
|
| Back to top |
|
 |
DerRaphael
Joined: 23 Nov 2007 Posts: 604 Location: 127.0.0.1
|
|
| Back to top |
|
 |
Firewolf91
Joined: 19 Oct 2007 Posts: 127 Location: PA
|
Posted: Mon Dec 17, 2007 4:02 pm Post subject: |
|
|
benny, maybe if you try being nicer with your posts you might get better answers or ones that will properly address your problem. to me, at least, you sounded pretty angry at everyone for not answering your problem.
One thing you should know when posting on the forums, giving snippets of code helps US figure out what you're doing so that we can come up with a solution without wasting time saying "try this generic solution that may or may not work...and if it will, we hope you implement it into your code correctly and hope you don't come complaining to us that it doesn't work...i.e. the id 10 T problem." as my colleague says...user malfunction.
You say you searched the forums already? did you use the right search string? I can tell you i've searched the forums for certain things under 4, 5 and even 6 different terms and couldn't find anything...then my boss finds something relevant in like 30 seconds.
And no, i didn't answer your question. you asked for an answer to a simple problem. detecting when the status bar says "100% Done" may not be a simple thing to do, i've never played with it. altho, have you tried using the AutoHotKey Help file? very very good source. it has a command in there called StatusBarGetText....maybe it's just me, but i would assume that playing with that and a loop for a little bit might solve your problem. if you do use a loop + gettext and check it, make sure to have some kind of delay in case it displays the "done" message prior to actually completely displaying the page.
Else, you might just be lazy and don't want to write your own code.
take no offense, i mean no harm. |
|
| Back to top |
|
 |
DerRaphael
Joined: 23 Nov 2007 Posts: 604 Location: 127.0.0.1
|
Posted: Mon Dec 17, 2007 4:16 pm Post subject: |
|
|
@firewolf: i agree with you, but such behaviour is somehow 'hip' these days.
the very 1st entry in the ask-for-help section posted by chris just explains of how to get help efficient. especially asking questions after reading the docs, searching the forum and using owns brain. probably for such ppl a new forum section should be opened: ask for scripts - the description should read as follow: either i am too lazy or too dumb, but i want to get my things done from someone else without using my precious time - and best: its FREE!
sometimes i can just shake my head...
derRaphael _________________
|
|
| Back to top |
|
 |
BoBoĻ Guest
|
Posted: Mon Dec 17, 2007 4:25 pm Post subject: |
|
|
| Quote: | | BoBo gaves you an answer (link) above | Well, garry was able to identify the link which offers an even more reliable option/code, if compared with those which uses Statusbar.... But you are more interested to ignore forum standards, but playing foolish games with your supporters, just to call it afterwards "I'm a marketing PRO - see I've created an eye-catching-subject-line". Which btw, won't help to solve your issue at all.
| Quote: | | Because I wanted to catch some people like you. And look, it worked! | a) You're obviously a marketing genius!
Unfortunatley your foolproof campaign is already used at Kindergardens around the world since ages ---> "Wer das liest ist doof".
So, better check out existing copyrights!!
| Quote: | | One thing you should know when posting on the forums, giving snippets of code helps US figure out what you're doing so that we can come up with a solution ... | ... and can identify a requesters current skill level. If we'd provide rocket science code which those aren't able to handle on their own afterwards, for the sake that we have to write it completely - we aren't that stupid, right?!
"How come no one can answer?!". Because you deserve it? Useless subject line, no code -> no answers? Correct.
You've to support your supporters to get supported. You don't - we won't. It's that simple.  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|