samtan117 Posted June 2, 2015 Posted June 2, 2015 i dont know how to describe it. what its meant todo is get teh text writen from gui input and put it into notepad++ but instead of doing that its just typing a 4. Here is the codeexpandcollapse popup#include <GUIConstantsEx.au3> _Main() Func _Main() Local $iGUIWidth = 300, $iGUIHeight = 250 Local $idEdit_1, $idOK_Btn, $idCancel_Btn, $iMsg #forceref $idEdit_1 GUICreate("McNews Article Creator", $iGUIWidth, $iGUIHeight) $idTitle_Label = GUICtrlCreateLabel("Title", 8, 10) $idEdit_1 = GUICtrlCreateInput("", 5, 25, 290, 25) $idMain_Text = GUICtrlCreateLabel ("Text", 8, 55) $idEdit_2 = GUICtrlCreateEdit ("", 5, 75, 290, 125) $idCreate_Btn = GUICtrlCreateButton("Create", 75, 210, 70, 25) $idUndo_Btn = GUICtrlCreateButton("AI Editor", 165, 210, 70, 25) GUISetState(@SW_SHOW) While 1 $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $iMsg = $idCreate_Btn MsgBox(64, "McNews", "Creating") Run(@ProgramFilesDir & '\Notepad++\notepad++.exe "C:\Users\samtan117\Desktop\Article"') WinWaitActive("[CLASS:Notepad++]") Send("{up}") Send("{up}") Send("{up}") Send("{up}") Sleep(200) Send("" & $idEdit_1) Case $iMsg = $idUndo_Btn ;MsgBox(64, "New GU", "You clicked on the Cancel button!") EndSelect WEnd EndFunc
Moderators JLogan3o13 Posted June 2, 2015 Moderators Posted June 2, 2015 I believe you mean to send GUICtrlRead($idEdit_1). "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!
samtan117 Posted June 2, 2015 Author Posted June 2, 2015 I believe you mean to send GUICtrlRead($idEdit_1).no... this doesnt seem to work. am i doing it wrong?GUICtrlRead($idEdit_1) Case $iMsg = $idUndo_Btn ;MsgBox(64, "New GU", "You clicked on the Cancel button!") EndSelect WEnd EndFuncdo i need to use a send command to it someway?
Developers Jos Posted June 2, 2015 Developers Posted June 2, 2015 (edited) Send(GuiRead($idEdit_1))You need to read the control in stead of sending its handle!Jos Edited June 2, 2015 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Moderators JLogan3o13 Posted June 2, 2015 Moderators Posted June 2, 2015 "doesn't work" doesn't help us much. This works just fine for me:expandcollapse popup#include <GUIConstantsEx.au3> _Main() Func _Main() Local $iGUIWidth = 300, $iGUIHeight = 250 Local $idEdit_1, $idOK_Btn, $idCancel_Btn, $iMsg #forceref $idEdit_1 GUICreate("McNews Article Creator", $iGUIWidth, $iGUIHeight) $idTitle_Label = GUICtrlCreateLabel("Title", 8, 10) $idEdit_1 = GUICtrlCreateInput("", 5, 25, 290, 25) $idMain_Text = GUICtrlCreateLabel ("Text", 8, 55) $idEdit_2 = GUICtrlCreateEdit ("", 5, 75, 290, 125) $idCreate_Btn = GUICtrlCreateButton("Create", 75, 210, 70, 25) $idUndo_Btn = GUICtrlCreateButton("AI Editor", 165, 210, 70, 25) GUISetState(@SW_SHOW) While 1 $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $iMsg = $idCreate_Btn MsgBox(64, "McNews", "Creating") Run(@ProgramFilesDir & '\Notepad++\notepad++.exe "C:\Users\samtan117\Desktop\Article"') WinWaitActive("[CLASS:Notepad++]") Send("{up}") Send("{up}") Send("{up}") Send("{up}") Sleep(200) Send("" & GUICtrlRead($idEdit_1)) Case $iMsg = $idUndo_Btn ;MsgBox(64, "New GU", "You clicked on the Cancel button!") EndSelect WEnd EndFunc "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!
samtan117 Posted June 2, 2015 Author Posted June 2, 2015 "doesn't work" doesn't help us much. This works just fine for me:expandcollapse popup#include <GUIConstantsEx.au3> _Main() Func _Main() Local $iGUIWidth = 300, $iGUIHeight = 250 Local $idEdit_1, $idOK_Btn, $idCancel_Btn, $iMsg #forceref $idEdit_1 GUICreate("McNews Article Creator", $iGUIWidth, $iGUIHeight) $idTitle_Label = GUICtrlCreateLabel("Title", 8, 10) $idEdit_1 = GUICtrlCreateInput("", 5, 25, 290, 25) $idMain_Text = GUICtrlCreateLabel ("Text", 8, 55) $idEdit_2 = GUICtrlCreateEdit ("", 5, 75, 290, 125) $idCreate_Btn = GUICtrlCreateButton("Create", 75, 210, 70, 25) $idUndo_Btn = GUICtrlCreateButton("AI Editor", 165, 210, 70, 25) GUISetState(@SW_SHOW) While 1 $iMsg = GUIGetMsg() Select Case $iMsg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $iMsg = $idCreate_Btn MsgBox(64, "McNews", "Creating") Run(@ProgramFilesDir & '\Notepad++\notepad++.exe "C:\Users\samtan117\Desktop\Article"') WinWaitActive("[CLASS:Notepad++]") Send("{up}") Send("{up}") Send("{up}") Send("{up}") Sleep(200) Send("" & GUICtrlRead($idEdit_1)) Case $iMsg = $idUndo_Btn ;MsgBox(64, "New GU", "You clicked on the Cancel button!") EndSelect WEnd EndFunc ahh perfect thankyou i types it as send("" GUICtrlRead($idEdit_1))
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