lazylivin Posted September 30, 2013 Share Posted September 30, 2013 Hi there, I am new to Autoit. Have a question regarding how to obtain information I retreive. For example I need to obtain text from the title of a window and later use that in a path. For example I am using ControlGetText ( "title", "text", controlID ). How can I later access this information. I am going to send the following as a path. servernamefoldertext_obtained_from_Control_get_text Thank you for your help. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 30, 2013 Moderators Share Posted September 30, 2013 Create a variable, like so: $title = WinGetTitle("[CLASS:Notepad]", "") MsgBox(0, "", $title) And then use it in your path like so: \\servername\folder\" & $title "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
lazylivin Posted September 30, 2013 Author Share Posted September 30, 2013 Thank you very much for your help and so fast. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 30, 2013 Moderators Share Posted September 30, 2013 Glad to be of service. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
lazylivin Posted September 30, 2013 Author Share Posted September 30, 2013 One last question, the info I am trying to retreive is in the visible text. This is the information of the control in the summary. And here is script WinWaitActive("Database Login") $title = WinGetText("[CLASS:Static; INSTANCE:2]", "") MsgBox(0, "", $title) >>>> Window <<<< Title: Database Login Class: #32770 Position: 792, 430 Size: 336, 173 Style: 0x94C80AC4 ExStyle: 0x00010501 Handle: 0x00300708 >>>> Control <<<< Class: Static Instance: 2 ClassnameNN: Static2 Name: Advanced (Class): [CLASS:Static; INSTANCE:2] ID: 1624 Text: Optical Disk-749517 Position: 93, 20 Size: 219, 20 ControlClick Coords: 86, 13 Style: 0x50021280 ExStyle: 0x00020004 Handle: 0x0031074A >>>> Mouse <<<< Position: 974, 492 Cursor ID: 0 Color: 0x69679E >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Database title:Optical Disk-749517 &Password: OK Cancel &Help >>>> Hidden Text <<<< Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted September 30, 2013 Moderators Share Posted September 30, 2013 (edited) I apologize, your first post mentioned getting the title of the window, but your second looks more like you're trying to interact with a particular control. Is this text on a particular control (button, etc.), or just in the window? You should be able to still follow the suggestion of creating a variable using ControlGetText, if it is the latter. Edited September 30, 2013 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
lazylivin Posted September 30, 2013 Author Share Posted September 30, 2013 (edited) It is a static control. Grayed out box with a value. When I run the following script $title = ControlGetText ( "[CLASS:Static; INSTANCE:2]", "", "" ) MsgBox(0, "", $title) It comes back with the following message containg _acroT_win_9Plus I am not sure where it is getting this value from as it is not any text from that window. Here is the window, I am trying to get the value in the Database Title field and use that later in the path to export to. '> Thank you for helping me with this. Edited September 30, 2013 by lazylivin Link to comment Share on other sites More sharing options...
lazylivin Posted September 30, 2013 Author Share Posted September 30, 2013 Just wanted to let you know I got it. My goal was to export using a unique folder name so I don't overwrite what is there already. The Random Function worked well for me. So I used that as my solution. Thank you for your help as it led me to the solution. Link to comment Share on other sites More sharing options...
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