• 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: How to do a goto with Applescript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to do a goto with Applescript?


  • Subject: Re: How to do a goto with Applescript?
  • From: Skeeve <email@hidden>
  • Date: Sun, 02 Jan 2011 21:35:15 +0100

I often use GOTO (in languages which have it) to jump to the end of a long list.

Often it's really helpful to avoid longish, deep nested if then elsif "trees"

In Applescript I usually do it eiteher in a subroutine:

on decision(x)
  if x=1 then
    do something
    return
  end if
  if x=2 then
    do something
    return
  end if
end decision

Or I use a loop:

repeat
  if x=1 then
    do something
    exit repeat
  end if
  if x=2 then
    do something
    exit repeat
  end if
  exit 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
  • Follow-Ups:
    • Re: How to do a goto with Applescript?
      • From: Paul Berkowitz <email@hidden>
    • Re: How to do a goto with Applescript?
      • From: Alex Zavatone <email@hidden>
References: 
 >How to do a goto with Applescript? (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: How to do a goto with Applescript?
  • Next by Date: Re: How to do a goto with Applescript?
  • Previous by thread: Re: How to do a goto with Applescript?
  • Next by thread: Re: How to do a goto with Applescript?
  • Index(es):
    • Date
    • Thread