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

Re: [NTB] Appending data

Expand Messages
  • hsavage
    ... Sorry, I had the syntax off on the line using ^##. The other line using; ^$GetFileName(L: footer.htm)$ should have worked. I don t have a L: drive but I
    Message 1 of 8 , Dec 6, 2004
    • 0 Attachment
      dvdwriters12 wrote:
      >
      > but they all seem to return it as
      > http://www.domain.com/C:\Temp\somefile.htm
      >
      > The ^$GetFileName routine works but you need to hard encode the
      > filename which is no use for the script as I need to put the
      > currentfilename in.
      >
      > There must be an easy way to do this without having to manipulate
      > strings ?

      Sorry, I had the syntax off on the line using ^##. The other line using;
      ^$GetFileName(L:\footer.htm)$
      should have worked.

      I don't have a L: drive but I put footer.htm into the root of c: and it
      worked fine.

      I made an 'append simple' clip that does the job also, but in both cases
      you must have the file, I guess the name is footer.htm.

      In the next clip you can use either set variable line, not both. The
      first set is commented out with a semi_colon.


      H="Append_Footer_To_File"
      ; the insert line returned this line at bottom of footer.htm.
      ; <a href="http://www.domain.com/footer.htm" target="_blank">NewPage</a>
      ;
      ;^!Set %footer%=^?{Update Site Footer with active document name=<a
      href="http://www.domain.com/^$GetFileName(^##)$"
      target="_blank">NewPage</a>}
      ;
      ; the insert line returned this line at bottom of footer.htm.
      ; <a href="http://www.domain.com/footer.htm" target="_blank">NewPage</a>
      ;
      ^!Set %footer%=^?{Update Site Footer with active document name=<a
      href="http://www.domain.com/^$GetFileName(L:\footer.htm)$"
      target="_blank">NewPage</a>}
      ;
      ; makes the addition to whichever
      ; file is loaded and focused,
      ^!Jump TEXT_END
      ^!InsertText ^%nl%^%footer%
      ^!Save
      :END


      H="Append Simple"
      ; the insert line returned this line at bottom of footer.htm.
      ; <a href="http://www.domain.com/footer.htm" target="_blank">NewPage</a>}
      ^!Jump TEXT_END
      ^!InsertText ^%nl%<a
      href="http://www.domain.com/^$GetFileName(c:\footer.htm)$"
      target="_blank">NewPage</a>}
      ^!Save

      ºvº
      hrs <04-12-06> hsavage@...
    • dvdwriters12
      The clips works. But it should be inserting the filename of the active document into the footer.htm file for use on the webserver. So it could be the
      Message 2 of 8 , Dec 7, 2004
      • 0 Attachment
        The clips works.

        But it should be inserting the filename of the active document into the "footer.htm" file for use on the webserver.

        So it could be the links.htm page that is currently open in notetab and if that is the case it should put the link (NOT Contents) "http://www.domain.com/links.htm" into the file "footer.htm".

        The problem is that none of the functions I can see return just purely the filename - they return it as:

        C:\Temp\somefile.htm

        So is there a command to return it as (with out using strcpys):

        somefile.htm

        It seems simple enough but I cant find the command.
      • Pete Turner
        ... From the Help file: ^$GetFileName(FileName)$ Returns the name and extension of FileName (without path). Pete
        Message 3 of 8 , Dec 7, 2004
        • 0 Attachment
          > The problem is that none of the functions I can see return
          > just purely the filename - they return it as:
          >
          > C:\Temp\somefile.htm
          >
          > So is there a command to return it as (with out using strcpys):
          >
          > somefile.htm
          >
          > It seems simple enough but I cant find the command.


          From the Help file:

          ^$GetFileName(FileName)$
          Returns the name and extension of FileName (without path).


          Pete
        • hsavage
          ... the footer.htm file for use on the webserver. ... and if that is the case it should put the link (NOT Contents) http://www.domain.com/links.htm into
          Message 4 of 8 , Dec 7, 2004
          • 0 Attachment
            dvdwriters12 wrote:
            >
            > The clips works.
            >
            > But it should be inserting the filename of the active document into
            the "footer.htm" file for use on the webserver.
            >
            > So it could be the links.htm page that is currently open in notetab
            and if that is the case it should put the link (NOT Contents)
            "http://www.domain.com/links.htm" into the file "footer.htm".
            >
            > The problem is that none of the functions I can see return just
            purely the filename - they return it as:
            >
            > C:\Temp\somefile.htm

            dvd,

            You have the command, contained in the script I edited.

            Let me define the objective, as I understand it, to make sure I know
            what you want to do.

            • You have a file, e.g., c:\links.htm, loaded into NoteTab.

            • You have a file, e.g., c:\footer.htm, not loaded.

            • You want to add a link to the bottom of c:\footer.htm referring back
            to c:\links.htm, the file you're viewing, minus the path.


            If this is the objective, either of the following 2 clips will do the job.

            Clip 1 requires no interaction other than running the clip. Clip 2
            shows the clip wizard as you had it in the original clip.

            These 2 lines are exactly what is appended to c:\footer.htm.

            <a href="http://www.domain.com/links.htm" target="_blank">NewPage</a>
            <a href="http://www.domain.com/links.htm" target="_blank">NewPage</a>


            H="Append Simple1"
            ^!AppendToFile "L:\footer.htm" ^%nl%<a
            href="http://www.domain.com/^$GetFileName(^##)$" target="_blank">NewPage</a>


            H="Append Simple2"
            ^!AppendToFile "L:\footer.htm" ^%nl%^?{UPDATE SITE FOOTER WITH ACTIVE
            DOCUMENT NAME=<a href="http://www.domain.com/^$GetFileName(^##)$"
            target="_blank">NewPage</a>}

            --
            ºvº
            04.12.07 09:08 p
            hrs > hsavage@...
          • dvdwriters12
            Hrs, You are correct I tried those and they work. Many thanks!
            Message 5 of 8 , Dec 8, 2004
            • 0 Attachment
              Hrs,

              You are correct I tried those and they work.

              Many thanks!
            Your message has been successfully submitted and would be delivered to recipients shortly.