• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Color HTML link labels.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Tex-Edit, select only HTML lines? (From: "Marc K. Myers" <email@hidden>)

  • Prev by Date: Re: Sort items in a list without OSAXen
  • Next by Date: [ANN] Smile 1.8.4 available.
  • Previous by thread: Re: Tex-Edit, select only HTML lines?
  • Next by thread: Any Quicktime Pro experts out there??
  • Index(es):
    • Date
    • Thread