Skip to content

Instantly share code, notes, and snippets.

@alecmce
Created November 5, 2011 00:09
Show Gist options
  • Select an option

  • Save alecmce/1340845 to your computer and use it in GitHub Desktop.

Select an option

Save alecmce/1340845 to your computer and use it in GitHub Desktop.
cd to the front finder's location
# cdf: cd to the front finder's location
cdf ()
{
currFolderPath=$( /usr/bin/osascript <<" EOT"
tell application "Finder"
try
set currFolder to (folder of the front window as alias)
on error
set currFolder to (path to desktop folder as alias)
end try
POSIX path of currFolder
end tell
EOT
)
echo "cd to "$currFolderPath""
cd "$currFolderPath"
}
@alecmce

alecmce commented Nov 5, 2011

Copy link
Copy Markdown
Author

@devboy

devboy commented Nov 5, 2011

Copy link
Copy Markdown

nice

@n0an

n0an commented Dec 22, 2019

Copy link
Copy Markdown

thanks!

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