ImageSearch Coords Offseting Near Line End On Notepad. Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

ImageSearch Coords Offseting Near Line End On Notepad.

03 Mar 2018, 05:56

Hi,
I wrote this script to substitute the letter "N" with a clipboard capture:

Code: Select all

SetWorkingdir C:\Users\FX-8120\Desktop
CoordMode, Screen
F12:: exitapp
F11:: pause
F10:: reload
F9::
Loop
	{
	ImageSearch, MovX, MovY, 0, 0, 1920, 1080, *2 N.png
	MovX2:= MovX + 4
		If ErrorLevel = 0
			{
			MouseMove, movX, movY
			MouseClick, , , , , , D
			MouseMove, MovX2, movY
			MouseClick, , , , , , U
			Send {Ctrl Down}
			Send {V}
			Send {Ctrl Up}
			}
	}
Return
The problem I found on Notepad was that If there was a second "N" a bit further to the end of the line, the MouseMove would offset a few pixels to the left of the Image there, with the script then pasting repeatedly on the wrong position.
Luckily the "N"s were basically on columns and I was able to proceed when I shortened the window width and did the two columns separately.
Any help for me to learn a little bit more would be greatly appreciated.
Thanks and Best Regards!
Noo0B
Posts: 151
Joined: 26 Jan 2018, 19:54

Re: ImageSearch Coords Offseting Near Line End On Notepad.  Topic is solved

28 Mar 2018, 13:27

Fixed. The logic of this problem is that it reads the line and collect the coordinates before the substitution. If a first substitution is lengthier than the substituted part it offsets everything to its left on that line :)
Created my own clipboard editor after finding the right command :)
Regards.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 274 guests