Re: Getting the name of a file from an "alias"
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