• 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
Applescript & Tex-Edit Plus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Applescript & Tex-Edit Plus


  • Subject: Applescript & Tex-Edit Plus
  • From: List Guy <email@hidden>
  • Date: Thu, 23 Aug 2001 15:01:33 -0700

> What I need to do is set the text to a column regardless of the number of
> digits. This means I need to conditionally insert or delete spaces after the
> first non-space characters and reassemble the string.
> How do I use string manipulation functions in Tex-Edit?

Document:
1 aaaa
23 bbb
300 cccccc

script:

set column_width to " " -- 12 spaces
tell application "Tex-Edit Plus" to set paragraph_count to count of
paragraphs in document 1
repeat with loop_counter from 1 to paragraph_count
tell application "Tex-Edit Plus" to set original_num to word 1 of
paragraph loop_counter of document 1
set number_length to length of (original_num as text)
set alignment_spaces to text 1 thru ((length of column_width) -
number_length) of column_width
tell application "Tex-Edit Plus" to copy alignment_spaces to after word
1 of paragraph loop_counter of document 1
end repeat

result:

1 aaaaa
27 bbbbb
300 ccccc

Is this what you intend?

grh


  • Follow-Ups:
    • Re: Applescript & Tex-Edit Plus
      • From: Rachel <email@hidden>
  • Prev by Date: Re: QuickTime Time from SMPTE Time
  • Next by Date: Re: Quit an application
  • Previous by thread: Re: Excel- column 3 vs. cell C3
  • Next by thread: Re: Applescript & Tex-Edit Plus
  • Index(es):
    • Date
    • Thread