• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Silly repeat question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Silly repeat question
      • From: Alex Zavatone <email@hidden>
References: 
 >Silly repeat question (From: Alex Zavatone <email@hidden>)
 >Re: Silly repeat question (From: Nathan Greenstein <email@hidden>)
 >Re: Silly repeat question (From: Emmanuel LEVY <email@hidden>)
 >Re: Silly repeat question (From: Alex Zavatone <email@hidden>)
 >Re: Silly repeat question (From: "email@hidden" <email@hidden>)
 >Re: Silly repeat question (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Silly repeat question
  • Next by Date: Re: Silly repeat question
  • Previous by thread: Re: Silly repeat question
  • Next by thread: Re: Silly repeat question
  • Index(es):
    • Date
    • Thread