• 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: applescript-users digest, Vol 2 #113 - 11 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applescript-users digest, Vol 2 #113 - 11 msgs


  • Subject: Re: applescript-users digest, Vol 2 #113 - 11 msgs
  • From: email@hidden
  • Date: Fri, 8 Dec 2000 21:00:14 EST

In a message dated 12/8/00 8:29:28 PM,
email@hidden writes:

>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


I tried to run this script and I get an error "Can't get every text item of
alias (somefolder)" which errors on the line:

set pathAsList to text items of thePath

I'm on OS 8.6. Is this new language for OS 9?

Also, just curious...

Instead of:
set idx to (the number of text items in thePath) - 1

can't you just say:
set idx to -2

Ken Fleisher
email@hidden


  • Follow-Ups:
    • Re: applescript-users digest, Vol 2 #113 - 11 msgs
      • From: SemiColon <email@hidden>
    • Re: applescript-users digest, Vol 2 #113 - 11 msgs
      • From: Paul Berkowitz <email@hidden>
    • Re: applescript-users digest, Vol 2 #113 - 11 msgs
      • From: Jolly Roger <email@hidden>
  • Prev by Date: Re: Apple System Profiler
  • Next by Date: Re: applescript-users digest, Vol 2 #113 - 11 msgs
  • Previous by thread: With timeout of
  • Next by thread: Re: applescript-users digest, Vol 2 #113 - 11 msgs
  • Index(es):
    • Date
    • Thread