I’m using a password manager app, and I have a Keyboard Maestro macro that automatically clicks on the search field whenever the password app is activated. This is convenient because I don’t have to press ⌘F or manually click the search box when the app sometimes doesn’t focus the search field by itself.
However, this macro also runs when I switch from the password app to another application using ⌘Tab. In that case, I don’t want the macro to fire. I know I could hide the password app to avoid this, but if possible I’d like the macro to run only when the password app becomes active in the foreground, and not when I’m leaving it via ⌘Tab.
Is there a way to set up the macro so that it doesn’t trigger when switching away from the password app with ⌘Tab? If so, I’d appreciate any suggestions or example macros.
![05)[検索]検索フィールドにカーソルを合わせる.kmmacros](https://forum.keyboardmaestro.com/uploads/default/optimized/3X/5/f/5fb93657cf334f716b05d36db8a9692993ad2905_2_526x1999.jpeg)
![05)[検索]検索フィールドにカーソルを合わせる.kmmacros](https://forum.keyboardmaestro.com/uploads/default/optimized/3X/3/0/30b09f7a962e49a2c1526fc71ab8e8c1c99e94dc_2_690x1038.jpeg)