pezo89 Posted February 8, 2010 Share Posted February 8, 2010 expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> #Include <Date.au3> $sDate = _NowDate() Opt('MustDeclareVars', 1) Global $Paused sleep ("1000") HotKeySet("{Insert}", "TogglePause") ToolTip ("Insert-Outlooksend",0,10,"outlooksend") ; example 1 Example() Func Example() Local $Input1, $Input2, $Button_1, GUICreate("Test",400,100,-1,-1,-1) ; will create a dialog box that when displayed is centered GUISetState(@SW_SHOW) ; will display an empty dialog box $Input1 = GUICtrlCreateInput("",80,-1,-1,-1,-1,"m2") $Input2 = GUICtrlCreateInput("",80,25,-1,-1,-1,"m2") $Button_1 = GUICtrlCreateButton("Send", 80,45,80,-1) GUICtrlCreateLabel("Epostadresse = ", 0,0);<--Label GUICtrlCreateLabel("Stillingstype=", 0,25);<--Label send ("{Insert}") ;;Scriptet _--------[b]Button starts from here, [/b] WinActivate ("Inbox in pezo89@hotmail.com - Microsoft Outlook") WinWaitActive ("Inbox in pezo89@hotmail.com - Microsoft Outlook") Opt("MouseClickDelay", 400) ;10 milliseconds Opt("MouseClickDownDelay", 400) ;10 milliseconds Opt("MouseClickDragDelay", 250) ;250 milliseconds Opt("SendKeyDelay", 5) ;5 milliseconds Opt("SendKeyDownDelay", 5) ;1 millisecond sleep (1000) send ("^{n}") sleep (1000) send ($Input1) sleep (1000) send ("{Tab 2}") sleep (1000) Send ("Sender herved en søknad på den utlyste stillingen hos dere som") Send ($Input2) sleep (1000) send ("{tab}") send ("xxNicolai xx") send ("{Enter}") send ("xx7") send ("{Enter}") send ("xxOslo") send ("{Enter}") send ("Tlf: xxxx") send ("{Enter}") send ($sDate) send ("{Enter}") send ("{Enter}") send ("{Enter}") send ("Jeg viser til annonsen på xxx.no den ") send ($sdate) send (" og søker med dette den ledige stillingen som xxx hos dere.") send ("{Enter}") send ("{Enter}") send ("Stillingen er interessant for meg av flere grunner.") send ("{Enter}") send ("{Enter}") send ("• jeg liker å være i kontakt med mennesker og er en serviceminded person") send ("{Enter}") send ("• ønsker å jobbe i et effektivt og godt arbeidsmiljø, noe jeg tror dere har muligheten til å kunne gi. ") send ("{Enter}") send ("• Jeg trives dessuten godt både i teamarbeid og i selvstendig arbeid noe som denne jobben innebærer") send ("{Enter}") send ("• Og jeg ønsker å utdype min jobberfaring innen dette yrkesområdet.") send ("{Enter}") send ("{Enter}") send ("{Enter}") send ("Litt om meg;") send ("{Enter}") send ("Jeg er en mann på xxx år, bosatt i xxx per dags dato, hvor jeg er elev på xxx Privatist Gymnasium der jeg tar opp xxxfag for å tilegne meg kompetanse for et videre bachelor studium innenfor Informatikk ") send ("{Enter}") send ("{Enter}") send ("xxxxx") send ("{Enter}") send ("Som person er jeg en utadvendt og energisk godt voksen person, kan vell også se på meg selv som en idèskapende person, og gir 110% for jobben, ") send ("{Enter}") send ("{Enter}") send ("Vil også legge ved at jeg er også en person som setter mål i henhold til jobben, det å lære nye ting, bedre kompetansen min, og bli flinkere innenfor det området jobben er fokusert rundt. .") send ("{Enter}") send ("{Enter}") send ("Jeg jobber for tiden som kundekonsulent / driftsentermedarbeider hos x.as") send ("{Enter}") send ("{Enter}") send (" Vil også legge ved at til tross for ordinær 1 måned oppsigelsestid kan jeg gå ifra stillingen på en ukes varsel. ") send ("{Enter}") send ("{Enter}") send ("Men grunnet et ønske om personlig videreutvikling innenfor et nytt område og uaktuelle arbeidstider ser jeg herved med dette etter en ny stilling og søker med dette på deres utlyste stilling") send ("{Enter}") send ("{Enter}") send ("Håper at min søknad er av interesse og stiller gjerne til intervju om ønskelig") send ("{Enter}") send ("{Enter}") send ("Kan kontaktes på telefon xx-xx-xx.") send ("{Enter}") send ("{Enter}") send ("Med vennlig hilsen ") send ("{Enter}") send ("xxxx") send ("{Enter}") send ("{Enter}") send ("{Enter}") send (" VedLegg:") send ("{Enter}") send (" -Cv") send ("{Enter}") send ("-Attest ifra xxx.AS") send ("{Enter}") sleep (1000) MouseClick ("left", 547,77,1,10) sleep (1000) mouseclick ("Left", 324,41,1,15) sleep (1000) send ("C:\Users\xxxx") sleep (1000) send ("{Enter}") sleep (1000) MouseClickDrag ("Left", 171,119,432,155,10) sleep (1000) send ("{enter}") send ("{Pause}") ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd EndFunc ;==>Example Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ;toolTip('Script - "Scriptet er - AV"',0, 40) WEnd ToolTip("") EndFuncHi there, what exactly am i missin in this script? when running it, the inputfields gives only 3, i assume thats and error and the button, how can i have it wait until fields are inputed, and button is pushed. ps removed some sensitive information, reson somthing is gone Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 8, 2010 Moderators Share Posted February 8, 2010 pezo89, the inputfields gives only 3This line: Send($Input2) sends the ControlID of the input control - which happens to be 3. You need: Send(GUICtrlRead($Input2)) and the button, how can i have it wait until fields are inputed, and button is pushedYou need to look for the button in your GetMessage loop like this: While 1 Switch GUIGetMsg() Case$GUI_EVENT_CLOSE ExitLoop Case $Button_1 Button_Function() EndSwitch WEnd Then you need to put all your code for what happens when you press the button into a function called Button_Function. If you want to check the inputs have something in them, you start that function like this: Func Button_Function() If GUICtrlRead($Input1) = "" And GUICtrlRead($Input2) = "" Then MsgBox(0, "Error", "Please input the data") Return Else ; All the code you want to run when the button is pressed EndIf EndFunc I hope that helps. 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...
Valuater Posted February 8, 2010 Share Posted February 8, 2010 This thread is missing a "thanks" from the OP! Nice explanation Melba... 8) Link to comment Share on other sites More sharing options...
pezo89 Posted February 12, 2010 Author Share Posted February 12, 2010 This thread is missing a "thanks" from the OP!Nice explanation Melba... 8)Hehe, Sorry, forgot Thanks alot, love you all who helps around here, hopefully, one day i can return the favor 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