Re: Tex-Edit, get wild text, even one letter.
Re: Tex-Edit, get wild text, even one letter.
- Subject: Re: Tex-Edit, get wild text, even one letter.
- From: AppleScript Guru <email@hidden>
- Date: Sat, 06 Oct 2001 11:47:47 -0400
Rachel,
on 10/6/01 10:47 AM, you said:
>
I am using "r>^*<" to specify text to select, I want to select only the
>
characters between but not including characters "><"
>
This will not process one character, even if I insert a space to make two:
---> I haven't really Scripted Tex-Edit Pro too much, so there may be a
better way to do this. Give this a try...
tell application "Tex-Edit Plus"
tell window 1
repeat with i from 1 to (count lines)
if line i starts with "<td" then
search line i looking for "r>^*<"
select characters 3 thru -2 of selection
set color of every character of selection to red
end if
end repeat
end tell
end tell
Notes:
* Use -2 instead of -1. -1 will be the last character (the first character
from the end), which is "<", unless that's what you want too.
* Specify the name of the color, and not the number, and don't put it in
quotes. I believe that there are quite a few example scripts that come with
this application. I would recommend checking them out if you haven't
already.
The above script worked for me.
-Ben
Benjamin S. Waldie
Write Track Media
(AppleScript GuRu)
AppleScript Web Site:
http://www.AppleScriptGuru.com
http://www.wtmedia.com