Menu
Zero One Labs
  • Home
  • About
  • Scripts
  • Snippets
Zero One Labs

“Open with VS Code” shortcut in Finder

Posted on March 17, 2021March 17, 2021 by Zan

Here is how to create your own “Open with…” right-click menu item under MacOS’s “Quick Actions” menu:

  1. Open the Automator app on your Mac
  2. Choose “New Document” -> “Quick Action”
  3. On the left-hand column, search for “Run Shell Script” and add it to the workflow on the right.
  4. For the shell script, you’ll want to enter the following text:
    "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code" "$1"
  5. Change the “Pass Input” drop-down to “as arguments”
  6. At the top of the workflow parameters, change “Workflow receives current” to “files or folders” and in “Finder”.
  7. You can change the image icon to whatever you want.
  8. File -> Save -> “Open with VS Code” (hint: the filename you save this as will reflect how it shows up on the Finder contextual menu)
  9. Save in the default path, prompted by Automator.
  10. All done! You can now access your new custom action by right-clicking on a file or folder in the Finder.

Side note: You need VS Code installed on your Mac (if that wasn’t obvious).

Here’s what the Automator configuration window ought to look like:

Automator configuration for opening a file or folder with VS Code in MacOS Finder
Automator configuration for opening a file or folder with VS Code in MacOS Finder

Here is how you can access the “Quick Actions” from the Finder contextual menu:

  • Automator
  • VS COde
  • Leave a Reply Cancel reply

    You must be logged in to post a comment.

    Login with your Social ID

    Categories

    • Articles
    • Bash
    • Mac
    • PackageMaker
    • Python
    • Scripts
    • Terminal
    • Uncategorized
    My LinkedIn
    ©2023 Zero One Labs | Powered by WordPress & Superb Themes