Finder error popup trigger macro

image
I frequently get this error after setting the label color in a SD card then ejecting that card. I wanted to use KM to create a macro that triggers when this error appears so it can automatically dismiss it. I don't want KM to constantly be searching for an image, so I was hoping that maybe there is a way to trigger the macro from when Finder launches the message popup.

How do you eject the card? It should be pretty easy and reliable to solve this problem if you use a macro to both eject the card and then click on the OK button.

Well, I normally just click the eject button in the side of finder or use "cmd+E". The error doesn't pop up every time; but this it a good idea if there isn't a better solution. (I'd rather work a macro into my existing workflow than change it)

I think this path would work well. It's a little late in the day for me to start googling how to solve this problem for you.

Write a macro triggered in Finder on Command-E, and include a Pause Until with an image found action for that dialog. Give it a timeout of two seconds or so, assuming it normally shows up quite quickly? If it times out, the macro is done. If the image shows up, click OK.

That should work, though won't cover manual eject using the icon in Finder.

-rob.

Your macro might work like this.

(1) To eject the SD card, you can use the execute shell script action. Set it to "execute text script", and add the following text: `diskutil unmount "SD-card" (but change that "SD-card" to the actual name of your card).

(2) Use a press button action to dismiss the alert if it appears.

Click the cog menu in the action and set the following options.
:heavy_check_mark: Wait for enabled button.
:heavy_check_mark: Timeout aborts macro.
:x: Notify on failure.

In the same menu, select "Set action timeout". Try setting a time of just a few seconds and adjust as necessary – you will need to experiment.

Finally, set the trigger of the macro to ⌘-E.

:warning: Of course, I have not tested this idea for a macro, because it is intended to address an issue that is on your system. As always, back up your Mac before getting too adventurous.

Also… it would really be for the best if you could identify what is causing the error message in the first place.