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

Re: [NTB] Appending data

Expand Messages
  • hsavage
    ... wont work. ... on my site - at the end of the file. ... href= http://www.domain.com/thispage.htm target= _blank NewPage ] ...
    Message 1 of 8 , Dec 5, 2004
    • 0 Attachment
      dvdwriters12 wrote:
      >
      >
      > I'm playing around with a few clips and can anyone explain why this
      wont work.
      >
      > It's supposed to put a little html link footer in the file footer.htm
      on my site - at the end of the file.
      >
      > The wizard pops up with the link but nothing is written in the file:
      >
      > ^!Continue Append data to a file. Continue?
      >
      > ^!AppendToFile "L:\footer.htm" ^$GetText$
      >
      > ^?[Update Site Footer with active document name=<a
      href="http://www.domain.com/thispage.htm" target="_blank">NewPage</a>]
      >
      > Its OK if I just type the link in the document.
      >
      > Also what is the function to return the documents name so
      http://www.domain.com/thispage.htm the "thispage.htm" is the current
      filename ? All the functions I have tried seem to give me the full path.

      dvd...,

      The sequence was out a little, lines 2 and 3 need switching. The
      information to be added as a footer has to be declared(set) before and
      appendtofile operation, otherwise, you're trying to append "nothing', an
      empty string.

      If the file is loaded you don't need an append,

      The wizard, line 2, might be more useful if set to a variable, you can
      then use the variable in the append to file line, or, the inserttext
      line as below. And, the continue line isn't really needed, you'll get
      your visual clue from the line 2 wizard prompt.


      H="Append_Footer_To_File"
      ; ^!Continue Append data to a file. Continue?
      ;--
      ; first example, only used if file is loaded
      ^!Set %footer%=^?[Update Site Footer with active document name=<a
      href="http://www.domain.com/^##" target="_blank">NewPage</a>]

      ; second example
      ^!Set %footer%=^?[Update Site Footer with active document name=<a
      href="http://www.domain.com/^$GetFileName("L:\footer.htm")$"
      target="_blank">NewPage</a>]
      ;--
      ; example 1 use
      ^!AppendToFile "L:\footer.htm" ^%footer%

      ; example 2, use if file loaded
      ^!Jump ^$GetLineCount$
      ^!InsertText ^%footer%
      ^!Save
      :END


      ----------------

      ^$GetFileName("L:\footer.htm")$

      or, if the file is loaded into NoteTab and
      focused you can use NoteTabs specific wildcards.

      ^## or ^**
      ----------------

      If the file, footer.htm, is loaded in NoteTab.

      Hope it helps.

      ºvº
      hrs <04-12-05> hsavage@...
    • dvdwriters12
      ... and ... append nothing , an ... can ... inserttext ... get ... Thanks, The append works but the filename/URL is coming out like this:
      Message 2 of 8 , Dec 6, 2004
      • 0 Attachment
        > dvd...,
        >
        > The sequence was out a little, lines 2 and 3 need switching. The
        > information to be added as a footer has to be declared(set) before
        and
        > appendtofile operation, otherwise, you're trying to
        append "nothing', an
        > empty string.
        >
        > If the file is loaded you don't need an append,
        >
        > The wizard, line 2, might be more useful if set to a variable, you
        can
        > then use the variable in the append to file line, or, the
        inserttext
        > line as below. And, the continue line isn't really needed, you'll
        get
        > your visual clue from the line 2 wizard prompt.
        >
        >
        > H="Append_Footer_To_File"
        > ; ^!Continue Append data to a file. Continue?
        > ;--
        > ; first example, only used if file is loaded
        > ^!Set %footer%=^?[Update Site Footer with active document name=<a
        > href="http://www.domain.com/^##" target="_blank">NewPage</a>]
        >
        > ; second example
        > ^!Set %footer%=^?[Update Site Footer with active document name=<a
        > href="http://www.domain.com/^$GetFileName("L:\footer.htm")$"
        > target="_blank">NewPage</a>]
        > ;--
        > ; example 1 use
        > ^!AppendToFile "L:\footer.htm" ^%footer%
        >
        > ; example 2, use if file loaded
        > ^!Jump ^$GetLineCount$
        > ^!InsertText ^%footer%
        > ^!Save
        > :END
        >
        >
        > ----------------
        >
        > ^$GetFileName("L:\footer.htm")$
        >
        > or, if the file is loaded into NoteTab and
        > focused you can use NoteTabs specific wildcards.
        >
        > ^## or ^**
        > ----------------
        >
        > If the file, footer.htm, is loaded in NoteTab.
        >
        > Hope it helps.
        >
        > ºvº
        > hrs <04-12-05> hsavage@p...

        Thanks,

        The append works but the filename/URL is coming out like this:

        http://www.domain.com/C:\Temp\somefile.htm

        I want to be able to open any html on my file it should be inserting
        a proper html link.

        I've tried

        ^##
        ^**
        ^$GetFileName

        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 ?
      • 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 3 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 4 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 5 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 6 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 7 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.