Re: Skip a step in a repeat loop
Re: Skip a step in a repeat loop
- Subject: Re: Skip a step in a repeat loop
- From: Arthur J Knapp <email@hidden>
- Date: Thu, 30 Aug 2001 11:06:39 -0400
>
Date: Wed, 29 Aug 2001 11:51:14 -0400
>
Subject: Re: Skip a step in a repeat loop
>
From: Matthew Broms <email@hidden>
>
Thanks for the quick responses. I realize I could nest the whole set of
>
statements in an if/else statement which isn't a big problem. I guess my
>
question came from knowing that many other scripting languages have a
>
"continue" command which allows one to pass directly to the next cycle
>
without having to nest like this (making it just a bit simpler). I looked
>
in documentation, did Google searches, and searched archives, but came up
>
empty so I posted. I guess no such command exists in AS.
Correct, AppleScript has no "continue" statement involving repeat loops,
(not to be confused with the "continue" statement that AS uses for passing
on command execution).
In fact, AppleScript could really use a statement for iteration skipping.
The real problem, (as I see it), is that the work-arounds others have posted
all introduce yet another darn level of indentation:
tell application "Whatever"
if (whatever) then
repeat with whatever in whatever
if (whatever) then
...
I am so sick of looking at lines of AppleScript code that have 15 to 20
tabs in front of them. I favor a loop-continue statement for the whitespace
savings alone... ;-)
(... i really need to get a wider monitor ...)
Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden
Hey, check out:
http://www.eremita.demon.co.uk/scripting/applescript/