Sign in to follow this  
Followers 0
jgq85

Need help with WinList, Array and Variables

4 posts in this topic

#1 ·  Posted (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 by jgq85

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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? 

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 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

Share this post


Link to post
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
Sign in to follow this  
Followers 0