One problem I frequently run into with macros that look for images is that they usually break when I update the OS. This is because the icons and so on typically change with the updates. One macro might look for the lightbulb image 5 times. When the OS is updated, I have to go find those 5 images and replace each one with the new updated lightbulb image. I wonder how others deal with this. I thought if I could save the image in a macro to a variable and put that at the beginning of the macro, then I could just replace that image once. Is there any way to do this or perhaps a better way to solve this problem?
1.- copy image to clipboard
2.- Open KM Preferences > Clipboard
3.- Paste the image in there and assign it a name, ie "Clipboard 4"
Now you can refer to it when using Click Found Image
Edit: As Martin mentioned, for changes down the line, you only need to Paste the new image in this clipboard, and it will be reflected in all your macros automatically.
Case One:
This is a macro I'm using:
- Save the image to a local folder. Use Pause until to find the image.
- Set a variable to the token %FoundImage%
- Then use Mouse Click to click the place relative to the image center (
Local__image.MidX
/Y
means the center of the image).
See token:FoundImage [Keyboard Maestro Wiki] for the %FoundImage%
token.
Case Two:
If you always click the center of the image, and you repeatedly use this action, then you can create a sub-macro to do it. I have the following actions in a macro named "Click at Found Image"
Then I can use an action like this:
Edit: to answer your question, you only need to replace the image (with the same name and in the same folder) when you need to find and click a new image.
Martin, I think I like case 1 you mentioned. I'll try it out. Thank you.