Hi guys, I am trying to make a macro to autohighlight words, copy and paste them in different fields, example data:
"George Mathew Coman <---- Mouse position starts here"
The data structure is based on 3 words, I have to input the 3 names of the person in different fields so I have a mousemove command:
Code: Select all
Mousegetpos, px,py
Send {lbutton down} ; holds left click
Mousemove -10,0,0,r ; moves the mouse 10 pixels to the left
Send {lbutton up} ; releases left click
Send {lcontrol down}c{lcontrol up}
Mousemove 75,100
Mouseclick left
Send {lcontrol down}v{lcontrol up}
Mousemove px,py
I have the mouse move from the very right to the left 10 pixels enough to cover "Coman", and then send the copied name to a field, but instead of assuming the word length is 10 pixels, since words vary in length, I want ahk to detect the space between "Coman" and "Mathew" and highlight to next word by moving again to the left but I want it to stop highlighting when it detects the space between "George" and "Mathew". Is there any way to make a script that automatically highlights and copies the words by stopping the highlight based on the spacing in between the words?