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

Re: Wrapping lines


  • Subject: Re: Wrapping lines
  • From: email@hidden
  • Date: Wed, 5 Dec 2001 06:32:28 -0600

At 11:29 +0000 12/05/2001, has wrought:

>John Fountain wrote:
>
>>I have a script that I wrote that wraps lines of text if they are more
>>than 31 characters long. It is basically a kludge of if...thens that
>>gets the job done but i can't help but think there must be a cleaner way
>>to do this. Has anyone out there written a script like this before? I am
> >interested to see other attempts at doing this.
______________________________________________________________________

Greetings,

The WrapText osax is quite nice for this sort of thing:

http://www.bekkoame.ne.jp/~iimori/sw/WrapTextOSAX.html

-- Wrap Text
--
-- theDirectParam: string,
-- width: optional, small integer, Wrap width by bytes. Default is 76.
-- prefix: optional, string, Add this string to beginning of each lines
-- remove: optional, string, Remove this string from beginning of each lines
-- onlyLongLines: optional, boolean, Wrap only long lines
-- scriptCode: optional, small integer, Script code of text. Use system script when omitted.
-- result: string, wrapped text

WrapText theDirectParam ,
width theWidth ,
prefix "string-value" ,
remove "string-value" ,
with/without onlyLongLines ,
scriptCode theScriptCode


----------------------------------------------------------------------
set theText to "Now is the time for all good men to come to the aid of their country."

set newText to WrapText theText width 31

--> Result:

Now is the time for all good
men to come to the aid of their
country.
----------------------------------------------------------------------


Best Regards,

Christopher Stone
______________________________
StoneWorks Computer Consulting
email@hidden


  • Follow-Ups:
    • Re: Wrapping lines
      • From: garbanzito <email@hidden>
References: 
 >Re: Wrapping lines (From: has <email@hidden>)

  • Prev by Date: Re: Temporary items folder in OS 9.1
  • Next by Date: Re: Temporary items folder in OS 9.1
  • Previous by thread: Re: Wrapping lines
  • Next by thread: Re: Wrapping lines
  • Index(es):
    • Date
    • Thread