Reyzor Posted March 10, 2010 Share Posted March 10, 2010 Hello people,im trying to use copy paste from imput box. like that, if i do: ctrl+1 (he send what i wrote on inputbox) ctrl+2 (he send what i wrote on inputbox2) but i dont "Send" but Paste! can someone help me? im new on autoit,and i cannot do that =( Sorry my english and thanks for helping. expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=c:\documents and settings\reyzor\os meus documentos\form1.kxf GUICreate("Form1", 335, 217, 192, 120) $Nome = GUICtrlCreateLabel("NOME", 24, 24, 52, 17) $NIF = GUICtrlCreateLabel("NIF", 24, 56, 37, 17) $Servico = GUICtrlCreateLabel("SERVIÇO", 24, 88, 67, 17) $SIMCARD = GUICtrlCreateLabel("SIMCARD", 24, 120, 69, 17) $SimVDF = GUICtrlCreateLabel("SIMVDF", 24, 152, 60, 17) $Input1 = GUICtrlCreateInput("Input1", 104, 24, 193, 21) $Input2 = GUICtrlCreateInput("Input1", 104, 56, 193, 21) $Input3 = GUICtrlCreateInput("Input1", 104, 120, 193, 21) $Input4 = GUICtrlCreateInput("Input1", 104, 88, 193, 21) $Input5 = GUICtrlCreateInput("Input1", 103, 149, 193, 21) $Group1 = GUICtrlCreateGroup("Portabilidade", 0, 0, 329, 209) $NOVO = GUICtrlCreateButton("Novo", 104, 176, 57, 25, $WS_GROUP) ;$Button2 = GUICtrlCreateButton("Fechar", 248, 176, 49, 25, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $NOVO GUICtrlSetData($input1,"") GUICtrlSetData($input2,"") GUICtrlSetData($input3,"") GUICtrlSetData($input4,"") GUICtrlSetData($input5,"") EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 10, 2010 Moderators Share Posted March 10, 2010 Reyzor,You need some HotKeys that will react to Ctrl-1 and Ctrl-2: expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("^1", "_Send_1") HotKeySet("^2", "_Send_2") GUICreate("Form1", 335, 217, 192, 120) $Nome = GUICtrlCreateLabel("NOME", 24, 24, 52, 17) $NIF = GUICtrlCreateLabel("NIF", 24, 56, 37, 17) $Servico = GUICtrlCreateLabel("SERVIÇO", 24, 88, 67, 17) $SIMCARD = GUICtrlCreateLabel("SIMCARD", 24, 120, 69, 17) $SimVDF = GUICtrlCreateLabel("SIMVDF", 24, 152, 60, 17) $Input1 = GUICtrlCreateInput("Input1", 104, 24, 193, 21) $Input2 = GUICtrlCreateInput("Input2", 104, 56, 193, 21) $Input3 = GUICtrlCreateInput("Input3", 104, 120, 193, 21) $Input4 = GUICtrlCreateInput("Input4", 104, 88, 193, 21) $Input5 = GUICtrlCreateInput("Input5", 103, 149, 193, 21) $Group1 = GUICtrlCreateGroup("Portabilidade", 0, 0, 329, 209) $NOVO = GUICtrlCreateButton("Novo", 104, 176, 57, 25, $WS_GROUP) ;$Button2 = GUICtrlCreateButton("Fechar", 248, 176, 49, 25, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $NOVO GUICtrlSetData($Input1, "") GUICtrlSetData($Input2, "") GUICtrlSetData($Input3, "") GUICtrlSetData($Input4, "") GUICtrlSetData($Input5, "") EndSwitch WEnd Func _Send_1() ConsoleWrite(GUICtrlRead($Input1) & @CRLF) EndFunc Func _Send_2() ConsoleWrite(GUICtrlRead($Input2) & @CRLF) EndFuncAt the moment, the HotKeys just write to the SciTE console - you will need to use Send(GUICtrlRead($Input*)) in place of the ConsoleWrite lines. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Skruge Posted March 10, 2010 Share Posted March 10, 2010 (edited) At the moment, the HotKeys just write to the SciTE console - you will need to use Send(GUICtrlRead($Input*)) in place of the ConsoleWrite lines. M23 For example, this will paste the text while preserving the contents of the clipboard: Func _Send_1() Local $sData = ClipGet() ClipPut(GUICtrlRead($Input1)) Send("^v") ClipPut($sData) EndFunc Func _Send_2() Local $sData = ClipGet() ClipPut(GUICtrlRead($Input2)) Send("^v") ClipPut($sData) EndFunc @Edit: Had an extra autoit tag Edited March 10, 2010 by Skruge [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
Reyzor Posted March 10, 2010 Author Share Posted March 10, 2010 (edited) Reyzor, You need some HotKeys that will react to Ctrl-1 and Ctrl-2: expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("^1", "_Send_1") HotKeySet("^2", "_Send_2") GUICreate("Form1", 335, 217, 192, 120) $Nome = GUICtrlCreateLabel("NOME", 24, 24, 52, 17) $NIF = GUICtrlCreateLabel("NIF", 24, 56, 37, 17) $Servico = GUICtrlCreateLabel("SERVIÇO", 24, 88, 67, 17) $SIMCARD = GUICtrlCreateLabel("SIMCARD", 24, 120, 69, 17) $SimVDF = GUICtrlCreateLabel("SIMVDF", 24, 152, 60, 17) $Input1 = GUICtrlCreateInput("Input1", 104, 24, 193, 21) $Input2 = GUICtrlCreateInput("Input2", 104, 56, 193, 21) $Input3 = GUICtrlCreateInput("Input3", 104, 120, 193, 21) $Input4 = GUICtrlCreateInput("Input4", 104, 88, 193, 21) $Input5 = GUICtrlCreateInput("Input5", 103, 149, 193, 21) $Group1 = GUICtrlCreateGroup("Portabilidade", 0, 0, 329, 209) $NOVO = GUICtrlCreateButton("Novo", 104, 176, 57, 25, $WS_GROUP) ;$Button2 = GUICtrlCreateButton("Fechar", 248, 176, 49, 25, $WS_GROUP) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $NOVO GUICtrlSetData($Input1, "") GUICtrlSetData($Input2, "") GUICtrlSetData($Input3, "") GUICtrlSetData($Input4, "") GUICtrlSetData($Input5, "") EndSwitch WEnd Func _Send_1() ConsoleWrite(GUICtrlRead($Input1) & @CRLF) EndFunc Func _Send_2() ConsoleWrite(GUICtrlRead($Input2) & @CRLF) EndFunc At the moment, the HotKeys just write to the SciTE console - you will need to use Send(GUICtrlRead($Input*)) in place of the ConsoleWrite lines. M23 im trying to use: HotKeySet("{F4}", "conf123") Func conf123() Send(GUICtrlRead($Input1) & @CRLF) EndFunc and: HotKeySet("{F4}", "conf123") Func conf123() ConsoleWrite(GUICtrlRead($Input2) & @CRLF) EndFunc just for test and still not working..its hard programming =S thanks and im sorry if i dont understand. i need to change Local $sdata for another $example? Edited March 10, 2010 by Reyzor Link to comment Share on other sites More sharing options...
Minikori Posted March 10, 2010 Share Posted March 10, 2010 im trying to use:HotKeySet("{F4}", "conf123")Func conf123() Send(GUICtrlRead($Input1) & @CRLF)EndFuncand:HotKeySet("{F4}", "conf123")Func conf123() ConsoleWrite(GUICtrlRead($Input2) & @CRLF) EndFuncjust for test and still not working..its hard programming =Sthanks and im sorry if i dont understand.Are you running that as a test script by itself or in the main script?If it's a script by itself it's because the script is ending before the Hotkey is pressed, so add a sleeping loop in there. For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com Link to comment Share on other sites More sharing options...
Reyzor Posted March 10, 2010 Author Share Posted March 10, 2010 I just want use that for working in my job,but i think is a main script,i don´t know =S.. But i dont understand how i can do that, for copy(phrase inside inputbox) and paste in other document with a key.. Link to comment Share on other sites More sharing options...
Reyzor Posted March 11, 2010 Author Share Posted March 11, 2010 I still can´t do that =S .. Doesn´t work... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 11, 2010 Moderators Share Posted March 11, 2010 Reyzor,To what application are are you trying to Send the contents of the Inputs? If you let us know that, we can try and help a bit more. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Reyzor Posted March 15, 2010 Author Share Posted March 15, 2010 I want to paste what i wrote in imputbox in programs like excell,word,wordpad,Webpages and more. Example: Inputbox1 = abcde And using hotkey, when i click F2, he past the phrase(abcde) when i want and where i want in programs..But i want to past,not to send.. is possible? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 15, 2010 Moderators Share Posted March 15, 2010 Reyzor, This script will put the text in the input into whatever is active when you press F2. I have tested it with Word, Excel, IE and a few others: #include <GUIConstantsEx.au3> HotKeySet("{F2}", "Paster") $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("", 10, 10, 200, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func Paster() $sText = GUICtrlRead($hInput) Send($sText) EndFunc M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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