Jump to content

Any alternative to ControlGetText?


Recommended Posts

I've observed that ControlGetText fails wen the text of the control is changing constantly.(eg %download) :P

So does anybody has any alternative other than ControlGetText to extract text of a control whose text is continuously changing???

(Actually i want to extract the file size from a control which says something like : '8% of 56.2mb downloaded'

the % keeps changing so i am not able to extract the text using ControlGetText :lmao: )

Link to comment
Share on other sites

When you say that ControlGetText() fails, what do you mean exactly? Does it return nothing and set @Error? I've never had any problem observing rapidly changing (short) text with it.

Link to comment
Share on other sites

  • Moderators

So does anybody has any alternative other than ControlGetText to extract text

Pencil and Paper?

Edit:

You know the more I think about it LxP, we ran into something like this a while ago w/ the "ControlNameNN" changing... Wonder if something like that might be causing the issue??

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thanx for the replies..

@LxP...

When you say that ControlGetText() fails, what do you mean exactly?

Even though @Error is 0 but i get "" (empty string)

Actually i'm trying to automate download of many files one-by-one whose url's r a txt document.The site doesn't support download accelarators so i'm using Internet Explorer to do it.

So my steps r:

1.Copy& Paste the url from the txt document to the address bar of IE and hit go. (done)

2.From the small window which shows me progress of download i want to extract the file size and compare it with the file size wen the window shows 'download complete'(I hav to do this b'cos of the peculiar nature of the site as many of the times it shows me 'download complete' even wen it hasn't downloaded fully)

3.If the script detects partial download in the above step then restart the download.

I'm stuck in step 2 as i'm not able to extract the file size from the control using ControlGetText() even though the text of the control mentions the full size of the file :lmao:

(control text says: '1.73mb of 7.8mb downloaded' but i'm unable to extract this txt. using ControlGetText() )

Or is there any way i can extract the file size from the site's server?

:P

Link to comment
Share on other sites

Why not use the InetGet and InetGetSize functions? Get the size of the file on the website, then compare that to the size of the file that is downloaded. In fact, InetGet will keep running until the file is completely downloaded I believe. It goes to the next step in the script when it's done. Also, if the file does not exist locally until it is totally downloaded, use the if fileexists to check and when it does exist do the file size compare if you have to.

Edited by jefhal
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
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...