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
Next revision
Previous revision
action:Find_Image_on_Screen [2018/01/18 21:55]
JMichaelTX ADD header, icon, token, and example screenshot
action:Find_Image_on_Screen [2019/07/08 00:31] (current)
peternlewis
Line 1: Line 1:
-{{:​condition:​image-icon.png?​nolink|}} 
 ====== Find Image on Screen Action ====== ====== Find Image on Screen Action ======
  
-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]].+The //Find Image on Screen// ​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|}}+{{ findimageonscreen.png?nolink&​503x201 ​Find Image on Screen ​}}
  
-After finding an image on the second monitor, this //Action// return data like this: +You can specify the image to search based on:
-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 (propertiesmay be referenced in other actions like [[action:​Move_or_Click_Mouse|Move and Click Mouse]] using the following notation:+* An image pasted ​in to the action. 
 +* An image from the System Clipboard, Trigger Clipboard or a Named Clipboard (v9.0+). 
 +* An image loaded from a file (v9.0+)
 +* An image from elsewhere on the screen (v9.0+).
  
-* ImageLoc.x — Horizontal position of upper left corner. +You can also specify ​the fuzz allowed in the matchas well as whether to display ​the possible matches (generally used for debugging), and whether ​the image must be unique, or if not, which of the acceptable images to choose ​(the best, the topmost (v9.0+), leftmost (v9.0+), bottommost (v9.0+), or rightmost (v9.0+)).
-* ImageLoc.y — Vertical position of upper left corner. +
-* ImageLoc.width — the Width of the match (same as the source image)+
-* ImageLoc.height — the Height ​of the match (same as the source image). +
-* ImageLoc.fuzz — the Fuzz of the match. +
-* ImageLoc.Midx — Horizontal position of center. +
-* ImageLoc.Midy — Vertical position of center.+
  
-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 search ​the entire desktop, or you can restrict your search ​to a specific screen ​or window, or to a specific area on the screen. 
 + 
 +Suppose that the image location is stored in the [[manual:​Variables|Variable]] `ImageLocation` (chosen by you in the action).  Then parts of the image data (propertiesmay be referenced in other actions like [[action:​Move_or_Click_Mouse|Move and Click Mouse]] using the following notation: 
 + 
 +* ImageLocation.x — Horizontal position of upper left corner. 
 +* ImageLocation.y — Vertical position of upper left corner. 
 +* ImageLocation.width — the Width of the match (same as the source image). 
 +* ImageLocation.height — the Height of the match (same as the source image). 
 +* ImageLocation.fuzz — the Fuzz of the match. 
 +* ImageLocation.MidX — Horizontal position of center. 
 +* ImageLocation.MidY — Vertical position of center.
  
 If this action fails to find the image, 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.+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.+Please note that "ImageLocation" 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 =====
Line 35: Line 40:
 {{:​action:​find.image.on.screen2.kmmacros|Find Image on Screen.kmmacros}} {{:​action:​find.image.on.screen2.kmmacros|Find Image on Screen.kmmacros}}
  
-{{:action:find.image.on.screen2.jpg?673&nolink|}} +{{ find-image-on-screen2.png?nolink&503x591 ​Find Image Example ​}} 
-{{:action:find.image.on.screen3.jpg?659&nolink|}}+{{ find-image-on-screen3.png?nolink&​452x456 ​Find Image Results ​}}
  
 ===== See Also ===== ===== See Also =====
  
-=== Actions ===+==== Actions ​====
  
-* [[action:​Execute an AppleScript|Execute an AppleScript]] 
 * [[action:​Highlight Location|Highlight Location]] * [[action:​Highlight Location|Highlight Location]]
 * [[action:​Move or Click Mouse|Move or Click Mouse]] * [[action:​Move or Click Mouse|Move or Click Mouse]]
-* [[action:​Write to a File|Write to a File]] 
 * [[:​Actions|See all Actions]] * [[:​Actions|See all Actions]]
  
-===  Conditions ===+====  Conditions ​====
  
 * [[condition:​Found Image|Found Image]] * [[condition:​Found Image|Found Image]]
 * [[:​Conditions|See all Conditions]] * [[:​Conditions|See all Conditions]]
  
-===  Collections ===+====  Collections ​====
  
 * [[collection:​Found Images|Found Images]] * [[collection:​Found Images|Found Images]]
action/Find_Image_on_Screen.1516330527.txt.gz · Last modified: 2018/01/18 21:55 by JMichaelTX