AndrewW Posted October 17, 2007 Share Posted October 17, 2007 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 Link to comment Share on other sites More sharing options...
Uten Posted October 17, 2007 Share Posted October 17, 2007 ControlSend, ControlClick is (normally) your friend.. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
AndrewW Posted October 17, 2007 Author Share Posted October 17, 2007 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}")NextSleep(300)Send("****** DONE *****") ExitFunc 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.. 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