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

[Clip] Re: Ideas for repeating the same function

Expand Messages
  • 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 1 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 2 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 3 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.