Re: Silly repeat question
Re: Silly repeat question
- Subject: Re: Silly repeat question
- From: email@hidden
- Date: Thu, 26 Aug 2010 13:53:59 -0700
On Aug 26, 2010, at 1:31pm, Alex Zavatone wrote:
> I don't want to put an if/then block around a decent chunk of code when I can simply do this beforehand:
We're not putting an if/then block around anything. We're putting a repeat 1 time block inside your repeat loop.
>
> if not myCondition then next repeat.
>
as opposed to:
if not myCondition then exit repeat
If that's inside a repeat 1 time block, inside a repeat loop, the behavior is exactly what you want.
> It's the nesting that I want to avoid.
>
In appleScript, that's how it's done.
I don't think it can be done any more simply than the try/on error block or the repeat 1 time block.
Just one more comment, you don't need anything between the outer and inner repeat blocks so the additional nesting has no impact on your script.
repeat x times
repeat 1 times
end repeat
end repeat
HTH,
ES _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden