• 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: Nigel Garvey <email@hidden>
  • Date: Thu, 27 Sep 2001 23:35:57 +0100

Paul Berkowitz wrote on 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

If you want it to work with "myfile.html" too, or with any other ".htm"
variant, use:

set filename to text 1 thru word -2 of filename

This will work with any suffixed file name where the suffix is a single
"word" and where the characters either side of the dot are not both
numeric digits.

NG


  • Prev by Date: Re: Acrobat Scripting
  • Next by Date: RE: remove suffix
  • Previous by thread: Re: remove suffix
  • Next by thread: RE: remove suffix
  • Index(es):
    • Date
    • Thread