• 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: Where do the errors go?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where do the errors go?


  • Subject: Re: Where do the errors go?
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 11 May 2018 00:19:22 -0500

On 05/10/2018, at 14:35, Gil Dawson <email@hidden
<mailto:email@hidden>> wrote:
> I've convinced myself that, for an application with three handlers -- run,
> idle and quit -- execution errors will be treated differently in each handler.


Hey Gil,

The user is responsible for handling errors.

So you can make the script do anything you want.

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

try

    1 / 0

on error e number n
    set e to e & return & return & "Num: " & n
    if n ≠ -128 then
        try
            tell application (path to frontmost application as text) to set
ddButton to button returned of ¬
                (display dialog e with title "ERROR!" buttons {"Copy Error
Message", "Cancel", "OK"} ¬
                    default button "OK" giving up after 30)
            if ddButton = "Copy Error Message" then set the clipboard to e
        end try
    end if
end try

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

--
Take Care,
Chris

 _______________________________________________
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: 
 >Why won't this quit? (From: Gil Dawson <email@hidden>)
 >Re: Why won't this quit? (From: Steve Mills <email@hidden>)
 >Where do the errors go? (From: Gil Dawson <email@hidden>)
 >Re: Where do the errors go? (From: Gil Dawson <email@hidden>)

  • Prev by Date: Re: Where do the errors go?
  • Next by Date: Re: Where do the errors go?
  • Previous by thread: Re: Where do the errors go?
  • Next by thread: Re: Editor performance
  • Index(es):
    • Date
    • Thread