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

Next revision
Previous revision
Next revision Both sides next revision
action:Find_Image_on_Screen [2015/07/15 03:09]
peternlewis created
action:Find_Image_on_Screen [2017/09/11 06:54]
peternlewis
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.+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.
  
-You specify ​the image to match (usually got with a Command-Control-Shift-4 screen captureand the amount ​of fuzziness allowed ​Because ​of transparency and anti-aliasing,​ almost all screen matches are fuzzy to some degree, but usually about 20% is a good place to start.+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: 
 + 
 +* ImageLoc.x — Horizontal position of upper left corner. 
 +* 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 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 optionally display all the matches on the screen which can be helpful ​in determining ​the right amount of fuzz to use.+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.
  
-You can search for the image on:+===== How To Use =====
  
-* all screens. +{{page>::​Found_Image#​How To Use&​noheader&​nofooter}}
-* the main screen. +
-* the specified screen (counting from the left). +
-* the front window. +
-* the window with a specified title. +
-* the window with a title containing a given string. +
-* the window with a title matching a given regular expression. +
-* the specified window (counting from the frontmost window). +
-* a specified area on the screen.+
  
-Remember when specifying the area, as with all [numeric fields](:​Text_Fields),​ the numbers can be calculations including [functions](:​Functions),​ and the fields expand to allow for longer expressions as soon as you type something other than a number, so this allows very precise control of where you can match.+===== Example =====
  
-This action ​cannot fail per se, but it can fail to find the imagein which case the variable will be set to the empty string.+{{:action:find.image.on.screen2.kmmacros|Find Image on Screen.kmmacros}} 
 + 
 +{{:​action:​find.image.on.screen2.jpg?​673&​nolink|}} 
 +{{:​action:​find.image.on.screen3.jpg?​659&​nolink|}} 
 + 
 +===== See Also ===== 
 + 
 +=== Actions === 
 + 
 +* [[action:​Execute an AppleScript|Execute an AppleScript]] 
 +* [[action:​Highlight Location|Highlight Location]] 
 +* [[action:​Move or Click Mouse|Move or Click Mouse]] 
 +* [[action:​Write to a File|Write to a File]] 
 +* [[:​Actions|See all Actions]] 
 + 
 +===  Conditions === 
 + 
 +* [[condition:​Found Image|Found Image]] 
 +* [[:​Conditions|See all Conditions]] 
 + 
 +===  Collections === 
 + 
 +* [[collection:​Found Images|Found Images]] 
 +* [[:​Collections|See all Collections]] 
 + 
 +==== Forum ==== 
 + 
 +- [[https://​forum.keyboardmaestro.com/​t/​can-i-zoom-the-picture-i-have-saved-in-click-at-found-image-action/​2103/​2|Can I zoom the picture I have saved in "Click at found image" action?]] 
 +- [[https://​forum.keyboardmaestro.com/​t/​how-to-search-for-multiple-found-image-actions/​3093|How To Search For Multiple "Found Image" Actions]] 
 +- [[https://​forum.keyboardmaestro.com/​t/​find-image-on-screen-using-clipboard-image/​3510/​4|Find Image on Screen using Clipboard Image?]] 
 +- [[https://​forum.keyboardmaestro.com/​t/​km-cant-see-portion-of-screen-i-just-pasted-into-it/​3547/​3|KM can't see portion of screen I just pasted into it]]
  
 +- [[https://​forum.keyboardmaestro.com/​search?​q=Find%20Image%20on%20Screen|Keyboard Maestro Forum topics about Find Image on Screen]]
action/Find_Image_on_Screen.txt · Last modified: 2023/09/15 02:21 by peternlewis