Skip to content

Instantly share code, notes, and snippets.

@2bbb
Created February 28, 2017 11:56
Show Gist options
  • Select an option

  • Save 2bbb/f1396075f9ee4deed3d56892aae57961 to your computer and use it in GitHub Desktop.

Select an option

Save 2bbb/f1396075f9ee4deed3d56892aae57961 to your computer and use it in GitHub Desktop.
open directory on current Finder window on code
const Finder = Application("Finder");
Finder.activate();
const window = Finder.finderWindows()[0];
const path = decodeURI(window.target().url().slice(7));
const currentApp = Application.currentApplication();
currentApp.includeStandardAdditions = true;
currentApp.doShellScript("/usr/local/bin/code " + path);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment