mafyou Posted October 19, 2017 Share Posted October 19, 2017 (edited) 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 October 19, 2017 by mafyou Fixed wording Link to comment
deanishe Posted October 19, 2017 Share Posted October 19, 2017 It sounds like you should use a List Filter. Put the URLs, or just the differing parts, in there and connect it to one single Open URL action. Link to comment
mafyou Posted October 19, 2017 Author Share Posted October 19, 2017 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: Open Alfred Search for a bookmark 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
deanishe Posted October 20, 2017 Share Posted October 20, 2017 (edited) 34 minutes ago, mafyou said: Open Alfred Search for a bookmark 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 October 20, 2017 by deanishe mafyou 1 Link to comment
mafyou Posted October 20, 2017 Author Share Posted October 20, 2017 OK, I'll give that a shot but this may be a bit beyond my ability. Regardless, thank you very much for your input. Link to comment
deanishe Posted October 20, 2017 Share Posted October 20, 2017 I really think you should look at using a List Filter. It'd be a bit of work to add all your URLs, but should be manageable as long as the list doesn't change all the time. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now