Re: Tex-Edit, select only HTML lines?
Re: Tex-Edit, select only HTML lines?
- Subject: Re: Tex-Edit, select only HTML lines?
- From: "Marc K. Myers" <email@hidden>
- Date: Sun, 02 Sep 2001 14:37:35 -0400
- Organization: [very little]
>
Date: Sun, 02 Sep 2001 07:30:18 -0600
>
Subject: Tex-Edit, select only HTML lines?
>
From: Rachel <email@hidden>
>
To: AppleScript List <email@hidden>
>
>
1:
>
I said: "if character 1 of line i is "<" then" and this works
>
but "if word 1 of line i is "<a" does not work.
>
and "if character 1 thru 2 of line i is "<a" does not work.
>
so how do I select only lines starting with "<a href" ???
>
>
2:
>
I said: "replace selection looking for ">^*<" replacing with "^*"
>
replacing with styles {color:blue}"
>
however I do not want to color the ">" and "<" characters. How do I select
>
only the text between them?
>
>
3:
>
I then said: replace selection looking for "<" replacing with "<"
>
replacing with styles {color:black}
>
but this does not work. How do I find a certain character in a selection?
1:
tell window 1 of application "Tex-Edit Plus"
repeat with i from 1 to (count lines)
set thisLine to line i
if thisLine starts with "<A HREF=" then
display dialog line i
end if
end repeat
end tell
2:
tell application "Tex-Edit Plus"
search window 1 looking for ">^*<"
if result is true then
select characters 2 thru -2 of the selection
end if
end tell
3:
This works for me. Are you sure you have the text selected when that
part of the script is run?
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[9/2/01 2:36:36 PM]