• 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: Exit Repeat
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exit Repeat


  • Subject: Re: Exit Repeat
  • From: Christopher Stone <email@hidden>
  • Date: Sat, 03 Oct 2015 00:25:29 -0500

On Oct 02, 2015, at 11:23, Jon Rosen <email@hidden> wrote:
Am I incorrect about this? As far as I can tell, there is no way exit from an individual loop of a repeat block; you can only exit from the entire block.
______________________________________________________________________

Hey Jon,

Unfortunately there's no skip function, so you do have to roll-your-own.

--
Best Regards,
Chris

-----------------------------------
repeat with x from 1 to 10

  if x ≠ 5 then

    log x

  end if

end repeat

-----------------------------------

repeat with x from 1 to 10

  

  repeat 1 times

    

    # Code

    

    if condition_01 then exit repeat

    

    # Code

    

    if condition_02 then exit repeat

    

    # Code

    

    if condition_03 then exit repeat

    

    # Code

    

  end repeat

  

end repeat

-----------------------------------
 _______________________________________________
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

References: 
 >Exit Repeat (From: Jon Rosen <email@hidden>)

  • Prev by Date: Re: Best Practices
  • Next by Date: El Capitan & Mail Scripting
  • Previous by thread: Re: Exit Repeat
  • Next by thread: Scripting SAPGUI for Java
  • Index(es):
    • Date
    • Thread