jgq85 Posted July 11, 2014 Share Posted July 11, 2014 (edited) Hi I'm still kind of new here, I'm trying to figure out how to do the following with a script. Does anyone know which code/technique could be used for accomplishing this, because I cannot figure it out. 1. First check for all open Notepad windows and send text into each one - this one I can do by using the below and a ControlSend: #include <Array.au3> $List = WinList("[CLASS:Notepad]") For $item = 1 To ($List[0][0]) $Value = $List[$item][0] Next 2. However I want to be able to check for any NEW notepad documents that open with a new title and when it detects a new notepad file is open, it will do ControlSend to that one as well. Then continue to send text into each new Notepad file I open, without repeatedly sending the text to any open notepad windows I've already had it send text to Edited July 11, 2014 by jgq85 Link to comment Share on other sites More sharing options...
Shane0000 Posted July 12, 2014 Share Posted July 12, 2014 I would keep an array of processed files and refresh the list . if any new documents not in my processed array the file gets processed and added to the processed array list Link to comment Share on other sites More sharing options...
jgq85 Posted July 12, 2014 Author Share Posted July 12, 2014 Thanks. Well I'm trying to use the concept here and apply it to Instant Message windows in another program, so there would be no files. But I guess what you're saying is that you'd keep an array of open Windows, and any new windows introduced that aren't part of the existing array, will be dealt with then added into the existing array. right? Link to comment Share on other sites More sharing options...
kylomas Posted July 12, 2014 Share Posted July 12, 2014 (edited) Yes, however, I would use processlist and track them by PID. edit: It looks like you can monitor them by windows handle and use winlist if you prefer. Edited July 12, 2014 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill 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