The display layout changes trigger

I have a macro which should solve a problem when SwitchResX intermittently doesn’t get activated if display connected

The problem is MacOS send a number of system notifications when I connect a monitor and macro runs a few times. Is it OK? What is workaround for it?

If you are saying that the problem is that this macro gets triggered multiple times, that’s easy to solve. (1) Start the macro with a Semaphore Lock action, and enter a unique name into the action, and set its options as shown in the following image, (2) End the macro with a “Pause 60 seconds” action.

If you add both of the above actions, the first macro will run to completion after 60 seconds, while anything else that triggers the same macro during those 60 seconds will abort.