Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Koby3663

macrumors newbie
Original poster
Feb 2, 2011
2
0
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
 
Thanks for this

I know you posted this awhile ago, but thanks for putting it up. It was a simple thing that was hanging me up as well.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.