Testing for EMPTY document to EXIT Loop?
- 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:
;Html Code inserted here including ^& then more HTML code
;Run HTMLTIDY on focused document
;Close Current Document
;Return to First Document position, Focus
;Select the entire text of the First Document
;(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
- Jeffery wrote:
> ^!Select ALLThat's an easy one. Lots of my clips need to run differently depending
> ;(How do I test to see if the focused doc is empty,
> and if so EXIT the clip?)
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
- --- In firstname.lastname@example.org, "Jeffery" <jeff@...> wrote:
> How do I test to see if the focused doc is empty, and if so EXIT^!IfFalse ^$GetTextSize$ Exit
> the clip?
- On 11/25/2012 6:57 AM, Axel Berger wrote:
> ^!If ^$GetSelSize$ > 3 dorunThanks I'll run it on the NEXT directory I do.
> ^!Goto END
[Non-text portions of this message have been removed]