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: Guy Parker <email@hidden>
- Date: Tue, 12 Jun 2001 16:04:34 +0100
>
Let's say I have an variable x in my script that is set to an "alias". So,
>
the value of x is:
>
>
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
Guy.