Jump to content

Option in workflow Open URL action to open in current/active browser

Recommended Posts

Posted (edited)

I use different, non-default browsers from time to time, and it's annoying when Alfred opens a page in the default browser when I do not have it open.


It would be great if there was an option for current/active browser.

Which I guess would be the most recently used browser if multiple are open?

Browser may not always be frontmost app.



Edited by gingerbeardman

Share this post

Link to post
Share on other sites

Easy to accomplish with a Workflow. Use a Run Script Action with language /usr/bin/osascript (AS) and code:

tell application "System Events" to set web_browser to name of first process whose frontmost is true
tell application web_browser to open location "https://example.com"

What you’ll use instead of https://example.com depends on what you were doing in the first place.

Share this post

Link to post
Share on other sites
25 minutes ago, gingerbeardman said:

What happens if the web browser is not frontmost? 


It opens in the default web browser.

Share this post

Link to post
Share on other sites

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...