Loading ...
Sorry, an error occurred while loading the content.
 

Removing link with button

Expand Messages
  • Chris Valentine
    I m trying to remove a link with a button image from an HTML file. This is the clip I ve got so far but it doesn t appear to select the text correctly before
    Message 1 of 3 , Aug 31, 2004
      I'm trying to remove a link with a button image from an HTML file.
      This is the clip I've got so far but it doesn't appear to select the
      text correctly before deleting it:

      ^!Jump Text_Start
      :HTMLs
      ^!Clearvariables
      ^!Find <A HREF="http://www.whsmith.co.uk TIS
      ^!IfError End
      ^!Set %Cursor%=^$Getrow$:^$Getcol$
      ^!Find </A> TIS
      ^!SelectTo ^%Cursor%
      ^!InsertText ^%Empty%
      ^!GoTo HTMLs
      :End

      The links look like this, but are slightly different each time, where
      the ISBN number is unique to each link:

      <A HREF="http://www.whsmith.co.uk/whs/go.asp?
      menu=Books&shop=2969&isbn=0747260672"><IMG SRC="icons/buy.GIF"
      BORDER="0"></A>

      I want all of this to disappear but to not affect anything else in
      the same line. The links are inside <TH>, which are sometimes closed
      but often not, ie: there isn't always a </TH>

      I can't use ^!Select HTMLTag because it only selects the first tag,
      ignoring the button inside the link and the </A> - hence the attempt
      to find the first part of the link, then the </A> before selecting
      back to the start of the link. But I'm left with the </A>. I tried
      using ^!MoveCursor but that seemed to make it worse - no number would
      make it select from the end of the </A>.

      Thanks,
      Chris.
    • Hugo Paulissen
      ... ^!Jump SELECT_END should do the trick - after your search for . BTW: it is safer to surround your searchstrings with quotes, especially if a quote
      Message 2 of 3 , Aug 31, 2004
        > to find the first part of the link, then the </A> before selecting
        > back to the start of the link. But I'm left with the </A>. I tried
        > using ^!MoveCursor but that seemed to make it worse

        ^!Jump SELECT_END should do the trick - after your search for </A>.

        BTW: it is safer to surround your searchstrings with quotes,
        especially if a quote appears in the strng itself...

        ^!Find "<A HREF="http://www.whsmith.co.uk" TIS

        Hugo
      • Chris Valentine
        ... Yes - that did the trick. Thanks. Chris.
        Message 3 of 3 , Sep 1, 2004
          --- In ntb-clips@yahoogroups.com, "Hugo Paulissen"
          <hugopaulissen@s...> wrote:
          >
          > ^!Jump SELECT_END should do the trick - after your search for </A>.

          Yes - that did the trick. Thanks.

          Chris.
        Your message has been successfully submitted and would be delivered to recipients shortly.