Fantast Posted April 20, 2005 Posted April 20, 2005 (edited) Sorry, I have read the help, but can't find an answer.ControlGetText ( "title", "text", controlID )But the controlID changed everytime my window is opened.ClassNameNN of the control is the same one, so I want to know how to get text of such control?And here is my problem:I want to set this text as a condition to choose what will be sent to the window.$text = ControlGetText("windowtitle", "", controlID )If $text = A Send("!1")ElseIf $text = B Send("!2")Else Send("!3")EndIfHow can I do this? Edited April 20, 2005 by Fantast
andrew.arnott Posted April 20, 2005 Posted April 20, 2005 You can also do ControlGetText ( "title", "text", "ClassNameNN" ). It allows that. Example: WinWaitActive("Untitled - Notepad") MsgBox(0, ControlCommand("Untitled - Notepad", "", "Edit1", "GetLineCount", ""), "", 1) This will return the number of lines in an untitled notpad window. ClassNameNN is used rather than ControlID. Hope that helps!
Fantast Posted April 20, 2005 Author Posted April 20, 2005 It doesn't work in my window. But it do work in notepad: Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("^o") WinWaitActive("Open") MsgBox(0,"", ControlGetText("Open", "", "Button2")) I don't know why. Anyway, thanks.
andrew.arnott Posted April 20, 2005 Posted April 20, 2005 Likely the window you are using does not use Windows controls:Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!
Fantast Posted April 21, 2005 Author Posted April 21, 2005 Perhaps it's not a standard Microsoft controls. But how to distinguish whether a window is standard or not?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now