2 Replies Latest reply on Mar 19, 2009 12:44 AM by Newsgroup_User

    In need of reading and stripping out <a href> links in an off-line HTML file

    Level 7
      Hi there.

      I'm in need of some guidance with respect to the reading of a local
      (off-line) HTML file, in doing so I need to identfy all of the links held
      within the HTML file, ie., <a href...> ... </a> and have them populate a
      seperate list.

      My problem is in that in all of my years of using Director I've never dealt
      with external files to this kind of degree - and having take quite a break
      from Lingo for quite sometime as well, I'm kind of stuck as to where the
      heck I should start!!

      Any help/guidance would be hugely appreciated.

      Many thanks in advance.

      Thanks, Mark.


        • 1. Re: In need of reading and stripping out &lt;a href&gt; links in an off-line HTML file
          johnAq Level 1
          To get you started, there is some simple built-in Lingo (at least up unti Director 10 - I don't have D11 and they changed the text engine so....)

          1) Use Fileio to read in the html file into a string variable

          2) Set the .html property of a #text member to the string variable text you read in from your file. This will automatically treat all of the links in the html and hyperlinks in the text member.

          3) You can now access the .hyperlinks property of the text member, which will give you a list of all the links in the text - each entry in the list is a list of two items - the start and end chars of the hyperlink

          From there you should be able to rework things into a format you require

          hth


          johnAq
          • 2. Re: In need of reading and stripping out &lt;a href&gt; links in an off-line HTML file
            Level 7
            Many thanks johnAq - your help is very much appreciated.

            Kind regards, Mark.

            "johnAq" <webforumsuser@macromedia.com> wrote in message
            news:gppbu1$cpu$1@forums.macromedia.com...
            > To get you started, there is some simple built-in Lingo (at least up unti
            > Director 10 - I don't have D11 and they changed the text engine so....)
            >
            > 1) Use Fileio to read in the html file into a string variable
            >
            > 2) Set the .html property of a #text member to the string variable text
            > you
            > read in from your file. This will automatically treat all of the links in
            > the
            > html and hyperlinks in the text member.
            >
            > 3) You can now access the .hyperlinks property of the text member, which
            > will
            > give you a list of all the links in the text - each entry in the list is a
            > list
            > of two items - the start and end chars of the hyperlink
            >
            > From there you should be able to rework things into a format you require
            >
            > hth
            >
            >
            > johnAq
            >