Re: Folder question
Re: Folder question
- Subject: Re: Folder question
- From: Emmanuel <email@hidden>
- Date: Thu, 11 Dec 2003 09:44:22 +0100
At 11:52 AM -0800 10/12/03, Walter Ian Kaye wrote:
>
At 01:50p -0500 12/10/2003, Chris Garaffa didst inscribe upon an electronic papyrus:
>
>
>If you want the full path, try this:
>
>set myPath to path to me as text
>
>set oldTIDs to AppleScript's text item delimiters
>
>set AppleScript's text item delimiters to ":"
>
>set myPath to every text item of myPath
>
>set myPath to items 1 through ((count myPath) - 1) of myPath as string
>
>--myPath is now the path, for example "drop:Users:cgaraffa:Desktop"
>
>set AppleScript's text item delimiters to oldTIDs
>
>
Or to use the Finder:
>
set myAlias to path to me
>
tell app "Finder" to set myFolderPath to container of myAlias as alias as string
>
(* include the 'as alias' if you want the trailing colon *)
>
>
>Otherwise, if you just want the name of the parent folder, try:
>
>set myPath to path to me as text
>
>set oldTIDs to AppleScript's text item delimiters
>
>set AppleScript's text item delimiters to ":"
>
>set myPath to every text item of myPath
>
>set myPath to item ((count myPath) - 1) of myPath
>
>--myPath is now the parent folder, for example "Desktop"
>
>set AppleScript's text item delimiters to oldTIDs
>
>
Or to use the Finder:
>
set myAlias to path to me
>
tell app "Finder" to set myFolderName to name of myAlias
You mean "name of container of myAlias", don't you.
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.