• 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: John W Baxter <email@hidden>
  • Date: Mon, 11 Jun 2001 17:46:04 -0700

At 23:15 +0200 6/11/2001, Jan Pieter Kunst wrote:
>alias "Disk:folder1:folder2:file"
>
>How do I get just the name of the file (in the above case "file") into a
>string?

One convenient approach is to ask the Finder:

set a to alias "Blake:Users:john:Mail.app_rule.jpg"
tell application "Finder"
name of a
end tell

--> "Mail.app_rule.jpg"

This happened to be tested in Mac OS X...YMMV, although I would expect it
to work with any reasonably recent Mac OS or System version.

[For the record, Jon's Commands is not installed...only the Standard
Additions addition is present. Some variations on this sort of task would
be easier with Jon's Commands, but not this one.]

--
John Baxter email@hidden Port Ludlow, WA, USA


  • Follow-Ups:
    • Re: Getting the name of a file from an "alias"
      • From: Timothy Bates <email@hidden>
References: 
 >Getting the name of a file from an "alias" (From: Jan Pieter Kunst <email@hidden>)

  • Prev by Date: RE: Getting the name of a file from an "alias"
  • Next by Date: Re: Getting the name of a file from an "alias"
  • Previous by thread: 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