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

Testing for EMPTY document to EXIT Loop?

Expand Messages
  • Jeffery
    I am running a Clip which I want to HTMLTIDY all open documents, after running the LAST Clip on each, save then close each one, then process the next
    Message 1 of 4 , Nov 25, 2012
    • 0 Attachment
      I am running a Clip which I want to HTMLTIDY all open documents, after running the LAST Clip on each, save then close each one, then process the next document, by selecting all, run the last run clip, and close save and repeat. BUT obviously when it runs out of documents it tries to keep going by tidying and saving a continuous stream of new documents.

      How do I tell it to QUIT if it runs out of documents? (If Then Else?)

      The LAST Clip called inserts the selected Content into a new HTML document by using the "^&" Indicating the paste point in the new HTML page which REPLACES the current page. It then goes on to the next page and loops.
      Current clip portion looks like this:

      ^!SetScreenUpdate OFF
      ;Html Code inserted here including ^& then more HTML code
      ;Run HTMLTIDY on focused document
      ^!RUNTIDY iS
      ;Close Current Document
      ^!Close Save
      ;Return to First Document position, Focus
      ^!Document First
      ;Select the entire text of the First Document
      ^!Select ALL

      ;(How do I test to see if the focused doc is empty, and if so EXIT the clip?)

      ;Run Last run Clip on First Document
      ^!KEYBOARD CTRL+SPACEBAR &1000
    • Axel Berger
      ... That s an easy one. Lots of my clips need to run differently depending on whether something is selected or not. Sometimes the ^& does that on its own,
      Message 2 of 4 , Nov 25, 2012
      • 0 Attachment
        Jeffery wrote:
        > ^!Select ALL
        > ;(How do I test to see if the focused doc is empty,
        > and if so EXIT the clip?)

        That's an easy one. Lots of my clips need to run differently depending
        on whether something is selected or not. Sometimes the ^& does that on
        its own, sometimes I have to be more explicit:

        ^!If ^$GetSelSize$ > 3 dorun
        ^!Goto END
        :dorun

        Axel
      • flo.gehrke
        ... ^!IfFalse ^$GetTextSize$ Exit Regards, Flo
        Message 3 of 4 , Nov 25, 2012
        • 0 Attachment
          --- In ntb-clips@yahoogroups.com, "Jeffery" <jeff@...> wrote:
          > How do I test to see if the focused doc is empty, and if so EXIT
          > the clip?

          ^!IfFalse ^$GetTextSize$ Exit

          Regards,
          Flo
        • Jeffery Scism
          ... Thanks I ll run it on the NEXT directory I do. [Non-text portions of this message have been removed]
          Message 4 of 4 , Nov 25, 2012
          • 0 Attachment
            On 11/25/2012 6:57 AM, Axel Berger wrote:
            > ^!If ^$GetSelSize$ > 3 dorun
            > ^!Goto END
            > :dorun
            Thanks I'll run it on the NEXT directory I do.


            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.