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

[Clip] Template Problem

Expand Messages
  • Alan Sandercock
    Hello People, I m new to this list and also to NoteTab Pro which I have only this week downloaded. One of my first questions for the list (I hope this is not
    Message 1 of 10 , Feb 10, 2000
    View Source
    • 0 Attachment
      Hello People,

      I'm new to this list and also to NoteTab Pro which I have only this week
      downloaded. One of my first questions for the list (I hope this is not too
      naive) is to ask how to create a template for which the name of the created
      file is built from the day's date. For example since today is February 10,
      2000 I would like a template to create a file called 21000.txt. I was
      looking around in the example templates and have been trying something like
      the following as the first line of a template file:

      = DocTemplate ClipCode ^$GetDate(mmddyy)$".txt"

      Of course this is not working, since the $GetDate$ function is not creating
      the appropriate string constant, or whatever is needed. And so, can anyone
      give me a clue as to what I should be using here?

      Alan Sandercock
    • Charles M. Raine
      Hi Alan: ... You almost had what you needed. Change it to this and try it: = DocTemplate ^$GetDate(mmddyy)$.txt You need the quote marks around the complete
      Message 2 of 10 , Feb 10, 2000
      View Source
      • 0 Attachment
        Hi Alan:

        At 08:21 PM 2/10/2000 -0500, you wrote:
        I'm new to this list and also to NoteTab Pro which I have only this week downloaded. One of my first questions for the list (I hope this is not too naive) is to ask how to create a template for which the name of the created file is built from the day's date. For example since today is February 10, 2000 I would like a template to create a file called 21000.txt.  I was looking around in the example templates and have been trying something like the following as the first line of a template file:

        = DocTemplate ClipCode ^$GetDate(mmddyy)$".txt"

        You almost had what you needed. Change it to this and try it:

        = DocTemplate "^$GetDate(mmddyy)$.txt"

        You need the quote marks around the complete function. You would use the ClipCode parameter if the name was being generated by your following clip code.


                 Charlie.

        Charles M. Raine             Home Page: http://www.escape.ca/~rainec
        Phone (204) 895-0940         ICQ # 300058
        Winnipeg, Manitoba, Canada
      • Eb Guenther
        Hi Alan Sandercock, ... Put the following 3 lines into your template (or you could hardcode the destination directory): = DocTemplate ClipCode ^!Set
        Message 3 of 10 , Feb 10, 2000
        View Source
        • 0 Attachment
          Hi Alan Sandercock,

          >... create a template for which the name of the created file
          >is built from the day's date.
          >For example ... February 10, 2000 ... 21000.txt. ...
          >
          >= DocTemplate ClipCode ^$GetDate(mmddyy)$".txt"

          Put the following 3 lines into your template (or you could hardcode the
          destination directory):

          = DocTemplate ClipCode
          ^!Set %filename%="^$GetDate(yymmdd)$.txt"
          ^!Save AS "^?{(H=10)Select a Directory==Browse current
          directory^=.\|_^$GetAppPath$|^$GetDocumentPath$}^%filename%"


          NOTES:

          1. I have rearranged the date mask to YYMMDD, so the files
          you create will sort automatically in the date order, even in
          a NoteTab directory box.

          2. No need to provide for a name in the header.

          3. I LOVE templates!


          Good luck,

          Eb
        • Eb Guenther
          Hi Charles, ... On which platform did you test this? On NT 4 (SP6) I get the filename ^$GetDate(mmddyy)$.txt , literally, w/o quotes. Eb
          Message 4 of 10 , Feb 10, 2000
          View Source
          • 0 Attachment
            Hi Charles,

            >= DocTemplate "^$GetDate(mmddyy)$.txt"

            On which platform did you test this?

            On NT 4 (SP6) I get the filename "^$GetDate(mmddyy)$.txt",
            literally, w/o quotes.

            Eb
          • Jody
            Hi Alan, ... You are correct that it does not accept the date function in the header line, well, it is not interpreted. Unless somebody has a trick up their
            Message 5 of 10 , Feb 10, 2000
            View Source
            • 0 Attachment
              Hi Alan,

              > = DocTemplate ClipCode "^$GetDate(mmddyy)$.txt"
              >
              > Of course this is not working, since the $GetDate$ function is
              > not creating the appropriate string constant, or whatever is
              > needed.

              You are correct that it does not accept the date function in the
              header line, well, it is not interpreted. Unless somebody has a
              trick up their sleeve you will need to make a clip for it
              something like this:

              ^!Save:as ^$GetDocumentPath&^$GetDate(mmddyy)$.txt
              ^!Close

              The advantage using a Clip is you can add more stuff to it and in
              the case above just do it with a click and be done with it. The
              disadvantage is finding your Clip when you need it. If you will
              be using it often, then you can put it on the new Clipbar in ver.
              4.8.

              Just saw Charles' post. Charles, does that work for you? It does
              not here.

              Happy Clip'n!
              Jody

              http://www.sureword.com/notetab

              Subscribe, UnSubscribe, Options
              mailto:Ntb-Clips-Subscribe@...
              mailto:Ntb-Clips-UnSubscribe@...
              http://www.egroups.com/list/ntb-clips
            • Jody
              Hi Eb, ... That is good to know. I know NoteTab does the Clip code, but I did not think about doing that - neat!!! The two most common elements in the
              Message 6 of 10 , Feb 10, 2000
              View Source
              • 0 Attachment
                Hi Eb,

                > = DocTemplate ClipCode
                > ^!Set %filename%="^$GetDate(yymmdd)$.txt"
                > ^!Save AS "^?{(H=10)Select a Directory==Browse current
                > directory^=.\|_^$GetAppPath$|^$GetDocumentPath$}^%filename%"

                That is good to know. I know NoteTab does the Clip code, but I
                did not think about doing that - neat!!!

                The two most common elements in the
                universe are hydrogen and stupidity.

                Signed,
                I. Claim Ignorance

                Blessed are they who can laugh at themselves
                for they shall never cease to be amused.

                Clean-Funnies List
                mailto:CF@...?subject=subscribe
              • Charles A. Brannon
                alan sandercock wrote: original article:http://www.egroups.com/group/ntb-clips/?start=2632 ... I had only received the above mentioned
                Message 7 of 10 , Feb 10, 2000
                View Source
                • 0 Attachment
                  alan sandercock <alan-@...> wrote:
                  original article:http://www.egroups.com/group/ntb-clips/?start=2632

                  ------------------------------------------------------------
                  I had only received the above mentioned article in this
                  thread before I began writing this response. I will be
                  clearly mistaken in (at least) one point in the text below.
                  You figure it out if you can ;-) I like Eb's answer better
                  because it is much shorter and it proves to me once again
                  that NoteTab has only one shortcoming (regexp, IM!HO). I
                  also would prefer name sorting by date, but did not assume
                  as much for Alan, so I left it in <mmddyy> format. Anyway, I
                  feel wasteful code can at least serve as a *bad* example,
                  and maybe someone would rather do it this way. So here
                  goes...
                  ------------------------------------------------------------

                  ...
                  > One of my first questions for the list
                  ...
                  > is to ask how to create a template for which the name of the created
                  > file is built from the day's date.

                  Alan,
                  After testing this a few ways, everything seems to
                  indicate that the header line is the only part of a template
                  that is *not* interpreted. NoteTab Help also indicates that
                  the file is written only *after* all code is interpreted.
                  What this means, in effect, is that you cannot do what you
                  describe with NoteTab. <gasp! 8^)> That being, You can still
                  automate every other part and open the template in a
                  wrapper. [example follows]

                  ...
                  > For example since today is February 10,
                  > 2000 I would like a template to create a file called 21000.txt.
                  ...

                  ----------8<---------- Template.tpl ----------8<----------
                  = DocTemplate ClipCode

                  I am your template text. Notice I do not have a file
                  name at the top because it is not needed for this purpose
                  and NoteTab would take car of it anyway. I may still be
                  interspersed with any other legal clip code, as indicated by
                  the word 'ClipCode' in the header line.

                  ----------8<---------- Template.tpl ----------8<----------

                  ----------8<--------- [clipbook code] --------8<----------
                  H="Open Template"

                  ; ----- two long lines below -----
                  ^!Set %TPL%=^?{(T=O;F="*.tpl")Template name:=^$GetTemplatePath$Template
                  .tpl}
                  ^!Set %OUT%=^?{(T=O;F="*.txt")Output name:=^$GetDocumentPath$^$GetDate(
                  mmddyy)$.txt}
                  ; ----- two long lines above -----

                  ^!IfFalse ^%TPL% Next ELSE Skip_2
                  ^!Prompt ^$RemoveTokens(No template file chosen.^PGoodbye!)$
                  ^!Goto End
                  ^!IfFalse ^%OUT% Next ELSE Skip_2
                  ^!Prompt ^$RemoveTokens(No output file chosen.^PGoodbye!)$
                  ^!Goto End

                  ^!Open ^%TPL%
                  ^!RenameDoc ^%OUT%

                  ----------8<--------- [clipbook code] --------8<----------

                  Because I do not know how much you have absorbed in the
                  last week or how experienced you were anyway, I will explain
                  how to get this into NoteTab. Copy and paste the first block
                  of text into NoteTab. Save as <Template.tpl> or rename your
                  template to <Template.tpl> or just change the first line of
                  the clipbook code to match your desired filename. Copy the
                  second block and right-click the desired clipbook list in
                  NoteTab. Click <Add from Clipboard> to auto-magically add
                  this code the code to this library. Right click the clipbook
                  list and click <Save Now> to finalize. You can now use this
                  clip to rename template output by date.

                  Please note that the pure answer to Alan's original
                  question is in the last two lines of clip code above (^!Open
                  and ^!RenameDoc). Thanks Alan for a fun assignment and
                  another learning experience with NoteTab. I Hope this helps!

                  -- CB
                • Eric G.V. Fookes
                  Hello Alan, ... Very interesting. I had never thought of that. I ll see if I can still easily add this to the upcoming version 4.8... Regards, Eric Fookes ...
                  Message 8 of 10 , Feb 11, 2000
                  View Source
                  • 0 Attachment
                    Hello Alan,

                    >I'm new to this list and also to NoteTab Pro which I have only this week
                    >downloaded. One of my first questions for the list (I hope this is not too
                    >naive) is to ask how to create a template for which the name of the
                    >created file is built from the day's date. For example since today is
                    >February 10, 2000 I would like a template to create a file called
                    >21000.txt. I was looking around in the example templates and have been
                    >trying something like the following as the first line of a template file:
                    >
                    >= DocTemplate ClipCode ^$GetDate(mmddyy)$".txt"
                    >
                    >Of course this is not working, since the $GetDate$ function is not
                    >creating the appropriate string constant, or whatever is needed. And so,
                    >can anyone give me a clue as to what I should be using here?

                    Very interesting. I had never thought of that. I'll see if I can still
                    easily add this to the upcoming version 4.8...

                    Regards,
                    Eric Fookes
                    -----------
                    NoteTab v4.6a available from
                    http://www.notetab.com and http://www.notetab.ch
                    NoteTab v4.8 Beta from
                    http://www.notetab.com/beta.htm







                    ...
                  • Charles A. Brannon
                    ... still ... ... Normally I do not gush over any program, but it is exactly this type of personal response to users that makes me want to sing the praises of
                    Message 9 of 10 , Feb 11, 2000
                    View Source
                    • 0 Attachment
                      --- "Eric G.V. Fookes" <fookes@...> wrote:
                      >
                      > Hello Alan,
                      ...
                      > >I was looking around in the example templates and have been
                      > >trying something like the following as the first line of a template
                      file:
                      > >
                      > >= DocTemplate ClipCode ^$GetDate(mmddyy)$".txt"
                      ...
                      > Very interesting. I had never thought of that. I'll see if I can
                      still
                      > easily add this to the upcoming version 4.8...
                      >
                      > Regards,
                      > Eric Fookes
                      ...
                      Normally I do not gush over any program, but it is exactly
                      this type of personal response to users that makes me want to
                      sing the praises of NoteTab to every programmer/developer I meet.
                      Thanks again Eric for a very powerful and useful program.

                      I am interested in your development of the Clipbook idea.
                      What inspired you? Were there specific people, books, or programs
                      that led to to this form of imbedded scripting language? I use
                      JavaScript alot and I wonder if you have thought of its use to
                      develop the cross-platform NoteTab mentioned in an earlier
                      thread.

                      I suggest a look at the 'Let's Build a Compiler' series by
                      Jack Crenshaw at <http://www.iecc.com/compilers/crenshaw/> for
                      very powerful methods to produce (imbeddable) languages with
                      access to the full machine.

                      Do you have any plans to open the source to the interpreter?
                      Otherwise, I would find it highly useful to run scripts
                      independent of NoteTab (perhaps a separate execution module) or
                      from a command line invocation of NoteTab in 'Clipbook only'
                      mode. Any information in this regard would be appreciated as
                      would any information others have regarding immeddable scripting
                      languages like NoteTab clips, javascript, emacs lisp, python, or
                      anything in between.

                      By a stretch to the above list, but highly appropriate to a
                      text editor, even the scriptable commands for the Unix editor vi
                      could be considered a 'language', though limited to line
                      matching. When considering new features for upgrade, I suggest
                      you investigate adding a 'vi mode' to key mapping options. It is
                      the limited scripting abilities of vi (or specificaly gvim for
                      MS-Windows) that led me to NoteTab in the first place (and I
                      haven't turned back since).

                      Believe me, this letter is intended to be entirely useful to
                      NoteTab users (and clip programmers in particular) as we all
                      stand to benefit from Eric's continuous upgrade of--and *obvious*
                      hard work on--the clip language. Thanks for reading.

                      -- C.B.
                    • Eric G.V. Fookes
                      Hello Charles, ... Thanks, I appreciate that. ... And I hope you will like the upcoming release even more... ... It s a long story. I suppose I got some of the
                      Message 10 of 10 , Feb 11, 2000
                      View Source
                      • 0 Attachment
                        Hello Charles,

                        > Normally I do not gush over any program, but it is exactly
                        >this type of personal response to users that makes me want to
                        >sing the praises of NoteTab to every programmer/developer I meet.

                        Thanks, I appreciate that.

                        >Thanks again Eric for a very powerful and useful program.

                        And I hope you will like the upcoming release even more...

                        > I am interested in your development of the Clipbook idea.
                        >What inspired you? Were there specific people, books, or programs
                        >that led to to this form of imbedded scripting language?

                        It's a long story. I suppose I got some of the inspiration from a graphics
                        program called Visio. It uses a palette of reusable images that can be
                        dragged into the drawing area. I thought this approach would be very good
                        for text... and the Editor Clipbook was born <g>.

                        >I use
                        >JavaScript alot and I wonder if you have thought of its use to
                        >develop the cross-platform NoteTab mentioned in an earlier
                        >thread.

                        Unfortunately, many of the objects that I use in NoteTab are not available
                        under Javascript. It would involve far too much work to rewrite all those
                        elements from scratch.

                        > I suggest a look at the 'Let's Build a Compiler' series by
                        >Jack Crenshaw at <http://www.iecc.com/compilers/crenshaw/> for
                        >very powerful methods to produce (imbeddable) languages with
                        >access to the full machine.

                        I will, once the pressure of releasing NoteTab 4.8 is over. Thanks for the
                        reference.

                        >Do you have any plans to open the source to the interpreter?

                        Not at this stage.

                        >Otherwise, I would find it highly useful to run scripts
                        >independent of NoteTab (perhaps a separate execution module) or
                        >from a command line invocation of NoteTab in 'Clipbook only'
                        >mode. Any information in this regard would be appreciated as
                        >would any information others have regarding immeddable scripting
                        >languages like NoteTab clips, javascript, emacs lisp, python, or
                        >anything in between.
                        >
                        > By a stretch to the above list, but highly appropriate to a
                        >text editor, even the scriptable commands for the Unix editor vi
                        >could be considered a 'language', though limited to line
                        >matching. When considering new features for upgrade, I suggest
                        >you investigate adding a 'vi mode' to key mapping options. It is
                        >the limited scripting abilities of vi (or specificaly gvim for
                        >MS-Windows) that led me to NoteTab in the first place (and I
                        >haven't turned back since).

                        All the above suggestions are very good. Unfortunately, as I have mentioned
                        before, time is my biggest problem. Days just aren't long enough <g>. So I
                        can't make any promisees...

                        > Believe me, this letter is intended to be entirely useful to
                        >NoteTab users (and clip programmers in particular) as we all
                        >stand to benefit from Eric's continuous upgrade of--and *obvious*
                        >hard work on--the clip language. Thanks for reading.

                        And thanks for sharing your thoughts.

                        Regards,
                        Eric Fookes
                        -----------
                        NoteTab v4.6a available from
                        http://www.notetab.com and http://www.notetab.ch
                        NoteTab v4.8 Beta from
                        http://www.notetab.com/beta.htm







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