Defocus other windows when Spotlight windows loaded

I have found the old thread about it. I need it for the macro that makes return open the folder/ files but leaves other return functions intact.

I have in fact made it work but with the significant delay as it had to check 6 screenshots during the execution.

just one magnifiyng glass screenshot didn't work.

I've tried to create another macro, which will disable the macro that changes the return function when I press command+space and turn it on again when I press return or escape but for some reason it didnt' work or work very unstable.