• 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: remove suffix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >remove suffix (From: email@hidden)

  • Prev by Date: Re: Screenshot of Window (using Akua Sweets)
  • Next by Date: Re: List of error codes
  • Previous by thread: remove suffix
  • Next by thread: Re: remove suffix
  • Index(es):
    • Date
    • Thread