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

[Clip] Re: Ideas for repeating the same function

Expand Messages
  • 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 1 of 9 , Aug 23, 2002
    • 0 Attachment
      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.