Re: Getting filename without extension...
Re: Getting filename without extension...
- Subject: Re: Getting filename without extension...
- From: Malcolm Fitzgerald <email@hidden>
- Date: Thu, 5 May 2005 17:45:23 +1000
On May 4, 2005, at 6:48 PM, Malcolm Fitzgerald wrote:
StripSuffix("word.doc.pdf")
to StripSuffix(x)
set my text item delimiters to "."
return reverse of (rest of (reverse of (text items of x))) as
string
end StripSuffix
On 05/05/2005, at 2:03 PM, Michelle Steiner wrote:
That fails if there is no file extension.
I was only trying to get the meat of the sandwich into one line. This
version is more robust:
to StripSuffix(x)
set my text item delimiters to "."
set y to text items of x
if length of y > 1 then return reverse of (rest of (reverse of y)) as
string
return x
end StripSuffix
Malcolm Fitzgerald ph: 02 93180877
Database Manager fax: 02 93180530
The Australian Society of Authors www.asauthors.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden