News for hackers. Stuff that matters.
Re:Ask HN: Have you written or came across any useful AppleS... by yesenadam on Tuesday November 06, 2018 @07:48PM (#18396271)
Came across this somewhere: "cdf" changes the current bash directory to the one open in Finder.

  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"
  }

There are no comments on this comment yet.