hello. I am using Keyboard Maestro version 11.0.3.
I am trying to create a macro for Instagram likes. Simply, I want to search for empty hearts and make them click sequentially from the top.
The 'for each' action seems to work best, but I'm having a hard time figuring out how to write the macro, please help.
I don't have access to Instagram, so I'm not sure what the Instagram page looks like, but I see a problem (or two) with your macro.
The first action seems useless, and probably will break your macro. You don't want the first action there, because it will generate an error if there is not a SINGLE heart in that area on the screen. Since I can't see that area on your screen (you didn't show an example image), I can't be 100% certain, but I'm probably right.
The second action contains a For Each and a Click action. The For Each seems to look fine, but the Click action is always clicking in the upper left corner of your screen, which does nothing.
Since I can't see your Instagram screen (it may help if you upload an example page), I can't write a macro for you, but you should consider trying the following action:
What this will do is locate hearts in an area on the screen and click on the middle of the hear (using the built-in values "midx", "midy", which you may not have heard about yet.) The reason I added a brief Pause action is because KM is so fast, it might be too fast for the website's code.
I can't be certain that my approach will work for you because you didn't show an example page. I won't visit the Instagram website because it is owned by Zuckerberg and I don't trust anything he does. If you show a screenshot, I can probably give better advice.
That looks right, but the Set Variable action is unnecessary, LocalEach and LocalHeart will just end up with the same value. Instead, just use LocalHeart in the Move & Click action.
Is there an emoji for egg on my face? You are right. The reason for my (harmless) mistake is that I'm so used to assigning a variable immediately after searching for an image with a Find Image action.
Now that I mention it, it would be very nice if the %FoundImage% token accepted a few optional parameters, like these:
%FoundImage%x%
%FoundImage%y%
%FoundImage%width%
...and so on. I would use these a lot if they were available. They would reduce the number of actions I have to write.