Skip to content

Instantly share code, notes, and snippets.

@sushidub
Last active January 12, 2021 15:43
Show Gist options
  • Save sushidub/f024663297b9b8540cfa402cc5452d7a to your computer and use it in GitHub Desktop.
Save sushidub/f024663297b9b8540cfa402cc5452d7a to your computer and use it in GitHub Desktop.
Setup and launch a new VSCode project (workspace) from macOS Finder with one click. Workspace/Project name is derived from the selected folder the action is run against.

Requirements

macOS Automator bin/bash (or any command line flavor that supports printf) VSCode

Installation

  • Download the .workflow file (via Dropbox, and don't worry its code signed)

  • Open Automator - import/open the .workflow file - resave to username/Library/Services folder — or do it all via terminal

      cd <whatever folder the .workflow file was downloaded to>
      mv ./'Make VSCode Project.workflow' ~/Library/Services
    

Usage

In Finder, highlight or right-click any folder that will act as the root folder of a new VSCode workspace/project.

In the contextual menu, hover over the Services menu item (usually at the bottom of the list). Alternatively use the Services menu item located under Finders main menu.

Select the Make VSCode Project option.

This will then create a workspace file named after the selected folder (which can always be changed after initial creation).

VSCode will then automatically launch in the context of the new project workspace.

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