Jump to content

URL wildcards - open in specific browser


Recommended Posts

I'm trying to figure out if there is a way to configure Alfred to open non-specific URLs, using a partial or whole domain, in a specific browser using a wildcard or contains function. For example: I have a bunch of bookmarks to SharePoint URLs that I need to open in my Windows VM, but most other links I want to continue opening in Safari. The logic I'm looking for is something like "IF URL contains sharepoint.com, then open in Chrome in Windows".

 

This would allow us to configure one Workflow for each domain (or one to rule if we could do multiple domains in one flow) rather than create a different Workflow for each Open URL action. I set up the many of the single Open URL Workflows previously and somehow Alfred got totally reset the other day - I lost all my settings and preferences - and now I have to rebuild everything again. 

Edited by mafyou
Fixed wording
Link to comment

Forgive the ignorance, but... I'm having trouble figuring out how that works because the Open URL action requires a specific URL, correct?

 

Maybe I worded my original question weirdly, so let me take another whack at explaining my intended use case:

  1. Open Alfred
  2. Search for a bookmark
  3. If the selected bookmark URL contains "%sharepoint.com%", then open in Chrome. Else, open in default browser. (% is a wildcard here)

Note there are many different Sharepoint domains I use. For example, "https://workspace.web.sharepoint.com/abc" or "https://operations.web.sharepoint.com/xyz".

Link to comment
34 minutes ago, mafyou said:
  1. Open Alfred
  2. Search for a bookmark
  3. If the selected bookmark URL contains "%sharepoint.com%", then open in Chrome. Else, open in default browser. (% is a wildcard here)

 

That's not possible with Alfred's built-in actions. You need to write your own workflow that implements the "if URL matches *.sharepoint.com*, open in Chrome in my VM" logic.

 

In Sierra and earlier, you can filter Safari's bookmarks with a File Action, but in High Sierra it has become significantly more complicated to read Safari's bookmarks in a workflow. Basically, you have to parse the property list they live in.

 

34 minutes ago, mafyou said:

because the Open URL action requires a specific URL, correct?

 

Not quite. Ultimately, it needs a valid URL, but it supports the {query} and {var:XYZ} macros in the URL field. So you can set the URL to, say, https://{var:subdomain}.web.sharepoint.com/{var:path} and pass in path and subdomain variables to alter the actual URL that is opened.

 

Edited by deanishe
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...