YOU have saved me HOURS..... Thank you and have a safe trip
Thank you for creating this macro. I have used FindImage for years, but the last year or so it seems that what worked one month doesn't work the next. I'm guessing that is because I'm not running the macro at the same time of day each month. (I use it download online bills and bank/investment statements).
I am using a very old Late 2014 27" Retina Mac with an Intel i7, 32 gigs of RAM and 1 TB SSD. To find it the first time takes about 20 seconds. Once it has been found it is virtually instantaneous if i run it again.
I also found that the mouse wasn't moving to the location the first time I found it. I had to add this
right under:
to get it to move.
I saw there were several comments about designating a certain portion for the search, and you replied it might make it only marginally faster. For me, since I'm only searching a Safari window, by limiting it to that I wouldn't have to worry if the same word was elsewhere on the screen. (As you mentioned above, one of the reasons a person may have been having trouble is that the triggering macro, with the search word, was visible on screen). Something similar happened to me in that I was searching for "Summary" and just by coincidence a message popped up giving me a "Summary" of my screen time. And as that pop-up was higher up on the screen than my Safari window, it found that pop-up and stopped. So I too would like to see if we could tell it to just OCR a particular window like the active Safari window.
I also had an idea about finding something other than the 1st instance of a word. I was think that you could add a 3rd parameter where we could designate which one we wanted. Then as you searched you would iterate a counter until the number found equaled the number we wanted. Besides a pure number, I don't know if it would be possible to do a Top/Bottom/Left/Right most, first/last, etc. like KM can do with found images.
You make some good comments. I'm very glad you were able to understand the macro and modify it to suit your needs. Yes, you could modify it to start searching only a specific application's window. But even if that narrows your search area by 50%, that's only one step in a ~20 step binary search, which means a 5% increase in speed (roughly.) This is why I didn't add a starting area to my algorithm, as it doesn't increase the overall speed by very much.
Yes, I think it would be possible to modify the macro to search for the leftmost or topmost occurrence. In my case, I wrote this macro to find and click on a phrase like "Click to Continue" and in my situation the word "Continue" appears only once on the screen, so I didn't need that feature. Moreover, the words "Click to Continue" were in a 200 point cartoon font, so my macro was really fast. (And Apple's Text Recognition works very well with cartoon fonts.)
P.S. Binary searches don't take into account the fact that bisecting an area could accidentally bisect the actual word that you are trying to find, resulting in a failed search, so I had to make some modifications to account for that potential problem. It was tricky, and it will get double tricky if you want to search for "leftmost" or "topmost." I'm not sure if I'm mentally ready to take on that task.
Thanks for the reply. My interest in specifying a Safari (or Chrome, etc) window isn't for speed but to be sure I'm finding the word in the correct place, just in case it is somewhere else on screen. While this may be pretty rare in general use, (although it did happen to me), as you pointed out if I had the macro on screen while I'm working on it, that might be found. So, there are definitely use cases for it.
Fair enough. If you want to modify the macro to start searching over a specific area, like the area taken up by the Safari window, I think all you have to do is modify the coordinates in this action:
You can either insert fixed values, if you know where Safari will be located, or you can extract the actual values of the Safari window's location by placing Safari on the front of the screen and then extracting the coordinates using a token like %FrontWindowFrame% or any of a variety of similar tokens.