Jump to content

How to make the Alfred search window a frontmost app

Recommended Posts

Here are my parameters: 




I actually left them as default and they work well for me. Only thing I did change was lower key repeat to be really low: 





Share this post

Link to post
On 9/7/2017 at 2:38 AM, Vero said:

Launch Alfred's prefs to Appearance > Options (in the bottom left) and choose Focusing: Compatibility mode which makes Alfred behave like an app taking focus.


Hi @Vero - Does this still work in Alfred 4 & Mojave?


If I've enabled Compatibility Mode for Focusing in Alfred's Appearance options, and I run the script below - while Alfred's search or file action window is open - shouldn't "Alfred" or "Alfred 4" show up as the frontmost app (i.e., as frontAppName in script below)? Or does the Focusing option control something else? Thanks for your help!

tell application "System Events"
	set frontApp to first application process whose frontmost is true
	set frontAppName to name of frontApp
end tell


Edited by Jasondm007

Share this post

Link to post

@Jasondm007 I'm not sure you'll ever see Alfred as a frontmost app, as he is configured as an LSUIElement. That focus mode changes Alfred's underlying window style mask, making the window non-activating.


You can see the effect of this option as soon as you change the option without even closing Alfred Preferences, or the Appearance > Options sheet. Show and hide Alfred, and when in Standard Mode, showing Alfred doesn't make Alfred Preferences lose focus. Switch to compatibility, and showing Alfred makes the Alfred Preferences window lose focus (fade out).




Share this post

Link to post

@Andrew Many thanks for the clarification! This all makes perfect sense - even to a scripting neophyte, like myself!


If Alfred can't take focus as a frontmost app, is there a different way to check (via AppleScript) whether his window is open?


Thanks again for all of your help!

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...