Color HTML link labels.
Color HTML link labels.
- Subject: Color HTML link labels.
- From: Rachel <email@hidden>
- Date: Tue, 04 Sep 2001 08:07:52 -0600
Marc:
Thanks again, Here is what did it:
Script:Color Link label text
tell window 1 of application "Tex-Edit Plus"
repeat with i from 1 to (count lines)
if line i starts with "<A" then
search line i looking for ">^*<"
select characters 2 thru -2 of the selection
set color of selection to blue
end if
end repeat
end tell
http://www.gnarlodious.com/
Entity Marc K. Myers spoke thus:
>
> 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