Applescript & Tex-Edit Plus
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