Sign in to follow this  
Followers 0
AndrewW

Run AutoIt Script on Background Window

3 posts in this topic

I have a repetitive task I am trying to automate. I have to send text to a particular window and repeat this process hundreds of times. As far as I know, the AutoIt script only works on the active window. So, if I happen to click another window while the script is running, the current active window starts receiving the text. I would like to tell the AutoIt script to only run on 'WindowA', so that I can go off and do my other work/e-mail, while the AutoIt script is running on 'WindowA' in the background. Can AutoIt run on background windows, while I work on other foreground active windows?

Thanks for any help you can provide.

Andrew W

Share this post


Link to post
Share on other sites



Thanks for your reply Uten.

I tried what you suggested but it does not appear to work. Here's the script I am running:

HotKeySet("^+x", "MyExit")

AutoItSetOption("SendKeyDelay",10)

Sleep(1000)

WinActivate("Marsha Production - B", "")

For $i = 1 to 20 Step 1

Sleep(300)

ControlSend("Marsha Production - B", "", "", "QR{Enter}")

Next

Sleep(300)

Send("****** DONE *****")

Exit

Func MyExit()

Exit

EndFunc

I am trying to send "QR{Enter}" to the "Marsha Production - B" window, many times. With the above script, if the "Marsha Production - B" window has focus, the script works fine. As soon as another window gets focus, the "QR{Enter}" text stops being sent to the "Marsha Production - B" window. Note that the text does not appear on the newly focused window either...

Any thoughts ?

Thanks for your help.

Andrew W

ControlSend, ControlClick is (normally) your friend..:)

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