• 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: Return command from within a subroutine
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Return command from within a subroutine


  • Subject: Re: Return command from within a subroutine
  • From: Mark Lively <email@hidden>
  • Date: Fri, 30 Dec 2005 12:46:25 -0500

tell me to quit might work.

One thing that I do is put the entire script in a repeat loop and then
say exit repeat.  Or you could use a try block for the same thing.

Alternatively you can set a flag and just do nothing for the rest of the script.


examples


on dostuff()
     exit repeat
end
repeat one time
     do stuff()
end repeat


-- or --

on doStuff()
     error "Not really an error"
end

try
     doStuff()
on error tryerror
     if tryerror ≠ "Not really an error" then display dialog "Oops real error"
end


property justStop: false

on doStuff()
     set justStop to true
end
on doMoreStuff()
end
on doEvenMoreStuff()
end

set justStop to false
doStuff()
if not justStop then doMoreStuff()
if not justStop then doEventMoreStuff()


On 12/30/05, Jay Louvion <email@hidden> wrote:
>
>  Is there some kind of magical spell to do the return command (on the whole
> script) from within a subroutine (because I imagine that giving the return
> command is only returning the subroutine, or something). The script in
> question is run as an action script within Mail. Would tell me to quit work
> or again are we only talking to the sub ?
>
>  Best,
>
>  J.
>
>  Jay Louvion
>  Studio Casagrande
>  3, rue Müller-Brun
>  1208 Geneva
>
>  T+4122 840 3272
>  F+4122 840 3271
>
>  skypeme:
>  jaylouvion
>
>  www.studiocasagrande.com
>
>
>  P Please consider the environment before printing this email.
>
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list
> (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to 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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Return command from within a subroutine
      • From: Barry Wainwright <email@hidden>
References: 
 >Return command from within a subroutine (From: Jay Louvion <email@hidden>)

  • Prev by Date: Return command from within a subroutine
  • Next by Date: Re: hdiutil burn
  • Previous by thread: Return command from within a subroutine
  • Next by thread: Re: Return command from within a subroutine
  • Index(es):
    • Date
    • Thread