Misomaniac Posted November 20, 2017 Share Posted November 20, 2017 Hey everybody, can someone tell me please what is wrong in my Code? When i click "F1" my Script send "5" instead of my $Name. #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{F1}", "_Name") HotKeySet("{F2}", "_Age") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 331, 186, 228, 135) $Label1 = GUICtrlCreateLabel("Name", 0, 0, 42, 21, $SS_CENTERIMAGE) $Label2 = GUICtrlCreateLabel("Age", 0, 24, 42, 21, $SS_CENTERIMAGE) $Name = GUICtrlCreateInput("", 48, 0, 121, 21) $Age = GUICtrlCreateInput("", 48, 24, 121, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Name() Send ($Name) EndFunc Func _Age() Send ($Age) EndFunc Link to comment Share on other sites More sharing options...
Starf0x Posted November 20, 2017 Share Posted November 20, 2017 Hi, So if I look at the code, where do you want the name and age to appear? If it is in the input boxes, (eitherway) you should use different variables for the function key send. Cheers. Link to comment Share on other sites More sharing options...
Misomaniac Posted November 20, 2017 Author Share Posted November 20, 2017 The Name and Age is just a example. I just want to save Words or Numbers with the help of Inputboxes in a assigned Hotkey. The Text of the Variables should appear everywhere (Word,Exel,Paint,Facebook) Link to comment Share on other sites More sharing options...
JoHanatCent Posted November 20, 2017 Share Posted November 20, 2017 Use GUICtrlRead #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{F1}", "_Name") HotKeySet("{F2}", "_Age") #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 331, 186, 228, 135) $Label1 = GUICtrlCreateLabel("Name", 0, 0, 42, 21, $SS_CENTERIMAGE) $Label2 = GUICtrlCreateLabel("Age", 0, 24, 42, 21, $SS_CENTERIMAGE) $Inp1 = GUICtrlCreateInput("", 48, 0, 121, 21) $Inp2 = GUICtrlCreateInput("", 48, 24, 121, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch Sleep(9) WEnd Func _Name() $name = GUICtrlRead($Inp1) Send($name) EndFunc ;==>_Name Func _Age() $Age = GUICtrlRead($Inp2) Send($Age) EndFunc ;==>_Age Link to comment Share on other sites More sharing options...
Misomaniac Posted November 20, 2017 Author Share Posted November 20, 2017 Work. Thanks Link to comment Share on other sites More sharing options...
JoHanatCent Posted November 20, 2017 Share Posted November 20, 2017 It's a pleasure 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