Repeat (forever)The Repeat (forever) form of the Repeat statement is an infinite loop. The only way to exit the loop is by using an Exit statement.
SYNTAXrepeat [ statement ]... end [ repeat ]where
statement is any AppleScript statement.
This is an infinite loop; you must use an Exit statement to exit the loop
(see page 204).
EXAMPLEThe following example numbers the paragraphs of a document. It uses the
if paragraphNum > numParagraphs then exitto exit the loop.
tell document "List" set numParagraphs to (count paragraphs) set paragraphNum to 1 repeat if paragraphNum > numParagraphs then exit set paragraph paragraphNum to (paragraphNum as string) & " " ÿ & paragraph paragraphNum set paragraphNum to paragraphNum + 1 end repeat end tell