Jump to content

Multi windows


Recommended Posts

I'm really really new to autoit, so please forgive me if I don't understand (or if this has been asked before).

 

I want to run 1 autoit program on 2 different windows of the same program. For example: I want to have autoit go to 2 different chrome windows and do 2 of the same task on it. (let's just say for examples sake, type "HELLO" in the address bar and press enter. I know how to type hello and press enter, but just not on 2 windows at the same time.

Also.
Would it be possible to run that program on 2 chrome windows, and do something else? Like open another chrome window (non automated) and surf the internet while the script runs. 

Thanks in advance! Let me know if you don't understand anything I asked!

Link to comment
Share on other sites

Since Autoit isn't multi thread you'd have to do one at a time, have one do one letter then the other do the same letter, or run two separate programs. Look at this for having two programs communicate with each other.

 

Ex. Program 1 sends to Program 2 to Activate Chrome, Wait for it to become active, Press F6 (highlights the address bar in all browsers I've tried), type a url, then press enter.

You'll have to get very specific with your tasks that you're trying to do and it would probably be best to send the programs a string that you can split. Storing the function name and parameters in each split section. Instead of calling the function directly in the script you can just use Call

Ex. Program 1 sends this string to program 2

WinActivate,[Class:MozillaWindowClass];WinWaitActive,[Class:MozillaWindowClass];Send,{F6};Sleep,200;Send,www.google.com;Sleep,200;Send,{Enter}

Split the string by the ; first gives me a set of instructions that are comma separated. Splitting each instruction by the , gives me the Function name and then the parameter(s) (only one parameter in each of my example but you can have as many parameters that are needed)

Link to comment
Share on other sites

Thankyou all! Much appreciated. That really helps!

 

1 more quick question. How can I make an autoit program only run in 1 window. For example. Have a program do something on chrome, while I can do something else in another program manually

Link to comment
Share on other sites

16 hours ago, InunoTaishou said:

You'll have to use non-intrusive functions, functions that don't interfere with the user.

Functions like ControlSend, ControlClick, ControlGetText

Thanks!

 

16 hours ago, JohnOne said:

Or a chrome udf

I was using chome as an example. I'm really not going to do anything with chrome, but thanks though!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...