Hey I just could not find a simple resource to get these three things out of a folder path. This takes the folder and breaks it down to 3 levels the folder name, folder path, and the parent folder path.
Code:
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