Skip to content

Instantly share code, notes, and snippets.

@defmech
Last active October 9, 2018 11:45
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 defmech/1994d487731f1b429e3cdb55bf0eeff2 to your computer and use it in GitHub Desktop.
Save defmech/1994d487731f1b429e3cdb55bf0eeff2 to your computer and use it in GitHub Desktop.
AppleScript to copy current folder directory listing to pasteboard
tell application "Finder"
set currentDirPath to (target of front Finder window) as text
set folderName to name of folder currentDirPath
end tell
tell application "Terminal"
do shell script "cd " & (quoted form of POSIX path of currentDirPath) & "; ls | pbcopy"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment