Jump to content

reh1996

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by reh1996

  1. Hi all, Thanks for your great responses. I have actually managed to get this working. I have no idea how, I just ended up on a tangent from one of the suggestions and went from there. Any way, here is my finished code. Global $totalshipments = StatusbarGetText ("UPS WorldShip - Administrative Workstation", "", 4) Global $totalshipments2 = ("0 total shpmt(s) Collection Rec: 0 00 0") Global $totalshipments4 = BinaryToString ( $totalshipments) if WinExists ("XML Auto Import", "") Then ControlClick ("XML Auto Import", "", "[ID:17329]") ControlClick ("UPS WorldShip", "", "[ID:6]") ControlClick ("XML Auto Import", "", "[ID:15079]") WinSetState("UPS WorldShip - Administrative Workstation", "", @SW_RESTORE) WinActivate("UPS WorldShip - Administrative Workstation", "") sleep(2000) Send("{F3}") sleep(10000) send("{F11}") sleep(2000) Do Sleep(1000) until WinExists ("End of Day Processing", "You have shipments in your Remote, Deferred, Imported or In Error list. Would you like to cancel End of Day and process the shipments first?") ControlClick ("End of Day Processing", "", "[CLASSNN:Button2]", "left", 1) Do Sleep(1000) until WinExists ("End of Day Processing", "Are you ready to close today's shipping and send the shipment information to UPS?") ControlClick ("End of Day Processing", "Are you ready to close today's shipping and send the shipment information to UPS?", "[CLASSNN:Button1]", "left", 1) Else WinMinimizeAll () WinSetState("UPS WorldShip - Administrative Workstation", "", @SW_RESTORE) WinActivate("UPS WorldShip - Administrative Workstation", "") sleep(2000) Send("{F3}") sleep(10000) send("{F11}") sleep(2000) Do Sleep(1000) until WinExists ("End of Day Processing", "You have shipments in your Remote, Deferred, Imported or In Error list. Would you like to cancel End of Day and process the shipments first?") ControlClick ("End of Day Processing", "", "[CLASSNN:Button2]", "left", 1) Sleep(2000) Do Sleep(1000) until WinExists ("End of Day Processing", "Are you ready to close today's shipping and send the shipment information to UPS?") ControlClick ("End of Day Processing", "Are you ready to close today's shipping and send the shipment information to UPS?", "[CLASSNN:Button1]", "left", 1) EndIf Sleep (120000) Send ("{F2}") Sleep (10000) Send ("{F3}") Sleep (10000) if $totalshipments4 == $totalshipments2 Then Exit Else ShellExecuteWait("UPS EOD.msg", "", "Q:\mezzanine\Desktop\AutoIT tools\", "", @SW_MAXIMIZE) Sleep(2000) ControlClick ("UPS EOD - Message (HTML) ", "", 4256, "left", 1) Sleep(2000) EndIf Exit Thank you all for your help
  2. Just a quick one. What language does StatusBarGetText return in (I.E. Binary...) Thanks.
  3. the contents for both should be 0 total shpmt(s) Collection Rec: 0 00 0. this was copied from the AutoIT window info tool to avoid any mismatches. $totalshipments should return that little bit of text however to check that it is correct i need to compare it to $totalshipments2
  4. Hi. Jaberwacky: the output for $totalshipments should be the same as the text stated in $totalshipments2. hence why i have done == computergroove: both $totalshipments and $totalshipments2 should match after the beginning of the code is finished. here is the full code for both of you, you may be able to help better if you see the whole thing. Global $totalshipments = StatusbarGetText ("UPS WorldShip - Administrative Workstation", "", 4) Global $totalshipments2 = ("0 total shpmt(s) Collection Rec: 0 00 0") if WinExists ("XML Auto Import", "") Then ControlClick ("XML Auto Import", "", "[ID:17329]") ControlClick ("UPS WorldShip", "", "[ID:6]") ControlClick ("XML Auto Import", "", "[ID:15079]") WinSetState("UPS WorldShip - Administrative Workstation", "", @SW_RESTORE) WinActivate("UPS WorldShip - Administrative Workstation", "") sleep(2000) Send("{F3}") sleep(10000) send("{F11}") sleep(2000) Do Sleep(1000) until WinExists ("End of Day Processing", "You have shipments in your Remote, Deferred, Imported or In Error list. Would you like to cancel End of Day and process the shipments first?") ControlClick ("End of Day Processing", "", "[CLASSNN:Button2]", "left", 1) Do Sleep(1000) until WinExists ("End of Day Processing", "Are you ready to close today's shipping and send the shipment information to UPS?") ControlClick ("End of Day Processing", "Are you ready to close today's shipping and send the shipment information to UPS?", "[CLASSNN:Button1]", "left", 1) Else WinMinimizeAll () WinSetState("UPS WorldShip - Administrative Workstation", "", @SW_RESTORE) WinActivate("UPS WorldShip - Administrative Workstation", "") sleep(2000) Send("{F3}") sleep(10000) send("{F11}") sleep(2000) Do Sleep(1000) until WinExists ("End of Day Processing", "You have shipments in your Remote, Deferred, Imported or In Error list. Would you like to cancel End of Day and process the shipments first?") ControlClick ("End of Day Processing", "", "[CLASSNN:Button2]", "left", 1) Sleep(2000) Do Sleep(1000) until WinExists ("End of Day Processing", "Are you ready to close today's shipping and send the shipment information to UPS?") ControlClick ("End of Day Processing", "Are you ready to close today's shipping and send the shipment information to UPS?", "[CLASSNN:Button1]", "left", 1) EndIf Sleep (120000) Send ("{F2}") Sleep (10000) Send ("{F3}") Sleep (10000) if $totalshipments == $totalshipments2 Then Exit Else ShellExecuteWait("UPS EOD.msg", "", "Q:\mezzanine\Desktop\AutoIT tools\", "", @SW_MAXIMIZE) Sleep(2000) ControlClick ("UPS EOD - Message (HTML) ", "", 4256, "left", 1) Sleep(2000) EndIf Exit
  5. Hi all, First of all apologies for my lack of knowledge, I am rather new to AutoIT and so I am still learning. I am trying to set up a program for work however I seem to be having some trouble. I am basically setting up 2 Global statements, 1 is StatusBarGetText ("window", "", Status bar field) and the other is just plain text. Global $totalshipments = StatusbarGetText ("UPS WorldShip - Administrative Workstation", "", 4) Global $totalshipments2 = ("0 total shpmt(s) Collection Rec: 0 00 0") I am then doing the below. Sleep (120000) Send ("{F2}") Sleep (10000) Send ("{F3}") Sleep (10000) if $totalshipments == $totalshipments2 Then Exit Else ShellExecuteWait("UPS EOD.msg", "", "Q:\mezzanine\Desktop\AutoIT tools\", "", @SW_MAXIMIZE) Sleep(2000) ControlClick ("UPS EOD - Message (HTML) ", "", 4256, "left", 1) Sleep(2000) EndIf Exit So basically it detects if a manifest has been produced. If it has then it should exit the script, if it hasn't then it will send an email to someone stating the manifest has not been produced and needs to be done. I am not getting any errors however the email is being sent even though the manifest has been produced. Can someone help ? Thanks, -R
×
×
  • Create New...