Jump to content

WinGetText


Recommended Posts

I want to find a text in Mozilla an i use WinGetText. The Code looks so:

$text = 0

If $text = WinGetText("Google", "Web ") THEN

MsgBox(0, "Text read was:", $text)

EndIf

I don't understand why it's not function :)

How can help me?

Edited by gloop
Link to comment
Share on other sites

$text is not defined so you cannot use an IF statement. just use:

$text = WinGetText("www.google.de");gets the text and writes it to the variable
MsgBox(0, "Text read was:", $text);prints the variable $text

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Link to comment
Share on other sites

Hello,

I'm not using Mozilla, but have you verify that "www.google.de" is the exact title of the window.

For example, with SlimBrowser, it display "Google - SlimBrowser", but the real title of the window is "SlimBrowser - [Google]" (use Autoit Window info to check it)

But really, the return value is not the same with different browsers (I have tested your example with IE and SlimBrowser)

Link to comment
Share on other sites

Ive declared $text

but not in the sample ... its not function with IE and with mozilla :)

Edit:

Google.de was a sample. I dont look with the correct title ...

Edited by gloop
Link to comment
Share on other sites

but not in the sample ... its not function with IE

Strange, can you try with this code (it returns a value for me) :

WinWaitActive("Google - Microsoft Internet Explorer")
$text = WinGetText("Google - Microsoft Internet Explorer", "")

MsgBox(0, "Text read was:", $text)
Link to comment
Share on other sites

Now ive this code:

$text = 0

Run("C:\Programme\Internet Explorer\IEXPLORE.EXE", "", @SW_MAXIMIZE)

If WinWaitActive("Google - Microsoft Internet Explorer") THEN

    $text = WinGetText("Google - Microsoft Internet Explorer", "Web")

        MsgBox(0, "Text read was:", $text)

Endif

and it comes the messagebox and $text is 1 ...why not the text?

When i gave a invalid text its the same result :) $text = 1

Edited by gloop
Link to comment
Share on other sites

I beleive "WinGetText" in mozilla will always return "" not the page contents.

<{POST_SNAPBACK}>

Checked it on my machine, and yea there's no text to be returned w/ Mozilla and WinGetText

Do you have:

Opt("WinTitleMatchMode",2) ? Made finding windows much easier for me

FYI: WinGetText() returns 1 if it doesnt find the window

Edited by Ejoc
Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Link to comment
Share on other sites

But i will look if a word exist in the Browser.

In the example i will search for "Web"

:-/

<{POST_SNAPBACK}>

Are you laboring under the impression that WinGetText will return with the entire contents of the webpage? I think that it will only return what can be seen via the AU3Info tools as

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

or

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

if the correct option is set.

Maybe I'm wrong about the function WinGetText.....

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Find a text on a homepage :)

<{POST_SNAPBACK}>

WinGetText will not work.

You have two options that I can think of.

1. Download page with InetGet then open the file and search for your text.

2. I beleive the is a com related function that can do this but I can' think of it.

Link to comment
Share on other sites

what is that for a crap function (WinGetText) ...

i cant save all the time the website to search for a word :-/

it's not gave a function for that?

<{POST_SNAPBACK}>

:) What do you want a function for every browser since they all differ ?

:D Get real, you have all the functions you need now.

:D Use InetGet to save, then read the file.

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...