B540glenn Posted March 30, 2014 Share Posted March 30, 2014 (edited) We have an account management system. I have to change about 20,000 accounts from History to Active. I have a process that works for a small number of records, 50 records or less. The current process is: expandcollapse popup... While $readstat = 0 $Account = $line_text MouseClick("Left",60,480,1,0) Send($Account) Send("{ENTER}") Sleep($SleepM) ; Check for Error Message on Account $x = WinExists("Retrieve Error") If $x Then ;ConsoleWrite("there was a retreive Error - " & $Account & @lf) $writestat = FileWriteLine($File2Handle, "Account Err|" & $line_text & @CRLF) if $writestat <> 1 then MsgBox(0, "Error", "Unable to write to output file. " & $file2 & $File2Handle & $writestat) EndIf Send("{ENTER}") Sleep($SleepL) MouseClick("Left",60,480,1,0) Else ;ConsoleWrite("going to the Update - " & $Account & @lf) Send("{ENTER}") Sleep($SleepL) ;ConsoleWrite("sending B - " & $Account & @lf) Send("B") Sleep($SleepS) $x = WinExists("Visit Maintenance") If $x Then ;ConsoleWrite("Visit maint exists pressing Y - " & $Account & @lf) Send("Y") Sleep($SleepS) Endif EndIf Sleep($SleepS) $line_text = FileReadLine($File1Handle) $readstat = @error WEnd ... I am using Sleep() to wait for the screen to change from Inquiry to Maintenance then back to Inquiry. With all the sleep statements it may take 6 to 8 seconds per account, depending on the system response time. For a small set of records this is fine. For my 20,000 accounts it's unacceptable. I'd like to change the way I wait for the screen to change and eliminate the Sleep() statements. I used the window info tool to get the info for the Inquiry and Maintenance screens. The results are identical: Title: Account Management Current User: GLENN - \\Remote Class: Transparent Windows Client Position: -4, -4 Size: 1288, 968 Style: 0x960F0000 ExStyle: 0x00000104 Handle: 0x0014043C There is no data for Controls, StatusBar, ToolsBar, Visible Text nor Hidden Text. The colors are also identical. I've downloaded and tried a few scripts that show all current handles but there is no change in the lists when the Inquiry or Maintenance screens are active. How can I determine when the screen changes to and from Inquiry to Maintenance? Thanks for any help, Glenn Edited March 30, 2014 by B540glenn Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 30, 2014 Moderators Share Posted March 30, 2014 B540glenn,Something must change between the Inquiry or Maintenance screens - how do you know which is active? 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...
JohnOne Posted March 30, 2014 Share Posted March 30, 2014 WinWait WinActive WinActivate WinWaitActive AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
B540glenn Posted March 30, 2014 Author Share Posted March 30, 2014 B540glenn, Something must change between the Inquiry or Maintenance screens - how do you know which is active? M23 Of course, the fields change on the screen. I can see that, but the Window Info tool doesn't. The Window Info tool displays the same title, class, handle, etc. in both the Inquiry and Maintenance screens. It reports no info for controls. It reports no text. What can I inspect via the autoit functions to detect the change? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 30, 2014 Moderators Share Posted March 30, 2014 B540glenn, Of course, the fields change on the screenSo you should be able to use PixelChecksum to detect the window changing. If you could post a couple of screenshots we could easily see which section of the GUI you should look at. 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...
B540glenn Posted March 30, 2014 Author Share Posted March 30, 2014 WinWait WinActive WinActivate WinWaitActive Wait for what? I'm not leaving the application so isn't $Title always active? If I'm in the Inquiry screen $Title is active. If I'm in Maintenance, $Title is active. Sorry if I'm not catching on. Glenn Link to comment Share on other sites More sharing options...
B540glenn Posted March 30, 2014 Author Share Posted March 30, 2014 B540glenn, So you should be able to use PixelChecksum to detect the window changing. If you could post a couple of screenshots we could easily see which section of the GUI you should look at. M23 Yes, of course, the colours for parts of the screens change. Thanks for the subtle "shove" in the right direction. I appreciate your help. Thank you, Glenn Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 30, 2014 Moderators Share Posted March 30, 2014 B540glenn,the colours for parts of the screens changeThen PixelGetColor is probbaly all you need. Come back if you run into any problems. 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...
B540glenn Posted March 31, 2014 Author Share Posted March 31, 2014 ...Then PixelGetColor is probbaly all you need. ...PixelGetColor did the trick. Now there is no sleep time waiting for the screen changes. This change will possibly save 20% off the run time. Thanks again, Glenn Link to comment Share on other sites More sharing options...
GrinReaper Posted March 31, 2014 Share Posted March 31, 2014 Just to go the silly route...and I am curious. I would assume you don't have the Windows Info Tool set to freeze thus giving you the same information for both instances. Glad you found a solution! [u]Forum Rules[/u] Follow the rules or be b*t**slapped into next week. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 31, 2014 Moderators Share Posted March 31, 2014 B540glenn,Glad to hear you got it sorted. 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...
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