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

Ideas for repeating the same function

Expand Messages
  • mowestusa
    I ve begun making some clips to help with repetitive HTML editing I ve been doing. I m still a beginner. I have writen the following clip: ^!Select WORD
    Message 1 of 9 , Aug 10, 2002
      I've begun making some clips to help with repetitive HTML editing
      I've been doing. I'm still a beginner.

      I have writen the following clip:
      ^!Select WORD
      ^!Keyboard SHIFTDOWN RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT SHIFTUP
      ^!Keyboard DELETE
      ^!Keyboard ENTER
      ^!InsertHtml <p>
      ^!Select Paragraph
      ^!Jump Select_End
      ^!MoveCursor -001
      ^!InsertHtml </p>

      Basically I'm editing sermons to put up on a website each week. The
      sermons have paragraph numbers that reference a written outline that
      I don't post like: I.A.1., II.B.2., ... The clip erases these
      paragraph numbers, the two extra spaces, adds a blank line between
      paragraphs, and inserts the HTML paragraph code.

      I was wondering it this clip could be repeated so that I only have to
      run it once to format all the paragraphs in the sermon. One problem
      would be the fact that I often don't have the same number of
      paragraphs.

      If anyone could give some direction in this way I would appreciate
      it. Would a loop be the answer? Is there a way to test to see how
      many paragraphs there are in the sermon, and then direct it to repeat
      that number of times? Anything that would speed my webdesign time
      would leave more time for study of the Word.

      TIA,
      mowestusa
    • Alan C.
      Hi mowestusa, ... (it s may be possible to write a clip that progresses until no more paragraphs are found) And, another issue is: (for some reason) you are
      Message 2 of 9 , Aug 11, 2002
        Hi mowestusa,

        >I was wondering it this clip could be repeated so that I only have to
        >run it once to format all the paragraphs in the sermon. One problem
        >would be the fact that I often don't have the same number of
        >paragraphs.

        (it's may be possible to write a clip that progresses until no more paragraphs are found)

        And, another issue is: (for some reason) you are currently click the cursor on a word then start the clip (this is because your clip begins with ^!Select WORD)

        Unless it's that you always want the 1st word of a paragraph selected once your clip starts.

        In Notetab, a paragraph is: what's in between two line breaks. Conceivably, you could have 6 lines of text formatted at 65 column width (line break at end of each of the 6 lines) -- In Notetab, that is 6 paragraphs.

        So, for a clip to be written that's a more elaborate clip than what follows, it's needed to know if a blank line is also between each of your paragraphs. And any other as much as possible rather specifically the specifics of what you are doing.

        here as follows a quick addition to your clip so you can: 1. launch the clip 2. click your cursor on the 1st word 3. (important) momentarily depress the shift key 4. clip quickly does a paragraph and you now have up to nearly 10 seconds to click cursor on word of NEXT paragraph and momentarily depress shift key again

        can repeat on each paragraph. (click, shift -- click, shift -- click, shift) after very near 10 seconds of no activity, the clip ends/shuts itself off. ^!Select +7 can replace your lengthy ^!Keyboard line. Clip code follows.

        ^!SetHintInfo clip is working/active
        ^!Set %loopcount%=0
        :loop
        ^!Inc %loopcount%
        ^!If ^%loopcount% > 240 end
        ^!delay 1
        ^!IfTrue ^$IsShiftKeyDown$ skip
        ^!Goto loop

        ^!Select WORD
        ; ^!Keyboard SHIFTDOWN RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT SHIFTUP
        ^!Select +7
        ^!Keyboard DELETE
        ^!Keyboard ENTER
        ^!InsertHtml <p>
        ^!Select Paragraph
        ^!Jump Select_End
        ^!MoveCursor -1
        ^!InsertHtml </p>
        ^!Goto loop
        ; --<end of clip<

        --
        Alan.
      • john041650
        Hi mowestusa I m probably missing something here, but it seems to me you could do this without using a clip. Once a month I have to convert a Message
        Message 3 of 9 , Aug 11, 2002
          Hi mowestusa

          I'm probably missing something here, but it seems to me you could do this without using a clip. Once a month I have to convert a "Message" written by the Pastor of a local church that's in Word format, into a web page. All I do to accomplish that is to select all the text in the Word file, copy it, and then I'll paste it into a blank NoteTab text file. Then if necessary, I'll make sure there's an extra blank line in between each paragraph as Alan mentioned. After that I'll go to the NoteTab menu and run MODIFY/DOCUMENT TO HTML/WITH PARAGRAPH TAGS. Finally, I'll Select all the text again, copy it, and paste it into my html document and it's done.. The entire job takes less than a minute to do..

          John :)


          --- In ntb-clips@y..., "mowestusa" <mowestusa@y...> wrote:
          > I've begun making some clips to help with repetitive HTML editing
          > I've been doing. I'm still a beginner.
          >
          > I have writen the following clip:
          > ^!Select WORD
          > ^!Keyboard SHIFTDOWN RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT SHIFTUP
          > ^!Keyboard DELETE
          > ^!Keyboard ENTER
          > ^!InsertHtml <p>
          > ^!Select Paragraph
          > ^!Jump Select_End
          > ^!MoveCursor -001
          > ^!InsertHtml </p>
          >
          > Basically I'm editing sermons to put up on a website each week. The
          > sermons have paragraph numbers that reference a written outline that
          > I don't post like: I.A.1., II.B.2., ... The clip erases these
          > paragraph numbers, the two extra spaces, adds a blank line between
          > paragraphs, and inserts the HTML paragraph code.
          >
          > I was wondering it this clip could be repeated so that I only have to
          > run it once to format all the paragraphs in the sermon. One problem
          > would be the fact that I often don't have the same number of
          > paragraphs.
          >
          > If anyone could give some direction in this way I would appreciate
          > it. Would a loop be the answer? Is there a way to test to see how
          > many paragraphs there are in the sermon, and then direct it to repeat
          > that number of times? Anything that would speed my webdesign time
          > would leave more time for study of the Word.
          >
          > TIA,
          > mowestusa
        • john041650
          Oops, I need to follow up with one more thing here mowestusa.. I d forgotten that I d changed the default settings of the MODIFY/DOCUMENT TO HTML/WITH
          Message 4 of 9 , Aug 11, 2002
            Oops, I need to follow up with one more thing here mowestusa..

            I'd forgotten that I'd changed the default settings of the MODIFY/DOCUMENT TO HTML/WITH PARAGRAPH TAGS menu command. In Notetab's options, on the tab called "Internet" I removed everything in the html header and html footer boxes. That way all of the text is processed as paragraphs etc, without adding the other tags required to make the document an html document. Which allows me to copy the entire resulting text to be pasted into a "real" html document..

            Regards..

            John :)


            --- In ntb-clips@y..., "john041650" <john041650@y...> wrote:
            > Hi mowestusa
            >
            > I'm probably missing something here, but it seems to me you could do this without using a clip. Once a month I have to convert a "Message" written by the Pastor of a local church that's in Word format, into a web page. All I do to accomplish that is to select all the text in the Word file, copy it, and then I'll paste it into a blank NoteTab text file. Then if necessary, I'll make sure there's an extra blank line in between each paragraph as Alan mentioned. After that I'll go to the NoteTab menu and run MODIFY/DOCUMENT TO HTML/WITH PARAGRAPH TAGS. Finally, I'll Select all the text again, copy it, and paste it into my html document and it's done.. The entire job takes less than a minute to do..
            >
            > John :)
            >
            >
            > --- In ntb-clips@y..., "mowestusa" <mowestusa@y...> wrote:
            > > I've begun making some clips to help with repetitive HTML editing
            > > I've been doing. I'm still a beginner.
            > >
            > > I have writen the following clip:
            > > ^!Select WORD
            > > ^!Keyboard SHIFTDOWN RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT RIGHT SHIFTUP
            > > ^!Keyboard DELETE
            > > ^!Keyboard ENTER
            > > ^!InsertHtml <p>
            > > ^!Select Paragraph
            > > ^!Jump Select_End
            > > ^!MoveCursor -001
            > > ^!InsertHtml </p>
            > >
            > > Basically I'm editing sermons to put up on a website each week. The
            > > sermons have paragraph numbers that reference a written outline that
            > > I don't post like: I.A.1., II.B.2., ... The clip erases these
            > > paragraph numbers, the two extra spaces, adds a blank line between
            > > paragraphs, and inserts the HTML paragraph code.
            > >
            > > I was wondering it this clip could be repeated so that I only have to
            > > run it once to format all the paragraphs in the sermon. One problem
            > > would be the fact that I often don't have the same number of
            > > paragraphs.
            > >
            > > If anyone could give some direction in this way I would appreciate
            > > it. Would a loop be the answer? Is there a way to test to see how
            > > many paragraphs there are in the sermon, and then direct it to repeat
            > > that number of times? Anything that would speed my webdesign time
            > > would leave more time for study of the Word.
            > >
            > > TIA,
            > > mowestusa
          • mowestusa
            Thank you for the help that I have received. Perhaps some clarification could help. John, I m not just using the HTML command because I have some other clips
            Message 5 of 9 , Aug 12, 2002
              Thank you for the help that I have received. Perhaps some
              clarification could help.

              John,
              I'm not just using the HTML command because I have some other clips
              that I will combine with this one that will format my sermons all
              with one Clip. I hoping to run one clip that will create a finished
              HTML document without additional editing. I already have clips that
              do most of the formating, I just have to put them all together into
              one. Also I don't always just use a plain <p> tag. Sometimes
              certain paragraphs at the beginning of the sermon have a CSS style
              reference, which the automatic formating command wouldn't insert.

              Alan C.
              I select the first word in each paragraph because I want to delete
              the paragraph numbers (I.A.1., II.B.2., II.C.1.). This is the reason
              for the long keyboard command that can be replaced nicely by your
              suggestion.

              I appreciate the loop idea, but I was hoping that I could do that
              without having to click at the beginning of each paragraph. Could I
              tell the clip ahead of time the number of paragraphs, or have it do a
              check to see if there is another paragraph after the one it has
              formated?

              My paragraphs are not formated with a linebreak at every 70. There
              is one linebreak for every paragraph.

              I hoped this helped clairify my first post.

              mowestusa
            • Alan C.
              Hi mowestusa, ... (clip below) completes 1 paragraph. then looks for a ^p which is a token that to Notetab means something like the beginning of yet another
              Message 6 of 9 , Aug 13, 2002
                Hi mowestusa,

                >have it do a
                >check to see if there is another paragraph after the one it has
                >formated?

                (clip below) completes 1 paragraph.

                then looks for a ^p which is a token that to Notetab means something like "the beginning of yet another paragraph."

                Simply, at that point, if it finds a ^p then it completes another (the next) paragraph. Conversely, if no ^p is found then that's what the ^!iferror is for to send it down to finalize which ultimately ends/terminates.

                So, on my tests, it did each paragraph, including the last paragraph then stopped which is what supposed to do.

                Not a problem, but: as it is, after running clip, you may need to use your left arrow key so as to see/view all of your text again. However, if it does so for you as it did for me then that's why I left two ^!InsertText ^%NL% lines in. If I place a semi colon in front of the top ^!InsertText ^%NL% and I remove the semi colon from in front of the second ^!InsertText ^%NL% then on my machine I did not need to use my left arrow key after the clip had run. But it puts the blank line under instead of above each paragraph. It works ok either way.

                Your machine may not need use left arrow key after clip ran like on my machine.

                If, however, yours does behave the same as mine, then please post back to that effect so we know whether or not the behavior is duplicated on another/other machines.

                ^!Set %wrap%=^$IsWordWrap$
                ^!SetScreenUpdate OFF
                ^!SetWordWrap OFF
                :ea_par_loop
                ^!Jump LINE_START
                ^!Select WORD
                ^!Select +7
                ^!Replace "^$GetSelection$" >> "" IS
                ^!InsertText ^%NL%
                ^!Select EOL
                ^!InsertHtml <p>^$GetSelection$</p>
                ;^!InsertText ^%NL%
                ^!Find "^p" IS
                ^!IfError finalize
                ^!Jump SELECT_END
                ^!Goto ea_par_loop
                :finalize
                ^!SetWordWrap ^%wrap%

                --
                Alan.
              • mowestusa
                Follow up question. First of all thanks to Alan and John for the help they have given to me. I have really advanced my clip knowledge with their examples and
                Message 7 of 9 , Aug 21, 2002
                  Follow up question.

                  First of all thanks to Alan and John for the help they have given to
                  me. I have really advanced my clip knowledge with their examples and
                  help.

                  Can you stop a clip in order to make a selection in the text, and
                  then continue the clip using the selection?

                  I have thought that for some of the HTML formating clips that I have
                  been writing this would be useful. I could pause the clip, and then
                  select a portion of text. I could cut the text to a new document,
                  format it, and paste it back into the original document.

                  TIA
                  mowestusa
                • Alan C.
                  Hi mowestusa, ... as follows, clip continues to run, but the action of the clip at that point is that of a closed, repetitive, or infinite loop (does no work
                  Message 8 of 9 , Aug 21, 2002
                    Hi mowestusa,

                    >Can you stop a clip in order to make a selection in the text, and
                    >then continue the clip using the selection?

                    as follows, clip continues to run, but the action of the clip at that point is that of a closed, repetitive, or infinite loop (does no work other than that like running in circles repetitively around and around a track). (you can select at this time then resume)

                    the way out of the locked in looping is that it either times out via loopcount (end) OR user depress the shift key (makes it skip the instruction within the goto line and continue on down below with any ensueing/following clip code that you have). 240 is near 10 seconds. if need longer, try say 500, or 700 etc.

                    ^!SetHintInfo working/active
                    ^!Set %loopcount%=0
                    :loop
                    ^!Inc %loopcount%
                    ^!If ^%loopcount% > 240 end
                    ^!delay 1
                    ^!IfTrue ^$IsShiftKeyDown$ skip
                    ^!Goto loop

                    Variations of the above theme exist. For example, it's possible to configure/code it so that depress the shift key puts it into its (closed loop track) and depress the ctrl key brings it out so as to accomplish further clip tasks.

                    I've even a more complex variation that, depends upon whether I depress the shift, ctrl, or alt key will make the clip then choose one of three different paths, the alt key is my # 3 or "bail" option (shuts off/ends clip)

                    --
                    Alan.
                  • mowestusa
                    Thank you, Alan C. and John for the wonderful help you have given to me. Today I finally wrote a clip that seems to everything I need it to do with very
                    Message 9 of 9 , Aug 23, 2002
                      Thank you, Alan C. and John for the wonderful help you have given to
                      me. Today I finally wrote a clip that seems to everything I need it
                      to do with very little uses intervention. I have posted the clip at
                      the end of this message just so you can see the final result. It has
                      a lot of ideas from both of you. I'm still working on all of the
                      META tags that John suggested. I'm also trying to figure out a fw
                      interesting things he did with the sample I sent to him.

                      This clip gives me a HTML document that looks exactly like I want it
                      to look in IE 5.5.

                      Thank you. I've learned a lot about clip writing, and I love NoteTab
                      even more.

                      mowestusa

                      Clip Follows
                      ============

                      Create Sermon
                      ;Clip to automatically format a plain text document into an HTML
                      published sermon for church website.

                      ;The following prompt allows me to cancel the clip if I failed to
                      place the sermon in the right tab position or if I failed to
                      highlight the sermon text.

                      ^!Continue "Please put Sermon in FIRST TAB. HIGHLIGHT Sermon Text
                      before continuing this clip."

                      ^!SetHintInfo Cutting Sermon Text
                      ^!Toolbar Cut

                      ;This opens a file that I just use in the background to paste in the
                      sermon text and format it before cutting and pasting it back into the
                      document file.

                      ^!Open "C:sermontext.txt"
                      ^!Toolbar Paste
                      </p>
                      ^!Replace ^t >> "<p class="text">" ASW
                      ^!Replace ^p >> "</p>^%nl%" ASW
                      ^!Jump Text_Start
                      ^!InsertHTML "<p class="text">"
                      ^!Toolbar Copy All
                      ^!SetDocIndex 1
                      ^!Toolbar Paste

                      ;This ends the formating of the sermon text.

                      ;This section formates the remaining paragraphs.
                      ^!SetWordWrap OFF

                      ;Pause Loop to click in front of the introduction to the sermon.

                      ^!SetHintInfo "Pause Loop for moving insertion point to beginning of
                      Introduction."

                      ^!Set %loopcount%=0
                      :loop
                      ^!Inc %loopcount%
                      ^!If ^%loopcount% > 240 end
                      ^!delay 1
                      ^!IfTrue ^$IsShiftKeyDown$ skip
                      ^!Goto loop

                      ;This formats just the introduction paragraph.

                      ^!SetScreenUpdate OFF
                      ^!Jump LINE_START
                      ^!Select Word
                      ^!Select +3
                      ^!Replace "^$GetSelection$" >> "" IS
                      ^!InsertText ^%NL%
                      ^!Select EOL
                      ^!Replace "^$GetSelection$" >> "<p>^$GetSelection$</p>" IS

                      ;These commands format the rest of the paragraphs in the sermon.

                      :body
                      ^!Keyboard DOWN
                      ^!Jump LINE_START
                      ^!Select Word
                      ^!IfSame "^$GetSelection$" "transition" format2
                      ^!IfSame "^$GetSelection$" "conclusion" format2
                      ^!IfSame "^$GetSelection$" "i" format1
                      ^!IfSame "^$GetSelection$" "ii" format1 ELSE end

                      ;These two sections delete the paragraph numbers or title, then add
                      the HTML tags.

                      :format1
                      ^!Select +7
                      ^!Replace "^$GetSelection$" >> "" IS
                      ^!InsertText ^%NL%
                      ^!Select EOL
                      ^!Replace "^$GetSelection$" >> "<p>^$GetSelection$</p>" IS
                      ^!Goto body

                      :format2
                      ^!Select +3
                      ^!Replace "^$GetSelection$" >> "" IS
                      ^!InsertText ^%NL%
                      ^!Select EOL
                      ^!Replace "^$GetSelection$" >> "<p>^$GetSelection$</p>" IS
                      ^!Goto body

                      :end
                      ^!SetWordWrap ON

                      ;The following text is inserted into beginning of sermon.
                      <HTML>
                      <HEAD>
                      <META NAME="Formater" CONTENT="NoteTab Light">
                      <META NAME="Generator" CONTENT="NoteTab Light">
                      <LINK REL="stylesheet" type="text/css" href="sermon2.css" />
                      </HEAD>

                      <BODY>

                      <TABLE summary="Sunday Sermon formatting table" width="100%"
                      cellpadding="0" cellspacing="0">
                      <TR>
                      <TD class="image"></TD>
                      <TD>
                      <H3>Sermon for ^?[Enter Sunday of Church Year==]<BR>
                      Delivered on ^?[Enter Date Preached==]<BR>
                      by ____</H3>
                      <H2 class="center">"^?[Enter Sermon Theme==]"</H2>
                      ^%nl%

                      ;Now we jump to the end of the document and insert the last of the
                      HTML tags.

                      ^!Jump TEXT_END
                      ^%nl%
                      </TD>
                      <TD class="image"></TD>
                      </TR>
                      </TABLE>
                      </BODY>
                      </HTML>

                      ;This command closes the temporary document I opened to edit the
                      sermon text.

                      ^!Close "C:sermontext.txt" DISCARD

                      ;This command saves the now formated sermon as an HTML file.

                      ^!Save As "C:^?[Enter File Name with Extension==]"
                    Your message has been successfully submitted and would be delivered to recipients shortly.