DEV Community

Cover image for Adding 'Open in Visual Studio Code' to Your Mac's Right-Click Action Menu
Rafa Rafael
Rafa Rafael

Posted on

Adding 'Open in Visual Studio Code' to Your Mac's Right-Click Action Menu

As an Ubuntu user, I had grown accustomed to the convenience of opening a project folder in VS Code with a simple right-click. When I transitioned to Mac, I was initially surprised to find that this handy feature wasn't readily available.

However, I was pleased to discover that I could recreate this functionality by leveraging the capabilities of Mac's Automator. This nifty tool allowed me to integrate the right-click functionality to open folders in VS Code seamlessly, effectively tailoring the Mac experience to match my workflow preferences.

Should you wish to embark on this small but mighty quest to bestow upon your Mac the almighty power of 'right-click to open with VS Code', here's the enchanted scroll of instructions I followed:

  1. Open Automator.
  2. Choose Quick Action.
  3. Under Library select Files...olders (Files or Folders).
  4. In the next column select Open Finder Items.
  5. In Workflow receive current field change the value to Automatic (files or folders) if not set.
  6. And at in field select Finder in the dropdown.
  7. Then under Open Finder Items select Visual Studio Code in the dropdown. If Visual Studio Code doesn't appear in the list, choose Other. You can then locate and select it from the file browser dialog that appears.

Mac Automator

If your screen is a mirror image of the one above, it's time to perform the sacred keystroke combo: press Cmd+S to seal the deal with a save. Congratulations, you're now a click away from opening files or folders with the ease of a seasoned Mac whisperer, just like shown below.:

Context menu

Enjoy!

Top comments (1)

Collapse
 
xwchristina profile image
XWChristina

That's very helpful. Thank you! I encountered a similar challenge when switching to macOS. Unlike your experience, I used iBoysoft MagicMenu to right-click to quickly open files with VS Code. This utility comes equipped with a Launch With extension, enabling me to directly open the target file or folder with any installed code editor on Mac, including VSCode, iTerm2, Warp, TextEdit, Terminal, Sublime Text, JetBrains Apps, Cursor, CodeRunner, HexEdit, BBEdit, and Atom.