Does this Macro looks and run properly, need your advices

Hi Guys,

Me again, I re-map my mouse's middle button (the scroll button) as a keyboard shortcut so that
I can quickly run the action (Command W for minimize the window) of the different Apps .

It looks like this.

I am wondering...does it look okay to you? I always think it maybe takes out / occupies large of Computer's resources such as RAM or CPU for some reasons..since it requires KM always "check" the status of these apps also it has "if else"....Though I 've got a iMac i7 2017 model.

What do you guys think? Thanks.

This looks OK to me. I doubt with your iMac-27 that this will take significant resources. Keep in mind that the IF/THEN stops as soon as it finds ONE of the apps.

But if you do want to optimize, you could try one of these:

  • Test for the Front App name (%Application%1%) that “matches” “app1|app2|app3|etc”
  • Test only for exceptions, apps that you do NOT want this macro to apply to. Most likely that will be a shorter list. If not, use what you have.

Thanks a lot. I replaced them all with your idea #1 , it looks much better now.

Great, glad that helped. BTW, you do NOT need the "Cancel Macro" at the bottom of every Switch Case. After the Actions for the Case that meets the criteria are completed, then the Switch Action is exited.

See Switch or Case action.

thanks. I am obsessed with making Macros now. :grinning: so much fun.

1 Like