Re: Test for multiples a character in a paragraph- Tex-Edit or OSAX
Re: Test for multiples a character in a paragraph- Tex-Edit or OSAX
- Subject: Re: Test for multiples a character in a paragraph- Tex-Edit or OSAX
- From: "Marc K. Myers" <email@hidden>
- Date: Fri, 26 Jan 2001 19:26:59 -0500
- Organization: [very little]
Xandra Lee wrote:
>
Subject: Test for multiples a character in a paragraph- Tex-Edit or OSAX
>
Date: Fri, 26 Jan 2001 18:06:30 -0500
>
From: Xandra Lee <email@hidden>
>
To: "AS lists" <email@hidden>
>
>
Given some text is there any way to search for multiple instances of a
>
character in each paragraph. Then replace only specific instances?
>
>
I need to look at each paragraph seperately, and if there's MORE than
>
one tab character (ascii 9), I need to replace all But the first with
>
ascii 11 (verttab).
>
>
so that
>
Some text (tab mark) moretext (tabmark) more text.ascii 13
>
-->
>
Some text (tab mark) moretext (ascii 11) moretext. (ascii 13)
>
anytime more that there is more than 1 tab mark in a document.
>
>
I'm trying to Applescript this with Tex-Edit, but if there's an OSAX that
>
can do this elegantly I'm game.
>
>
Ideas?
tell window 1
set paraCnt to count paragraphs
repeat with i from 1 to paraCnt
set vTab to ASCII character 11
set aTab to (search paragraph i looking for "^t")
if aTab then
repeat until not aTab
set aTab to (search paragraph i looking for "^t" [optn-L]
finding next searching from cursor)
if aTab then
set the selection to vTab
end if
end repeat
end if
end repeat
end tell
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[1/26/01 7:24:44 PM]