1

How can I open application URLs in Terminal or Alfred?

My Problem: I use Airmail2 as default mail client as well as OmniFocus 2 to organize my work. Airmail2 allows to copy application URLs via EDITCopy Message Link, which yields a link like airmail://message?mail=myAccount&messageid=etPan.55ba060a....

When I paste this link in the notes section of a task in OmniFocus, it gets automatically converted into a clickable link that works as expected. Other programs, such as Evernote, will not recognize it as URL. It would be really handy to access these links even outside of OmniFocus.

How can I open these application URLs besides pasting it into an OmniFocus task note section and click it? I would prefer a Terminal command or a script, which I can include in Alfred. The open command of the Terminal does not work unfortunately.

  • Do those answers help? – klanomath Jul 30 '15 at 13:24
  • Unfortunately not, I've found them before asking. The question there is focused on creating and configuring custom URL handlers. – Paul Klemm Jul 30 '15 at 13:55
  • Have you tried open -a Safari URL? It'll open the URL in Safari. – user14492 Jul 30 '15 at 14:53
  • This doesn't work because Safari does not know what to do with these custom URLs. – Paul Klemm Jul 30 '15 at 15:00
  • Correction: open <url> actually works when using BASH. I'm on ZSH, which seems to have a problem with the URL format. I will look into it. – Paul Klemm Jul 31 '15 at 10:47
1

Maybe I don't get the question right but:

You may open such an application URL in almost any available application with text fields or text boxes: highlight the URL (sometimes even only parts of it - at least the scheme and the first character after the :// (e.g. airmail://m - are sufficient to open the application), right-click and choose "Open URL". And yes, it's of course also working in the Chrome/Safari Omnibar: Just enter the URL and hit the "Enter" key.

In Evernote you have even two ways to open it:

  • You may paste the URL(s) in a note and by choosing the whole URL or parts of it the context menu offers "Open URL"
  • If you have only one application URL in your note, you may add the URL to the "Note info" (red circle) and then you'll get a clickable link with the "scheme specific part" of the URL or only parts of the "scheme specific part" - here "message" (blue circle).

    enter image description here

In the Terminal you have several ways to open the URL:

  • highlight the whole URL or parts of it and the context menu offers "Open URL"
  • highlight the whole URL and command & double click it
  • enter open URL
    (e.g. open airmail://message?mail=myAccount&messageid=etPan.55ba060a....)
    (OK, the interaction between Terminal and Airmail2 uncovers a glitch, because Airmail2 opens if closed, gets to the front and the message is chosen, but the GUI is not visible.)
  • open URL did not work for me because I was using ZSH instead of BASH. I will need figure out what the problem is with ZSH there. I like the solution using ServicesOpen URL best. I've mapped a global shortcut to this using the Keyboard preferences pane, it works like a charm! – Paul Klemm Jul 31 '15 at 10:43
  • Zsh uses ? as a wildcard it cannot match. Try putting it in ". – Max Ried Aug 1 '15 at 22:50
  • Surrounding the URL with quotation marks using the open command works just fine, thank you for the hint. – Paul Klemm Aug 3 '15 at 11:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .