Re: remove suffix
Re: remove suffix
- Subject: Re: remove suffix
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 27 Sep 2001 01:07:39 -0700
On 9/27/01 12:31 AM, "email@hidden" <email@hidden>
wrote:
>
Hi,
>
>
I have a script that copies htm files and adds some code in them. I need to
>
add some code to this script that removes the old suffix on each file.
>
>
example:
>
Filename = myfile.htm
>
New filename = myfile
>
>
This is probably very easy to do but I dont know how to write the
>
applescript code to remove ".htm" of the filename. Today I use
>
filemanipulator to do this, but it is one extra step. So it would be great
>
to have this function in the script.
>
>
Thanks in advance!
>
Peter
set filename to text 1 thru -5 of filename
tell application "Finder" to set name of theFile to filename
If you haven't set the file to an alias theFile, then the second line would
be
tell application "Finder" to set name of alias "Mac HD:A
Folder:myfile.htm" to filename
--
Paul Berkowitz