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

Clip that creates a "calendar" outline

Expand Messages
  • Piotr Bienkowski
    Hi, I m hardly ever active on this list although I have been using NoteTab Pro and clips for more than a decade. Now I have a need for a clip that generates an
    Message 1 of 6 , Sep 15, 2010
      Hi,

      I'm hardly ever active on this list although I have been using NoteTab
      Pro and clips for more than a decade.

      Now I have a need for a clip that generates an outline where the outline
      headings are dates from the beginning to the end of the month.

      Has anybody 'been there done that'? I will appreciate your help.

      Regards,

      Piotr
    • Dave
      Hi this is not mine it may do what you want it is below ... = V5 MultiLine NoSurting TabWidth=30 H= ;Readme CreateCalender Version 0.1 Author: andreas
      Message 2 of 6 , Sep 15, 2010
        Hi
        this is not mine it may do what you want it is below
        ----------------------------------------------
        = V5 MultiLine NoSurting TabWidth=30

        H=";Readme"
        CreateCalender Version 0.1

        Author: andreas k├╝stermeyer

        Hi all,

        The clip creates files in the homedirectory of NoteTAB

        EX: NoteTAB\documents\2000\January.otl
        \February.otl
        ...........

        At this moment it supports only the GERMAN language

        This is my 3rd Clip so you can say that I'm a beginner,
        but I found the idea to create OutLineDocuments that I can
        use as an Organizer very helpfull.

        The problem at this moment is, that the creating of the sides
        will be seen by the user, perhaps it would be better to
        do this in the Background? But how?

        On the other hand, what does this Clip still need
        to work correctly when errors occur?

        If you think, that this Clip is usefull I also would like to
        give the user the choice, to create it in english language

        But what would the title be in english

        German: Sunntag, den 12.02.05
        English: Sunday 12.02.05 ????


        If everything works right, the next step would be to create clips
        that creates formated text for the daily pages
        Or search functions e: TODAY or by DATE

        I use a version with this functions, but they also have to be tested


        H="CreateCalender"

        ;//
        ;//
        ;//
        ^!SetArray %ArrayDaysEngS%=Su;Mo;Tu;We;Th;Fr;Sa
        ^!SetArray %ArrayDaysEngL%=Sunday ;Monday ;Teusday ;Wednesday;Thursday
        ;Friday ;Saturday ;
        ^!SetArray
        %ArrayMonthEngL%=January;February;March;April;May;June;July;August;September;October;November;December
        ^!SetArray
        %ArrayDaysF%=01;02;03;04;05;06;07;08;09;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;27;28;29;30;31
        ^!SetArray %ArrayMonthF%=01;02;03;04;05;06;07;08;09;10;11;12
        ^!SetArray %ArrayMonthLength%=31;2;31;30;31;30;31;31;30;31;30;31

        ;// Name of [FirstDay of the year + LengthFebruary] 2000 -> 2005
        ;// nDD n=1->Su; n=2->Mo;... -> %ArrayDaysEngS%
        ;// nDD DD = Length of February
        ^!SetArray %ArrayYears%=729;228;328;428;529;728

        ;// User input
        ;// Choose the year
        ^!Set %year%=^?[January=_2000|2001|2002|2003|2004|2005]

        ;// ShortForm
        ;// year for heading 2 sign
        ;// 2001 -> 01
        ^!Set %year2sign%=^$StrCopy(^%year%;3;2)$

        ;// ShortForm year 1 sign
        ;// 2001 -> 1
        ^!Set %DayDateIdx%=^$StrCopy(^%year%;4;1)$
        ^!Inc %DayDateIdx%

        ^!Set %DayDate%=^%ArrayYears^%DayDateIdx%%

        ;// -> ArrayDaysEngS
        ;//n = 1 -> Su
        ;//n = 2 -> Mo
        ;//n = .......
        ;//n = 7 -> Sa
        ^!Set %ddIdx%=^$StrCopy(^%DayDate%;1;1)$

        ;// Length February -> %ArrayYears%
        ;// DD
        ^!Set %LengthFebruary%=^$StrCopy(^%DayDate%;2;2)$

        ;// Loop Index Month
        ^!Set %MonthIdx%=0
        ^!GoTo LoopYear

        ;// Create a OutLineDocument for each month
        ;// do this 12x
        ;// Date for first day = 1

        :LoopYear
        ^!Set %dayIDX%=1
        ^!If ^%MonthIdx% <= 11 LoopCreateOutLine ELSE End

        ;// OutLineDocument for each Month
        ;// Create the Path with Filename
        ;// C:\Programme\NoteTab Pro\Documents\2000\January.otl
        ;//^!Open ^%FileName%

        :LoopCreateOutline
        ;//^!SetScreenUpdate Off
        ^!Inc %MonthIdx%
        ^!Set %FileName%=^%ArrayMonthEngL^%MonthIdx%%
        ^!Set %FileName%=^$GetDocumentPath$^%year%\^%FileName%.OTL

        ;// Do not overwrite
        ^!IfFileExist ^%FileName% Error

        ;//Create Path
        ^!MkDir ^$GetDocumentPath$^%year%

        ;// ^!TextToFile "FileName" AnyText
        ;// Creates a disk file containing the specified text.
        ;// If a file with such a name already exists on disk,
        ;// it will be replaced by the new file.
        ;// !!! ^%FileName% -> "^%FileName%"
        ^!TextToFile "^%FileName%" =V4 Outline MultiLine NoSorting
        TabWidth=30^%nl%^%nl%
        ^!Open ^%fileName%

        ;// Set Length Month
        ;// Check if it's February
        ^!If ^%MonthIdx% = 2 FebruaryLength ELSE StandardLength

        ;// Get the length of February
        :FebruaryLength
        ^!Set %MonthLength%=^%LengthFebruary%
        ^!GoTo LoopDays
        ;// Get StandardLength of the other months
        :StandardLength
        ^!Set %MonthLength%=^%ArrayMonthLength^%MonthIdx%%
        ^!GoTo LoopDays

        ;// Do this for each day of the month
        :LoopDays
        ^!If ^%dayIdx% <= ^%MonthLength% LoopNameDays ELSE SaveMonth

        ;// Save the Document
        :SaveMonth
        ^!Save
        ^!GoTo LoopYear

        ;// Check if we have reached Saturday
        :LoopNameDays
        ^!IF ^%ddIdx% > 7 StartSunday ELSE LoopCreateDays

        ;// We start again with Sunday
        :StartSunday
        ^!Set %ddIdx%=1
        ^!GoTo LoopCreateDays

        ;// Get the ShortNames -> Mo Tu ....
        ;// Get the LongNames -> Monday Tuesday
        ;// and create string for header. Form: -> Mo 01.01.00
        ;// String -> ^%short% ^%datef%.^%monthf%.^%year2sign%
        ;// %short% = Mo
        ;// %datef% = 01
        ;// %Monthf% = 01
        ;// %year2sign% = 00
        ;// and Insert Text Form ->

        :LoopCreateDays
        ^!Set %short%=^%ArrayDaysEngS^%ddIdx%%
        ^!Set %long%=^%ArrayDaysEngL^%ddIdx%%
        ^!Set %datef%=^%ArrayDaysF^%dayIdx%%
        ^!Set %monthf%=^%ArrayMonthF^%monthIdx%%
        ^!Set %header%=^%short% ^%datef%.^%monthF%.^%year2sign%
        ;// add header
        ^!Addheading ^%header%
        ;// Insert Text
        ^!Jump Text_Start
        ^!InsertText ^%long% ^%datef% ^%monthF% ^%year2sign% ^P
        ^!Keyboard ENTER
        ^!Inc %ddIdx%
        ^!Inc %dayIdx%
        ^!GoTo LoopDays

        ;// the calender allready exsists
        :Error
        ^!Info Calender <^%year%> allready exsists!
        ^!Goto Exit
        -----------------------------------
        THANKYOU DAVE M



        ----- Original Message -----
        From: "Piotr Bienkowski" <syntax@...>
        To: <ntb-clips@yahoogroups.com>
        Sent: Wednesday, September 15, 2010 6:38 PM
        Subject: [Clip] Clip that creates a "calendar" outline


        > Hi,
        >
        > I'm hardly ever active on this list although I have been using NoteTab
        > Pro and clips for more than a decade.
        >
        > Now I have a need for a clip that generates an outline where the outline
        > headings are dates from the beginning to the end of the month.
        >
        > Has anybody 'been there done that'? I will appreciate your help.
        >
        > Regards,
        >
        > Piotr
        >
        >
        > ------------------------------------
        >
        > Fookes Software: http://www.fookes.com/
        > NoteTab website: http://www.notetab.com/
        > NoteTab Discussion Lists: http://www.notetab.com/groups.php
        >
        > ***
        > Yahoo! Groups Links
        >
        >
        >
        >
      • Sheri
        ... Try the following. You would need to update the first and last date as well as the file name and location. You could also tweak the date formats if they
        Message 3 of 6 , Sep 15, 2010
          --- In ntb-clips@yahoogroups.com, Piotr Bienkowski <syntax@...> wrote:
          >
          >
          > Now I have a need for a clip that generates an outline where the
          > outline headings are dates from the beginning to the end of the
          > month.

          Try the following. You would need to update the first and last date as well as the file name and location. You could also tweak the date formats if they don't meet your needs. As is, the dates in the outline headers are in the format mm/dd/yyyy and the outline is saved in the My Documents folder named yyyymm mmmm (where the mmmm spells out the month name.

          Regards,
          Sheri

          H="monthoutline"
          ^!Toolbar New Document
          ^!Set %first%=^$GetDateToInt(10/01/2010;mm/dd/yyyy)$
          ^!Set %last%=^$GetDateToInt(10/31/2010;mm/dd/yyyy)$
          ^!Set %this%=^$Calc(^%first%-1)$
          :loop
          ^!inc %this%
          ^!If ^%this%>^%last% done
          ^!Set %filename%="^$GetDateFromInt(^%this%;"yyyymm mmmm")$.otl"
          ^!Set %formatted%=^$GetDateFromInt(^%this%;"mm/dd/yyyy")$
          ^!InsertText H="^%formatted%"^P^P
          ^!Goto loop
          :done
          ^!Jump Doc_Start
          ^!InsertText = V4 Outline MultiLine TabWidth=30^P^P
          ^!Save As "^$GetShellFolder(Personal)$^%filename%"
          ^!Close
          ^!Open "^$GetShellFolder(Personal)$^%filename%"
          :Cleanup
          ^!ClearVariable %filename%
          ^!ClearVariable %first%
          ^!ClearVariable %formatted%
          ^!ClearVariable %last%
          ^!ClearVariable %this%
          ;end of clip
        • Sheri
          hmmn, sorry, I shouldn t have the filename getting set inside that loop, you could move it to just before the save, and base it not on ^%this% but either
          Message 4 of 6 , Sep 15, 2010
            hmmn, sorry, I shouldn't have the filename getting set inside that loop, you could move it to just before the save, and base it not on ^%this% but either ^%first% or ^%last%

            >
            > H="monthoutline"
            > ^!Toolbar New Document
            > ^!Set %first%=^$GetDateToInt(10/01/2010;mm/dd/yyyy)$
            > ^!Set %last%=^$GetDateToInt(10/31/2010;mm/dd/yyyy)$
            > ^!Set %this%=^$Calc(^%first%-1)$
            > :loop
            > ^!inc %this%
            > ^!If ^%this%>^%last% done
            > ^!Set %filename%="^$GetDateFromInt(^%this%;"yyyymm mmmm")$.otl"
            > ^!Set %formatted%=^$GetDateFromInt(^%this%;"mm/dd/yyyy")$
            > ^!InsertText H="^%formatted%"^P^P
            > ^!Goto loop
            > :done
            > ^!Jump Doc_Start
            > ^!InsertText = V4 Outline MultiLine TabWidth=30^P^P
            > ^!Save As "^$GetShellFolder(Personal)$^%filename%"
            > ^!Close
            > ^!Open "^$GetShellFolder(Personal)$^%filename%"
            > :Cleanup
            > ^!ClearVariable %filename%
            > ^!ClearVariable %first%
            > ^!ClearVariable %formatted%
            > ^!ClearVariable %last%
            > ^!ClearVariable %this%
            > ;end of clip
            >
          • Piotr Bienkowski
            ... Thanks Sheri, I needed something simpler than what Dave found (although his effort is also appreciated). I ll give your clip a spin. Regards, Piotr
            Message 5 of 6 , Sep 15, 2010
              Sheri wrote:
              > --- In ntb-clips@yahoogroups.com, Piotr Bienkowski <syntax@...> wrote:
              >
              >> Now I have a need for a clip that generates an outline where the
              >> outline headings are dates from the beginning to the end of the
              >> month.
              >>
              >
              > Try the following. You would need to update the first and last date as well as the file name and location. You could also tweak the date formats if they don't meet your needs. As is, the dates in the outline headers are in the format mm/dd/yyyy and the outline is saved in the My Documents folder named yyyymm mmmm (where the mmmm spells out the month name.
              >
              > Regards,
              > Sheri
              >
              >
              Thanks Sheri, I needed something simpler than what Dave found (although
              his effort is also appreciated). I'll give your clip a spin.

              Regards,

              Piotr


              [Non-text portions of this message have been removed]
            • syntax@neo.pl
              Thanks Sheri, this clip does exactly what I need. I m writing back only now, but I could not get back to this topic earlier. Regards, Piotr On Wed, 15 Sep 2010
              Message 6 of 6 , Oct 4, 2010
                Thanks Sheri, this clip does exactly what I need. I'm writing back only
                now, but I could not get back to this topic earlier.

                Regards,

                Piotr

                On Wed, 15 Sep 2010 13:06:58 -0000, "Sheri" <silvermoonwoman@...>
                wrote:
                > --- In ntb-clips@yahoogroups.com, Piotr Bienkowski <syntax@...> wrote:
                >>
                >>
                >> Now I have a need for a clip that generates an outline where the
                >> outline headings are dates from the beginning to the end of the
                >> month.
                >
                > Try the following. You would need to update the first and last date as
                > well as the file name and location. You could also tweak the date
                formats
                > if they don't meet your needs. As is, the dates in the outline headers
                are
                > in the format mm/dd/yyyy and the outline is saved in the My Documents
                > folder named yyyymm mmmm (where the mmmm spells out the month name.
                >
                > Regards,
                > Sheri
                >
                > H="monthoutline"
                > ^!Toolbar New Document
                > ^!Set %first%=^$GetDateToInt(10/01/2010;mm/dd/yyyy)$
                > ^!Set %last%=^$GetDateToInt(10/31/2010;mm/dd/yyyy)$
                > ^!Set %this%=^$Calc(^%first%-1)$
                > :loop
                > ^!inc %this%
                > ^!If ^%this%>^%last% done
                > ^!Set %filename%="^$GetDateFromInt(^%this%;"yyyymm mmmm")$.otl"
                > ^!Set %formatted%=^$GetDateFromInt(^%this%;"mm/dd/yyyy")$
                > ^!InsertText H="^%formatted%"^P^P
                > ^!Goto loop
                > :done
                > ^!Jump Doc_Start
                > ^!InsertText = V4 Outline MultiLine TabWidth=30^P^P
                > ^!Save As "^$GetShellFolder(Personal)$^%filename%"
                > ^!Close
                > ^!Open "^$GetShellFolder(Personal)$^%filename%"
                > :Cleanup
                > ^!ClearVariable %filename%
                > ^!ClearVariable %first%
                > ^!ClearVariable %formatted%
                > ^!ClearVariable %last%
                > ^!ClearVariable %this%
                > ;end of clip
                >
                >
                >
                >
                > ------------------------------------
                >
                > Fookes Software: http://www.fookes.com/
                > NoteTab website: http://www.notetab.com/
                > NoteTab Discussion Lists: http://www.notetab.com/groups.php
                >
                > ***
                > Yahoo! Groups Links
                >
                >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.