Fzz Posted May 19, 2004 Posted May 19, 2004 I have a control that I want to get the text from. The control is THiStatic1. I know this is the right control because when I hide the control with... ControlHide ( "Edit Membership", "", "THiStatic1" ) ...the text I want disappears off the window. However, ControlGetText for this control returns NUL. My question is, Does ControlGetText do some error checking to prevent it from returning garbage or is there a way I can get the raw data from this control. Just not sure how ControlGetText gets it's text. Thanks, Fz
emmanuel Posted May 19, 2004 Posted May 19, 2004 did you check the @error? according to the help it'll return "" if there's an error... alot of apps work in ways that autoit doesn't play well with... "I'm not even supposed to be here today!" -Dante (Hicks)
scriptkitty Posted May 19, 2004 Posted May 19, 2004 use AutoIt spy and move your mouse over the control, if no text shows, then controlgettext will give you the same. You can use other ways to get text from a control, like sending ^A^C to that control perhapse. AutoIt3, the MACGYVER Pocket Knife for computers.
Fzz Posted May 19, 2004 Author Posted May 19, 2004 @error is 0 and it returns "" not NUL but I think you knew what I ment.
Fzz Posted May 19, 2004 Author Posted May 19, 2004 Yes, spy show nothing as well. Showes the control name with no text. I have given focus to that control and tryied ^C but I didn't try ^A first. I'll try that next. Thanks!
Fzz Posted May 19, 2004 Author Posted May 19, 2004 No, I gave focus to the control and then ^A^C and tried to past the contents but it just had my previous contents in the clipboard. I also tried to... ControlSetText ( "Edit Membership", "", "THiStatic1", "Arrghh!" ) ...with no luck.
scriptkitty Posted May 19, 2004 Posted May 19, 2004 what kind of control is it? Edit box? dropdown? etc. You might use some of the controlcommand() functions AutoIt3, the MACGYVER Pocket Knife for computers.
Fzz Posted May 19, 2004 Author Posted May 19, 2004 Nope, it's just static text...although there is some color at the end of it...it's actually in a dialog box from an NWAdmin32 app for GroupWise. It looks like:Editing membership for Loan Authorities@Corpdom.Corppost.
scriptkitty Posted May 19, 2004 Posted May 19, 2004 might not be a standard control, but anyway this is one more guess. Child window, or hidden control? Opt("WinDetectHiddenText", 0) ;0=don't detect, 1=do detect Opt("WinSearchChildren", 1) ;0=no, 1=search children also AutoIt3, the MACGYVER Pocket Knife for computers.
Fzz Posted May 19, 2004 Author Posted May 19, 2004 Well, those are great ideas but they don't work. I was already using the hiddentext one but hadn't tried the child thing.Here's the dialog box:I can get all of the text on this dlg except what I really need at the top. Obviously the text is in memory somewhere. Anyway to get access to this info short of a debugger?
scriptkitty Posted May 19, 2004 Posted May 19, 2004 (edited) Strange, from the looks of that it should show up in standard text for that window. look in autoitspy under >>>>>>>>>>>( Visible Window Text )<<<<<<<<< does it show there? if so, try a simple: $x=WinGetText ( "Edit Membership" ) ...edit, of course you would need to parse it afterwards. Edited May 19, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers.
Fzz Posted May 20, 2004 Author Posted May 20, 2004 ScriptKitty: No, ALL other text on that window does show up in Visible Window Text, but not what I need. Larry: I too Googled it yesterday and saw no hits. /cry I might try doing a search with a debugger in memory for the string and see if I can extract that same location when I need it. I'm starting to get out of my comfort zone though. =-) Thanks for everyone's help!
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