I was able to reduce the size of my macro file by removing Images from Find Image actions and replacing them with my ClickOnWord() macro.
THANKS! I'm going to have to check that out.
I have also seen a macro that helps similarly by moving the saved images in the Find Image actions out to external files. Using an external file as an image source is directly supported by the Find Image action and this macro helps facilitate the conversion. Unfortunately, I didn't install it when I saw it, so I'm going to have to dig for it.
Thanks for the memory prompt.
That's also a good way too, and I do it occasionally, but I found difficulties doing that because some apps change the DPI of an image resulting in a mismatch when reloading. So I avoid using files. Peter has mentioned this issue in other threads like this one:
Do you know which apps to look out for? That seems a hairy problem to debug.
I had some macros that were growing over time, like some I'd created to automate saving Facebook items that I want to respond to later. Facebook would imperceptibly change a graphic element which I had been using to tell, for instance, that I had scrolled to the bottom of a list, so when the macro broke, I would fix it by adding a new capture into the macro as another OR condition, while leaving the older images in place, so that my macro would hopefully work no matter which version of the UI I was given.
Most of the time my Click on Found Image actions are ways to interact with an app's UI. For many of my macros, I think I can eliminate images entirely by using @noisneil's macro:
I've already used it on the color picker of TextEdit and found it very straightforward to use in generating an AppleScript snippet to click directly on a specific UI element, without having to get KBM to position the mouse at all.
My testing comes from about 5 or more years ago, so I'm not sure if it's still valid, but the macOS Markup utility and some free image editor called PaintX, I think, were what I tried. When I saved images, they changed the DPI resulting in complete mismatches. I think I had an alternative solution which was to always use the middle value in the Displays pane of System Settings:
I suspect that using a different setting than "Default" results in DPI mismatching. I think this was the underlying cause of my DPI problem. I haven't tested this idea in about 5 years, however. That was a tough problem to diagnose.
After that I just gave up editing images and just used screen captures without editing them, and I never had another problem.
That's what I've been doing all along.
Thanks for the voice of experience.