• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Folder name from alias
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Folder name from alias


  • Subject: Re: Folder name from alias
  • From: Jolly Roger <email@hidden>
  • Date: Fri, 08 Dec 2000 16:28:51 -0600
  • Replyto: email@hidden

on 12/7/2000 11:48 PM, Rick Plummer wrote:

> I need script that will extract the folder name of a folder
> dropped on an applet (for use later inthe script).

Way faster and more reliable than "info for":

on open {theItem}
display dialog FilenameFromPath(theItem)
end open

on FilenameFromPath(thePath)
set saveDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to ":"
set pathAsList to text items of thePath
if the last character of thePath is ":" then
set idx to (the number of text items in thePath) - 1
else
set idx to -1
end if
set folderName to item idx of pathAsList
set AppleScript's text item delimiters to saveDelim
return folderName
end FilenameFromPath

Enjoy.

JR


References: 
 >Folder name from alias (From: Rick Plummer <email@hidden>)

  • Prev by Date: Re: Option-L and commas
  • Next by Date: Re: Folder name from alias
  • Previous by thread: Re: Folder name from alias
  • Next by thread: Re: Folder name from alias
  • Index(es):
    • Date
    • Thread