Jump to content
gingerbeardman

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.

 

957267637_Screenshot2020-05-21at09_29_07.png.c6dd470d0642fcc08b333fe084db7d15.png

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.

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