• 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: Deivy Petrescu <email@hidden>
  • Date: Fri, 02 Oct 2015 13:06:07 -0400

> On Oct 2, 2015, at 12: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. I found a workaround using nested repeat loops, which works, but it seems kludgy to me. Is there a more elegant way to do this?
>
> — Jon

More or less in the vein of what Alastair mentioned

repeat with j from 1 to 10
	if j = 5 then
		set j to 5
	else
		log j
	end if
end repeat

obviously, it would have to be adapted to whatever situation you have at hand.
Also, depending on the conditions a negation of the equality would work well.
Now, is this more elegant?
This is in the eyes of the scripter.



Deivy Petrescu
email@hidden




 _______________________________________________
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: Scripting SAPGUI for Java
  • Next by Date: Re: How Can I Get a Launch Agent which is a Script to Talk to Me?
  • Previous by thread: Re: Exit Repeat
  • Next by thread: Re: Exit Repeat
  • Index(es):
    • Date
    • Thread