nick26897 Posted March 17, 2006 Share Posted March 17, 2006 I'm trying to create a GUI that allows a user to enter text into a text box then type the text they entered into an open program in Windows. Is that possible? Here is my current code. #include <GUIConstants.au3> GuiCreate("PRIDE", 200, 100) GuiCtrlCreateLabel("Enter 1st Named Insured:", 15, 10) $input1 = GUICtrlCreateInput ("", 10, 30, 175, 22) GUISetState() $okbutton = GUICtrlCreateButton ("OK", 40, 70, 50) $cancelbutton = GUICtrlCreateButton ( "Cancel", 100, 70, 50) ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton ExitLoop Case $msg = $okbutton GUICtrlRead($input1) GUIDelete() Sleep (2000) Run(GUICtrlRead($input1)) Exit EndSelect Wend GUIDelete() Exit Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 18, 2006 Moderators Share Posted March 18, 2006 #include <GUIConstants.au3> GuiCreate("PRIDE", 200, 100) GuiCtrlCreateLabel("Enter 1st Named Insured:", 15, 10) $input1 = GUICtrlCreateInput ("", 10, 30, 175, 22) $okbutton = GUICtrlCreateButton ("OK", 40, 70, 50) $cancelbutton = GUICtrlCreateButton ( "Cancel", 100, 70, 50) GUISetState(); moved this under the all controls being made ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton ExitLoop Case $msg = $okbutton $INPUT1DATA = GUICtrlRead($input1);<< You could store the input in a variable ;GUIDelete() << your deleteing the GUI so your run doesn't read anything because your trying to read a non-existing GUI Sleep (2000) ;Run($INPUT1DATA) ;ControlSend('WINDOW NAME', '', 'CONTROL ID', $INPUT1DATA) MsgBox(0, 'Testing Value', $INPUT1DATA) Exit EndSelect Wend GUIDelete() Exit 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 More sharing options...
seandisanti Posted March 18, 2006 Share Posted March 18, 2006 #include <GUIConstants.au3> GuiCreate("PRIDE", 200, 100) GuiCtrlCreateLabel("Enter 1st Named Insured:", 15, 10) $input1 = GUICtrlCreateInput ("", 10, 30, 175, 22) $okbutton = GUICtrlCreateButton ("OK", 40, 70, 50) $cancelbutton = GUICtrlCreateButton ( "Cancel", 100, 70, 50) GUISetState(); moved this under the all controls being made ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton ExitLoop Case $msg = $okbutton $INPUT1DATA = GUICtrlRead($input1);<< You could store the input in a variable ;GUIDelete() << your deleteing the GUI so your run doesn't read anything because your trying to read a non-existing GUI Sleep (2000) ;Run($INPUT1DATA) ;ControlSend('WINDOW NAME', '', 'CONTROL ID', $INPUT1DATA) MsgBox(0, 'Testing Value', $INPUT1DATA) Exit EndSelect Wend GUIDelete() Exitit looks like smoke beat me to this one, but forgot to welcome you to the forums. welcome aboard. Link to comment Share on other sites More sharing options...
nitekram Posted March 19, 2006 Share Posted March 19, 2006 it looks like smoke beat me to this one, but forgot to welcome you to the forums. welcome aboard.How about this one ? You have a input control that allows multiple lines - how to you use a button to capture the text into a variable?Thanks in advance - also thought it fit right with this post. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
nitekram Posted March 19, 2006 Share Posted March 19, 2006 (edited) How about this one ? You have a input control that allows multiple lines - how to you use a button to capture the text into a variable?Thanks in advance - also thought it fit right with this post.does this have anything to do with it - $BS_DEFPUSHBUTTON ?********editnevermind that will not workI need it to copy all text at time of button press, not on enter as this will - in my example - do a @cr Edited March 19, 2006 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
GaryFrost Posted March 19, 2006 Share Posted March 19, 2006 does this have anything to do with it - $BS_DEFPUSHBUTTON ?********editnevermind that will not workI need it to copy all text at time of button press, not on enter as this will - in my example - do a @cr The line in smoke's code does just that, if it's an edit control it should still get all the text $INPUT1DATA = GUICtrlRead($input1);<< You could store the input in a variable SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
nitekram Posted March 19, 2006 Share Posted March 19, 2006 The line in smoke's code does just that, if it's an edit control it should still get all the text $INPUT1DATA = GUICtrlRead($input1);<< You could store the input in a variableSorry, about that - I was using the wrong function.GUISetOnEvent($VAR, "function1") not the right commandGUICtrlSetOnEvent($VAR, "function1") - write commandI guess I copied the wrong part - it all works good now. I should of tested the button press - just to make sure it was doing something, which after further test showed. I then looked at the command and compared it with my older code and Hurray - I found it.Thanks for making me triple check - I guess third time is the charm.Again, thanks for your help, Iwas going crazy. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
nitekram Posted March 20, 2006 Share Posted March 20, 2006 (edited) Now that I am able to read the data - is there a way to post data? I have tried the following but it will stop and not go to the next line. Any ideas on how to make this happen - the field itself is able to send multiline data back to clipboard. Do I have to paste the data to clipboard first and then get it from there and then paste it to the textbox. GUICtrlSetData ( $GUI_TEXT_USER, "What is the persons first and last name?:::::" & @CR & "What customer and site is the person calling from?:::::" & @CR & "What is the customer stating is wrong?:::::") edit fixed grammar Edited March 20, 2006 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
nitekram Posted March 20, 2006 Share Posted March 20, 2006 (edited) Now that I am able to read the data - is there a way to post data? I have tried the following but it will stop and not go to the next line. Any ideas on how to make this happen - the field itself is able to send multiline data back to clipboard. Do I have to paste the data to clipboard first and then get it from there and then paste it to the textbox.GUICtrlSetData ( $GUI_TEXT_USER, "What is the persons first and last name?:::::" & @CR & "What customer and site is the person calling from?:::::" & @CR & "What is the customer stating is wrong?:::::")editfixed grammaredit 1Never mind I think I found it under - _GUICtrlEditReplaceSel - if I cannot get this I hope someone will still be able to help me.edit 2Well that does not look like it going to work either.edit 3found it this time - @CRLF - can you believe the time it takes me to find the things that you guys know like the back of your hand Edited March 20, 2006 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
seandisanti Posted March 20, 2006 Share Posted March 20, 2006 found it this time - @CRLF - can you believe the time it takes me to find the things that you guys know like the back of your handit takes time to learn anything new, man. just about everyone here started at the same place, and had to learn all the same stuff. you'll pick it up quickly i'm sure. Link to comment Share on other sites More sharing options...
nick26897 Posted March 21, 2006 Author Share Posted March 21, 2006 Thanks for your help Smoke! The script works great! 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