Skip to content

Instantly share code, notes, and snippets.

@defmech
Last active October 9, 2018 11:45
Show Gist options
  • 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