User Tools

Site Tools


action:Find_Image_on_Screen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
action:Find_Image_on_Screen [2017/09/11 06:54]
peternlewis
action:Find_Image_on_Screen [2018/01/18 21:55] (current)
JMichaelTX ADD header, icon, token, and example screenshot
Line 1: Line 1:
-The //Find Image on Screen// action finds a specified image on the screen and stores the rectangle containing the match followed by the fuzz of the match (0-100), ie, (left,​top,​width,​height,​fuzz),​ in a variable.+{{:​condition:​image-icon.png?​nolink|}} 
 +====== ​Find Image on Screen ​Action ======
  
-The image location is stored in the variable ​may be referenced ​as a structure ​in other actions like [[action:​Move_or_Click_Mouse|Move and Click Mouse]] using the following notation:+The //Find Image on Screen// [[:​Actions|Action]] finds a specified image on the screen in a specified area and stores the image location and fuzziness (left,​top,​width,​height,​fuzz) in a Keyboard Maestro [[manual:​Variables|Variable]]. 
 + 
 +{{:​action:​find-image-on-screen-km.png?​nolink|}} 
 + 
 +After finding an image on the second monitor, this //Action// return data like this: 
 +2060,​136,​60,​56,​0 
 + 
 +Suppose that the image location is stored in the [[manual:​Variables|Variable]] `ImageLoc` (set by the user). ​ Then parts of the image data (properties) ​may be referenced in other actions like [[action:​Move_or_Click_Mouse|Move and Click Mouse]] using the following notation:
  
 * ImageLoc.x — Horizontal position of upper left corner. * ImageLoc.x — Horizontal position of upper left corner.
Line 13: Line 21:
 You can require the match to be unique (so if there are two or more good matches then the action will fail to find the image), or you can accept the best match even if there is more than one. You can require the match to be unique (so if there are two or more good matches then the action will fail to find the image), or you can accept the best match even if there is more than one.
  
-This action ​cannot fail per se, but it can fail to find the image, ​in which case the variable will be set to the empty string.+If this action ​fails to find the image, the variable will be set to the empty string
 + 
 +After an Action like this is executed, and an image was found, then the [[token:​FoundImage|%FoundImage%]] token (v8+) will return the data of the last found image. 
 + 
 +Please note that "​ImageLoc"​ is just an example Variable (which you the use can set), whereas [[token:​FoundImage|%FoundImage%]] is a token provided by the Keyboard Maestro Engine.
  
 ===== How To Use ===== ===== How To Use =====
action/Find_Image_on_Screen.txt · Last modified: 2018/01/18 21:55 by JMichaelTX