Hotkeys in Alfred AND OmniFocus?!?!

This must be really easy, but I can’t figure it out!

Can someone help?

— While in Alfred, I’d like to use CMD+K to invoke the clipboard history.

— While in OmniFocus, I’d like to use CMD+K to “clean up” or organize the database (basically, to archive entries that I’ve already processed).

In short, I want CMD+K to do one thing in one application and another thing in another application.

I have tried to arrange this by going to System preferences > Keyboard > shortcuts, but nothing seems to work.

Can someone help? What should I do?


Ps. MacOs Monterey 12.0.1
Alfred 4.6
OmniFocus 3.12.2

Using Keyboard Maestro this should work, don’t know if MacOS can do this out of the box.
Just create a KM macro specific for Alfred and another one for OF with the same shortcut.