Jump to content

wait until a program ends, for newbies


jurco
 Share

Recommended Posts

Friends:

First of all, sorry about my english, but my native lenguage is Spanish, so if I type something not correct, please receive my appologizes.

Well, secondly, I want to congratulate Mr. Jonathan Bennett and all his team, the program is great. I had not programmed anything since the pascal (as you can imagine, I am not so young). I downloaded the program just yesterday, and after several hours reading the help (that is really helpfull), I had been able to do my first "program".

Ok, lets get to the facts.

I am a lawyer that need to download a lot of information from the web, so I usually open a page on internet, and copy all of it in a word sheet, and then save it. I have to download arround 100 pages a day. I usually get connected to the web by a modem.

At this point, I had been able to make my "program" to do all the job, but I have to attend it in basically two moments:

First, when is trying to connect to the internet, as the time depends on traffic and other things, what i did was to put a Msgbox, so I have to hit enter when the connection is established.

Secondly, when I am downloading information, I have to wait until the web page loads at 100%, so I can use the copy-paste process, knowing that I wont miss any information. Other time, I used a Msgbox, so when the web page is completely loaded, I hit enter to make the process goes (I had establish for the Msgbox a time to wait, but, other time, the speed of downloading is variable, so if I go to the maximun time, instead of saving time, I will have to spend some more)

so, the question is, Is there any function, program, macro or something that can detects when the program has downloaded all the page or detects if the computer is finally connected to the internet?(I had tried with winwaitactive, winactivate, winactive, but seems not to be the right road)

I am sorry to ask such a dum question, but really, I had tried to find it in help all day, and I did not have luck.

By the way, for opening the "internet connecting program", i could not find the name of the file that runs it, so I used mouseclicks instead, but if you can tell me how to find out what file is running, it will be great (I tried with the Spy, but dont have luck)

Well, thanks in advance for your help.

Edited by jurco
Link to comment
Share on other sites

You can also try to get the program's statusbar text. Just sleep your script until the text equals what you need.

Opt("WinTitleMatchMode", 4)
Do
Sleep(250)
Until StatusbarGetText("classname=IEFrame") = "Done"
MsgBox(0,"","It's finished")
Who else would I be?
Link to comment
Share on other sites

see URLDownloadToFile

<{POST_SNAPBACK}>

Larry:

Thanks for your advise and your quick response. I studied the URLDownloadToFile in the help, and I decided to use the idea from "this is me", basically because I copy and paste several url´s in the same word sheet, and then, I save it as one file. Anyway, I am sure I had learned something I will be able to use in the next future.

By the way, I followed your advise about rating the program at download.com.

Regards. Juan.

Link to comment
Share on other sites

You can also try to get the program's statusbar text. Just sleep your script until the text equals what you need.

Opt("WinTitleMatchMode", 4)
Do
Sleep(250)
Until StatusbarGetText("classname=IEFrame") = "Done"
MsgBox(0,"","It's finished")

<{POST_SNAPBACK}>

Friend:

Thanks for your avdise, I followed it and after some hours I made it works, and works perfectly.

I will comment you that I had probles with getting the text from the toolbar using "statusbargettext". checking in the help, says specificly that if the control class is not msctls_statusbar32, you can have a conflict. Well, I had it.

I am not sure if the problem was this, but the class on my IEFrame is msctls_statusbar321, anyway, I tried using controlget text instead, I tried increasing the sleep laps (I have an old and slow computer), I made a subrutine to know what statusbargettext was getting in each loop, but the way I could solve it was to declare all the variables in the statusbargettext, I mean:

instead of:

Until StatusbarGetText("classname=IEFrame") = "Done"

I used:

Until StatusbarGetText("classname=IEFrame", "",1) = "Done"

Any way, thank your very much, you had been really helpful.

Regards.Juan.

and it works perfectly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...