birmingham.io

Open file in atom from browser

Afternoon brum-land,

I want a quick way to open a file in ATOM editor from the browser.

Use case, we’re clicking through an online module and notice a speeling mistake. I want the user to be able to click a button which says, “Open in Atom” and it then open the editable file in atom.

Presently, they click through, then have to examine the URL and then either go to Atom and search for the file name, or click through the VPN file system to locate the file and open it.

I tried just replacing the “https://” with “atom://” but no easy luck. Is there a URL I should be sending it, or the VPN address? Any pointers much appreciated!

Best, DanC

Hey Brum-land, solved it! So I’m sharing back in-case anyone else gets this weird requirement :slight_smile:

You can’t just call atom: with a URL and it know how to handle it. Instead you need to call, atom://core/open/file?filename=.

That then attempts to open the file.

Other than that, you just need an address with a file that atom can open, so I had to find the whole path through the webdav to the file and append that to the url, then just window.open in JS.

HTH that helps someone else one day!

Proudly sponsored by Bytemark