Jump to content
Sign in to follow this  
MacScript

Send Keys/commands to window that is not active

Recommended Posts

MacScript

Is there a way to send keystrokes to an application that has not been brought to the forefront using WinActivate or some other command?

I have anywhere from 2->12 applications open at the same time and need to send keystrokes and mouse commands to them on a regular basis when an event occurs.  When I do the winactive it takes about 2.5 seconds to make each application active (older computer). So was hoping to see if there was a way to send stuff to it while it is in background/minimized?

 

Thanks in advance

Share this post


Link to post
Share on other sites
JLogan3o13

You would want to look at the Control commands, such as ControlSend. Once you target the window, you can send commands to it whether it is active or not. Check out ControlSend in the help file for a pretty good example on usage.

You'll need to use the AutoIt Window Info tool (in the same directory where you installed AutoIt) to find the contents of the window, and then you can use the control commands to send commands directly to the window.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
MacScript

Thanks, will try it out.

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  

×