Skip to content

Instantly share code, notes, and snippets.

@rbaulin
Created October 4, 2015 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbaulin/24a7297aaef552fec236 to your computer and use it in GitHub Desktop.
Save rbaulin/24a7297aaef552fec236 to your computer and use it in GitHub Desktop.
# open terminal here service
# works in OSX El Capitan
# to install create new Automator Service with Run Shell script below
# original script http://protips.maxmasnick.com/cdff-cd-to-the-path-of-the-front-most-finder-window
function ff { osascript -e 'tell application "Finder"'\
-e "if (${1-1} <= (count Finder windows)) then"\
-e "get POSIX path of (target of window ${1-1} as alias)"\
-e 'else' -e 'get POSIX path of (desktop as alias)'\
-e 'end if' -e 'end tell'; };\
open -a Terminal $(ff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment