ponchato Posted March 10, 2010 Share Posted March 10, 2010 (edited) Is there a way for AutoIt to check if certain text is in a command prompt window, or (possibly a better option) check the lowest line on a command prompt window? I'd rather not just use the sleep function and hope that it waits long enough for each process to finish. Edited March 10, 2010 by ponchato Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 10, 2010 Moderators Share Posted March 10, 2010 ponchato,Look up StdoutRead in the Help file. It lets you read the contents of the Command prompt - so you can wait until you get your required text. 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...
PhilHibbs Posted March 10, 2010 Share Posted March 10, 2010 ponchato,Look up StdoutRead in the Help file. It lets you read the contents of the Command prompt - so you can wait until you get your required text. M23AIUI, it doesn't really read the contents of a Command Prompt window, it captures the output of a process and prevents it from appearing in a Command Prompt. And you have to run the process with a specific capture flag, so it can't work on existing Command Prompts. Am I right? I could never get it to work, though, so I may be mistaken. Link to comment Share on other sites More sharing options...
doudou Posted March 10, 2010 Share Posted March 10, 2010 AIUI, it doesn't really read the contents of a Command Prompt window, it captures the output of a process and prevents it from appearing in a Command Prompt. And you have to run the process with a specific capture flag, so it can't work on existing Command Prompts. Am I right? I could never get it to work, though, so I may be mistaken.You are right: you cannot capture text buffer from Command Prompt window (at least not with standard Windows API) because cmd paints text directly on its virtual screen, thus for the rest of the OS it's just a bitmap.But I think the OP didn't mean it that way, so the reply from Melba23 is adequate. UDFS & Apps: Spoiler DDEML.au3 - DDE Client + ServerLocalization.au3 - localize your scriptsTLI.au3 - type information on COM objects (TLBINF emulation)TLBAutoEnum.au3 - auto-import of COM constants (enums)AU3Automation - export AU3 scripts via COM interfacesTypeLibInspector - OleView was yesterday Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 10, 2010 Moderators Share Posted March 10, 2010 doudou,the reply from Melba23 is adequateThank you for the vote of confidence! PhilHibbs,I agree I could have gone into more detail, but given the (assumed) relative inexperience of the OP and the implied requirement to check for the end of running processes, I went for simplicity - KISS. I am sorry to hear you cannot get Stdoutread to work - I have used it successfully many times. Can you get the Helpfile example to run?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