Jump to content

Comparing Information


Recommended Posts

I apologize for having to go back and fourth. i know how hard it is to answer these questions with out being able to test it....

When the lot adjustment window is open there will either be two buttons or three buttons depending of that part numbers traits. If the window has two buttons then I will only need to update one piece of information. If the window has the third button then I will need to use that button. When I click on that third button a new window will open up. It is that window I will need to make my adjustment in and then close that window.

I have in my script now

ControlClick("Edit Lot", "Adjust inventory core value...", 2333, "left")
  
If WinExists("Adjust Inventory Core Value", "") Then
  WinActivate("Adjust Inventory Core Value", "")
  WinWaitActive("Adjust Inventory Core Value", "")
  ControlClick("Adjust Inventory Core Value", "Adjusted core value:", 2337, "left")
  ControlSend("Adjust Inventory Core Value", "Adjusted core value:", 2337, $aArray1[$c][2])
  ControlCommand("Adjust Inventory Core Value", "Reason for adjustment:", 2363, "ShowDropDown", "")
  ControlCommand("Adjust Inventory Core Value", "Reason for adjustment:", 2363, "SelectString", 'string')
  ControlCommand("Adjust Inventory Core Value", "Reason for adjustment:", 2363, "HideDropDown", "")
  Sleep(700)
  ControlClick("Adjust Inventory Core Value", "OK", "Button1", "left")
Else
  EndIf

when i run the script the first lot happens to have the third button so it opens the desired window. but it doesn't do anything with that window. It starts working with the window behind it.

No, I'm not a programer.Yes, I am a noob.You know what the difference is between you and me?I make this look good.

Link to comment
Share on other sites

After the ControlClick do a WinWait and then continue processing.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

my script as it stand right now

#include <File.au3>
#include <Array.au3>
#include <Excel.au3>
; opens excel workbook
;RESET THE WORKBOOK FOR YOUR FILE PATH AND NAME
Local $oExcel = _ExcelBookOpen("C:AutoIttest array.xls")
; reads data into array
$aArray1 = _ExcelReadSheetToArray($oExcel, 1, 1, 0, 4, True)
; closes the excel workbook
_ExcelBookClose($oExcel)
; displays the array that was read.
_ArrayDisplay($aArray1)
; counts the number of rows in the array
$rows = UBound($aArray1) - 1

For $c = 1 To $rows
WinActivate("CORRIDOR", "")
Send("{ALT}" & "T")
Send("{DOWN 3}")

Send("{ENTER}")
WinWaitActive("Current Parts in Inventory Search", "")
WinActivate("Current Parts in Inventory Search", "")
ControlCommand("Current Parts in Inventory Search", "", "SysTabControl323", "TabRight", "")


ControlSend("Current Parts in Inventory Search", "Lot number:", 1070, $aArray1[$c][0])
Send("{TAB}")
sleep(700)
;if corridor cant find the lot number
WinWait("Invalid Lot Number", "")
If WinExists("Invalid Lot Number", "Please search for the Lot Number you want.") Then
  WinActivate("Invalid Lot Number", "Please search for the Lot Number you want.")
  ControlClick("Invalid Lot Number", "OK", 2, "left")
  WinWaitActive("Current Parts in Inventory Search", "")
  ControlClick("Current Parts in Inventory Search", "Lot reference number:", 1300, "Left")
  ControlSend("Current Parts in Inventory Search", "Lot reference number:", 1300, $aArray1[$c][4])
  ControlClick("Current Parts in Inventory Search", "Scan", 1063, "left")
Else
EndIf

ControlClick("Current Parts in Inventory Search", "Lot reference number:", 1300, "left")
ControlClick("Current Parts in Inventory Search", "Less", 1947, "left")
ControlClick("Current Parts in Inventory Search", "Scan", 1063, "left")
Sleep(700)
ControlClick("Current Parts in Inventory Search", "", "SysListView322", "left")

ControlClick("Current Parts in Inventory Search", "Open", 1663, "Left")

WinWaitActive("Edit Lot", "")
WinActivate("Edit Lot", "")

$sControlText = ControlGetText("Edit Lot", "Lot number:", 1136)
While $sControlText <> $aArray1[$c][0]
  ControlClick("Edit Lot", "Close", "Button24", "left")
  ControlClick("Current Parts in Inventory Search", "", "SysListView322", "left")
  Send("{DOWN}")
  ControlClick("Current Parts in Inventory Search", "Open", 1663, "Left")
  WinWaitActive("Edit Lot", "")
  WinActivate("Edit Lot", "")
  $sControlText = ControlGetText("Edit Lot", "Lot number:", 1136)
WEnd
WinActivate("Edit Lot", "")
ControlCommand("Edit Lot", "", "SysTabControl321", "TabRight", "")
ControlCommand("Edit Lot", "", "SysTabControl321", "TabRight", "")
ControlClick("Edit Lot", "Adjust part cost...", 1514, "left")
WinWaitActive("Adjust Part Cost", "")
WinActivate("Adjust Part Cost", "")
ControlClick("Adjust Part Cost", "Adjusted cost:", 1535, "left")
ControlSend("Adjust Part Cost", "Adjusted cost:", 1535, $aArray1[$c][1])

ControlCommand("Adjust Part Cost", "Reason for adjustment:", 1536, "ShowDropDown", "")
ControlCommand("Adjust Part Cost", "Reason for adjustment:", 1536, "SelectString", 'Cost Adj: Correct Improper Process')
ControlCommand("Adjust Part Cost", "Reason for adjustment:", 1536, "HideDropDown", "")
Sleep(700)
ControlClick("Adjust Part Cost", "OK", "Button1", "left")
WinWait("Edit Lot", "")
WinActivate("Edit Lot", "")
WinWaitActive("Edit Lot", "")
ControlClick("Edit Lot", "Adjust inventory core value...", 2333, "left")

If WinExists("Adjust Inventory Core Value", "") Then
WinWait("Adjust Inventory Core Value", "")
  WinActivate("Adjust Inventory Core Value", "")
  WinWaitActive("Adjust Inventory Core Value", "")
  ControlClick("Adjust Inventory Core Value", "Adjusted core value:", 2337, "left")
  ControlSend("Adjust Inventory Core Value", "Adjusted core value:", 2337, $aArray1[$c][2])
  ControlCommand("Adjust Inventory Core Value", "Reason for adjustment:", 2363, "ShowDropDown", "")
  ControlCommand("Adjust Inventory Core Value", "Reason for adjustment:", 2363, "SelectString", 'Cost Adj: Correct Improper Process')
  ControlCommand("Adjust Inventory Core Value", "Reason for adjustment:", 2363, "HideDropDown", "")
  Sleep(700)
  ControlClick("Adjust Inventory Core Value", "OK", "Button1", "left")
Else
EndIf
ControlClick("Edit Lot", "Close", "Button24", "left")
WinWait("Current Parts in Inventory Search", "")
WinActivate("Current Parts in Inventory Search", "")
WinWaitActive("Current Parts in Inventory Search", "")
ControlClick("Current Parts in Inventory Search", "Close", "Button30", "left")
Next

The first issue is at line 39. before I wrote that in there i had the issue at line 103

No, I'm not a programer.Yes, I am a noob.You know what the difference is between you and me?I make this look good.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...