ihenvyr Posted August 29, 2009 Posted August 29, 2009 Hi all! the scenario is: when pressing "OK" it will automatically paste each numbers to a browser forms.. thank you.. expandcollapse popup;==================================================== ;================= Example of a GUI ================= ;==================================================== ; AutoIt version: 3.0.103 ; Language: English ; Author: "SlimShady" ; ; ---------------------------------------------------------------------------- ; Script Start ; ---------------------------------------------------------------------------- ;Include constants #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) _Main() Func _Main() ;Initialize variables Local $GUIWidth = 300, $GUIHeight = 250 Local $Edit_1, $OK_Btn, $Cancel_Btn, $msg #forceref $Edit_1 ;Create window GUICreate("New GUI", $GUIWidth, $GUIHeight) ;Create an edit box with no text in it $Edit_1 = GUICtrlCreateEdit("", 10, 10, 280, 190) ;Create an "OK" button $OK_Btn = GUICtrlCreateButton("OK", 75, 210, 70, 25) ;Create a "CANCEL" button $Cancel_Btn = GUICtrlCreateButton("Cancel", 165, 210, 70, 25) ;Show window/Make the window visible GUISetState(@SW_SHOW) ;Loop until: ;- user presses Esc ;- user presses Alt+F4 ;- user clicks the close button While 1 ;After every loop check if the user clicked something in the GUI window $msg = GUIGetMsg() Select ;Check if user clicked on the close button Case $msg = $GUI_EVENT_CLOSE ;Destroy the GUI including the controls GUIDelete() ;Exit the script Exit ;Check if user clicked on the "OK" button Case $msg = $OK_Btn MsgBox(64, "New GUI", "You clicked on the OK button!") ;Check if user clicked on the "CANCEL" button Case $msg = $Cancel_Btn MsgBox(64, "New GUI", "You clicked on the Cancel button!") EndSelect WEnd EndFunc ;==>_Main Umbrella Member
Manjish Posted August 31, 2009 Posted August 31, 2009 (edited) What browser form? IE browser or Windows Browser? To get individual numbers, your best bet is to use this: $number = StringSplit(StringReplace(Guictrlread($edit), @CR, ""), @LF) to paste it into an IE browser form, you can go with _IEFormElementSetValue() Edited August 31, 2009 by Manjish [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
ihenvyr Posted September 3, 2009 Author Posted September 3, 2009 (edited) What browser form? IE browser or Windows Browser? To get individual numbers, your best bet is to use this: $number = StringSplit(StringReplace(Guictrlread($edit), @CR, ""), @LF) to paste it into an IE browser form, you can go with _IEFormElementSetValue() Hi Manjish thank you I removed the OK/CANCEL button and i put those codes, hotkey has been set also to change the scenario a little bit. The problem is, i need to fill those forms with numbers only to the second column of the ieform.htm when i press INSERT Button. thanks again.. here's the edited code expandcollapse popup;Include constants #include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) HotKeySet("{INSERT}", "Paste") _IEFormElementSetValue() Func _IEFormElementSetValue() ;Initialize variables Local $GUIWidth = 300, $GUIHeight = 250 Local $Edit_1 Local $number = $Edit_1 ;Create window GUICreate("New GUI", $GUIWidth, $GUIHeight) ;Create an edit box with no text in it $Edit_1 = GUICtrlCreateEdit("", 10, 10, 280, 190) ;To get individual numbers, your best bet is to use this: $number = StringSplit(StringReplace(Guictrlread($Edit_1), @CR, ""), @LF) ;Show window/Make the window visible GUISetState(@SW_SHOW) While 1 sleep (100) WEnd EndFunc Func Paste() ;Send ( Exit 0 EndFuncieform.htm Edited September 5, 2009 by ihenvyr Umbrella Member
Manjish Posted September 9, 2009 Posted September 9, 2009 (edited) To paste those numbers, you can use _IEFormElementSetValue() Edited September 9, 2009 by Manjish [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
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