Skip to content

Instantly share code, notes, and snippets.

@codingChewie
Last active March 26, 2021 16:22
Show Gist options
  • Save codingChewie/8f4e71f769516e96a7391eaf7fd2951e to your computer and use it in GitHub Desktop.
Save codingChewie/8f4e71f769516e96a7391eaf7fd2951e to your computer and use it in GitHub Desktop.
AppleScript to be placed in Mac's menu bar Script folder and when ran it will prompt for folder and return the path
(*
Date: 16-10-14
Developer: codingChewie
Purpose: Get the current folder path and return it to a dialog
Version: 1.0
Name: menu-bar-folder-path.scpt
Site: http://programmingmonkeys.com
*)
try
tell application "Finder"
set chooseDir to choose folder with prompt "Please select your directory"
set chooseDir to POSIX path of ((path to me as text) & "::")
end tell
on error error_message number error_number
if error_number is equal to -128 then
display notification "Folder prompt cancelled"
else
display dialog error_message
end if
end try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment