Hi
I've been searching for help in my case for quite a long time now and can't really find what I'm trying to do.
I'm operating in one app and need to do something in other on different screen by clicking a specific mouse button.
I need a script that would do as follow:
1. take the cursor to another screen, different app (chrome window)
2. click the text window, type "a", then press "enter"
3. go back to the cursor's original location
I've been struggling with numerous issues like:
- the other window couldn't be activated
- cursor is ending up in totally weird position instead of getting back
- clicking on the desktop and launching first a-named file that is there
EDIT: ControlClick works for me but not in case of switching between programs I operate with.
help in creating script
Re: help in creating script
I'm trying different commands but the mouse just wont get focus from the program I use to other locations.
Re: help in creating script
Nobody knows what should I do or am I just making some kind of faux pas here. Sorry, my first thread there and Im a total noob in case of AHK.
Re: help in creating script
Code: Select all
#NoEnv
#SingleInstance Force
SendMode Input
SetBatchLines -1
SetTitleMatchMode 2
CoordMode Mouse, Screen
X_TARGET := 100
Y_TARGET := 100
q::
MouseGetPos xStart, yStart
Click %X_TARGET%, %Y_TARGET%
Send a{Enter}
MouseMove % xStart, % yStart
return
Esc::ExitApp
Re: help in creating script
thank you, I'll look into it and let you know if it works
Re: help in creating script
Unfortunately it still wont take focus from the app I use. Works when I try on other apps though but not with the one I need.
Re: help in creating script
Probably you will not be able to send to text box in chrome without activating it.
You can controlclick and controlsend in inactive windows and apps (but not minimized) if you have named controls (textbox or button) - if it is on the webpage it wouldn't work since whole chrome window is a single control. Maybe in IExplorer you could do that using COM.
Solution is that you use global coordinates - save you current mouse position - move mouse to chrome window to textbox, click once (or twice) to get blinking cursor in that textbox - send your keystrokes - then return to original mouse position and reactivate window/app you've been at the beggining. It can be done in a blink of an eye.
You can controlclick and controlsend in inactive windows and apps (but not minimized) if you have named controls (textbox or button) - if it is on the webpage it wouldn't work since whole chrome window is a single control. Maybe in IExplorer you could do that using COM.
Solution is that you use global coordinates - save you current mouse position - move mouse to chrome window to textbox, click once (or twice) to get blinking cursor in that textbox - send your keystrokes - then return to original mouse position and reactivate window/app you've been at the beggining. It can be done in a blink of an eye.
Who is online
Users browsing this forum: hiahkforum, Rohwedder and 261 guests