Skip to content

Instantly share code, notes, and snippets.

@shibaku
Last active September 22, 2022 00:55
Show Gist options
  • Save shibaku/249ecd9e44b83807f84b to your computer and use it in GitHub Desktop.
Save shibaku/249ecd9e44b83807f84b to your computer and use it in GitHub Desktop.
Applescript to return name, path, and path to parent folder of a given folder in Finder.
tell application "Finder"
set FolderPath to (choose folder) -- sets file path to folder you select
set ParentFolder to container of FolderPath -- sets the parent folder of the folder you select
set Foldername to name of folder FolderPath -- sets the folder name as text
display dialog FolderPath as text
display dialog ParentFolder as text
display dialog Foldername as text
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment