ImageSearch all possible .png images in folder

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Gnstuur
Posts: 11
Joined: 08 Aug 2021, 11:00

ImageSearch all possible .png images in folder

Post by Gnstuur » 27 Nov 2021, 00:03

Hey,
ImageSearch all possible images in folder:

Code: Select all

ImageSearch, X1, Y1, 0, 0, 771, 509, % "pictures/items/*"
or

Code: Select all

ImageSearch, X1, Y1, 0, 0, 771, 509, % "pictures/items/*.*"
or

Code: Select all

ImageSearch, X1, Y1, 0, 0, 771, 509, % "pictures/items/*.png"
didnt work, do i need a loop or can this be done like this?

User avatar
boiler
Posts: 16767
Joined: 21 Dec 2014, 02:44

Re: ImageSearch all possible .png images in folder

Post by boiler » 27 Nov 2021, 04:34

You need a loop, such as:

Code: Select all

loop, Files, pictures\items\*.png
{
	ImageSearch, X1, Y1, 0, 0, 771, 509, % A_LoopFileFullPath
	if !ErrorLevel
		MsgBox, % "Image " A_LoopFileName " was found at " X1 "," Y1
	else
		MsgBox, % "Image " A_LoopFileName " was not found"
}

Post Reply

Return to “Ask for Help (v1)”