Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewhudson/1b21e1a689d0c2ed4fd1d1c1593a2d53 to your computer and use it in GitHub Desktop.
Save matthewhudson/1b21e1a689d0c2ed4fd1d1c1593a2d53 to your computer and use it in GitHub Desktop.
“Open in Atom” in macOS context-menu

Open in Atom

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /usr/local/bin/atom -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Atom

Add to Atom

Let's repeat the steps above for a second entry, this time to add files or folders to an existing Atom window

  • Open Automator
  • Create a new Service
  • Add a Run Shell Script action
  • Set “Service receives selected” to files or folders in any application
  • Set the script action to /usr/local/bin/atom -a "$@"
  • Set “Pass input” to as arguments
  • Save as Add to Atom

Keyboard Shortcuts

You can assign a global shortcut to run the services we just created

  • Open “System Preferences”
  • Select “Keyboard” then the “Shortcuts” tab
  • In the left pane, click on “Services”
  • In the right pane, scroll to “Files and Folders”
  • Select “Open in Atom” (or “Add to Atom”) and click “add shortcut”
  • Select a shortcut

Edit Context Menu items

You might want to rename or edit the items we just created

  • Activate Finder
  • Click on “Finder” in the Apple menu, select “Services” then “Services Preferences”
  • In the right pane, scroll to “Files and Folders” and scroll to the item you want to edit
  • Right click the item and select “Open in Automator”
  • Edit and save

Alternatively, you can edit the workflow (e.g. ~/Library/Services/Open in Atom.workflow) in your preferred text editor

@mngarwood
Copy link

So useful, thanks! For anyone else not sure what type to select in the beginning (Service isn't an option now), you want "Quick Action" with the gear icon.

@zhanwenchen
Copy link

So useful, thanks! For anyone else not sure what type to select in the beginning (Service isn't an option now), you want "Quick Action" with the gear icon.

Worked for me!

@chinmayjade
Copy link

Worked for me! Thanks!

@chinmayjade
Copy link

Hi @matthewhudson , this doesn't work on Apple Silicon (M1/M2) macs anymore.
Are you able to update/revise the instructions?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment