Automatic Button Clicks?

This is photos.app.

Is it possible to create a macro that automatically presses "Don't Import" whenever such a window appears?

This is possible (action:Move or Click Mouse [Keyboard Maestro Wiki]), but this macro needs to run frequently in situations where this dialogue might show up.