How to add "Open with VS Code" to right-click menu in macOS Finder

How to add "Open with VS Code" to right-click menu in macOS Finder

I will introduce a method to open files and folders directly in VS Code from the right-click menu in macOS Finder. You can set this up simply by creating a Quick Action using the built-in Automator app.
2026.03.06

This page has been translated by machine translation. View original

Introduction

In Windows, when you install VS Code, "Open with Code" is automatically added to the right-click menu, but macOS doesn't have this feature.

I wanted to set up the same functionality in macOS to open files or folders in VS Code from the Finder's right-click menu, so I used the built-in Automator app to configure this. Once set up, you can use it indefinitely.

Prerequisites/Environment

  • macOS (confirmed on macOS Sequoia for this article)
  • Visual Studio Code already installed (located in the Applications folder)

Steps

1. Launch Automator

Press Cmd + Space to open Spotlight, type "Automator" and press Enter.

Screenshot 2026-03-05 9.01.22

2. Create a new Quick Action

After launching Automator, click "New Document" and select "Quick Action".

Screenshot 2026-03-05 9.06.24

3. Configure the workflow settings

Change the settings at the top of the workflow screen as follows:

  • Set "Workflow receives current" to files or folders
  • Set "in" to Finder

Screenshot 2026-03-05 9.36.45

4. Add an action

  • Type "Open Finder Items" in the search bar in the top-left
  • Drag and drop the displayed "Open Finder Items" action to the gray area on the right

Screenshot 2026-03-05 9.39.08

  • Change the "Open with:" dropdown in the action to Visual Studio Code

Screenshot 2026-03-05 9.40.21

If VS Code doesn't appear in the list, click "Other..." and select Visual Studio Code from the Applications folder.

5. Save it

Press Cmd + S and save it with the name "Open in VS Code".

Screenshot 2026-03-05 9.41.17

6. (Optional) Set an icon

Setting a custom icon for the Quick Action makes it visually easier to identify in the right-click menu.

Screenshot 2026-03-05 16.48.30

  • With the Quick Action open in Automator, click "Choose..." from the dropdown next to "Image" at the top of the workflow, and select the downloaded SVG file

Screenshot 2026-03-05 17.17.14

However, setting it as is will display the icon with distorted aspect ratio. To fix this, open the downloaded SVG file in a text editor.

Screenshot 2026-03-05 9.32.04

Make the following two changes to the <svg> tag:

  • Add preserveAspectRatio="none"
  • Set the width value to twice the height (e.g., if height="100", then width="200")

Before:

<svg width="100" height="100" viewBox="0 0 100 100"...<omitted>

After:

<svg width="200" height="100" viewBox="0 0 100 100" preserveAspectRatio="none" ...<omitted>

This is because macOS renders Quick Action icons in a horizontally elongated area. The above settings will make the aspect ratio appear correct visually.

After making changes, save and set the icon again in Automator.

Screenshot 2026-03-05 9.37.40

Verification

Once the setup is complete, verify the functionality with these steps:

  1. Right-click on any file or folder in Finder
  2. Hover over "Quick Actions" in the menu
  3. Select "Open in VS Code"
  4. Confirm that the selected file/folder opens in VS Code

Advanced: Create an action to open in Terminal

Using the same steps, you can also create a "Open in Terminal" action for the Finder's right-click menu. Just select Terminal for the "Open with:" option in step 4, and save it as "Open in Terminal".

Screenshot 2026-03-05 10.00.29

The icon setting method is also similar.

Summary

Using Automator, a standard macOS application, we were able to add an option to open files in VS Code to the Finder's right-click menu. It's convenient as there's no need to install third-party tools, and once set up, it can be used permanently.

This setting is recommended for those who have migrated from Windows or find it troublesome to type code . in the terminal.

Share this article

FacebookHatena blogX