• 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: Getting the name of a file from an "alias"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the name of a file from an "alias"


  • Subject: Re: Getting the name of a file from an "alias"
  • From: Jan Pieter Kunst <email@hidden>
  • Date: Tue, 12 Jun 2001 22:41:16 +0200

Guy Parker (email@hidden) schreef op 12-06-2001 17:04 :

>> alias "Disk:folder1:folder2:file"
>>
>> How do I get just the name of the file (in the above case "file") into a
>> string?
>>
>
> Try passing your variable x to this...
>
> on GetFileName(this_filepath)
> --This routine from Apple's essential subroutine library
> set this_filepath to this_filepath as text
> set x to the offset of ":" in (the reverse of every character of
> this_filepath) as string
> return ((characters -(x - 1) thru -1 of this_filepath) as text)
> end GetFileName

I didn't use this for the name of the file (it was more convenient to tell
the Finder to provide me with the name of the alias) but I did use your
technique to split the filename in name and extension. Thanks for the tip.

JP


References: 
 >Re: Getting the name of a file from an "alias" (From: Guy Parker <email@hidden>)

  • Prev by Date: Re: D'OH!
  • Next by Date: Fwd: MW Events URL Change - Ilene's Machine
  • Previous by thread: Re: Getting the name of a file from an "alias"
  • Next by thread: Re: Getting the name of a file from an "alias"
  • Index(es):
    • Date
    • Thread