; Scanmaster EJ Exporter (1680x1050 Resolution) ; Must have Explorer open to c:\grocery and ScanMaster open to the EJ screen ; The Explorer Window must b ; -- USER VARIABLES -- ; $step = 13 ; 13px Gap between Available Dates. $top = 252-$step ; Top. (Y) $availX = 639 ; X Position for Available Date values. $transX = 890 ; X Pos for Transaction Ranges (Vertical Section for the letter 't'. $registers = 2 ; Maximum Number of Registers $startDate = '2007/11/20' ; Date YYYY/MM/DD to start from. ; -- PROGRAM -- ; #include Dim $splitDate Dim $splitTime $startDate = _DateAdd( 'd',-1, $startDate) ; Offset the date minus a day to fit in the FOR loop. For $i = 1 to 1 WinActivate("Electronic Journal Reports - NCR ScanMaster") $date = _DateAdd('d',1,$startDate) ; Add a day to the date variable. _DateTimeSplit($date,$splitDate,$splitTime) ; Send date to array $dateOut = $splitDate[1] & $splitDate[2] & $splitDate[3] & "_" For $j = 1 to $registers WinActivate("Electronic Journal Reports - NCR ScanMaster") MouseClick("left",$availX,$top+($i*$step)) ; Click the Available Date (Top to Bottom) ; Wait for the Transaction Range to be populated: While PixelGetColor($transX, $top+$step) = 16777215 sleep(1000) WEnd If PixelGetColor($transX, $top+($j*$step)) = 0 Then ; Check to see that there is an entry for that register. MouseClick("left",$transX,$top+($j*$step)) MouseClick("left",874,574) ; Generate Report While PixelGetColor(908,568) = 15526360 ; Wait for report to generate sleep(1000) WEnd MouseClick("left",582,679) ; Exit report Sleep(1000) WinActivate("Grocery") ; Toggle to Explorer Window Sleep(1000) Send ("{F5}") ; Refresh Sleep(500) Send ("{F2}") ; Rename Sleep(500) If($j < 10) Then Send ($dateOut & "00" & $j) Else Send ($dateOut & "0" & $j) EndIf Sleep(100) Send ("{ENTER}") EndIf Next Next