• 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: FileMaker/AppleScript interactions: Get(LastError)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FileMaker/AppleScript interactions: Get(LastError)


  • Subject: Re: FileMaker/AppleScript interactions: Get(LastError)
  • From: David Crowe <email@hidden>
  • Date: Sun, 29 Oct 2006 20:42:52 -0600

Tim;

This is certainly a solution, although it's not perfect for two reasons. One is that you need to have specific field names known to both the script and to the FileMaker application (which is not robust because you have to remember never to change the names of the fields, or you have to pass the name of the field to the AppleScript.

But the bigger problem is that to capture all errors basically means putting a "try/end try" bracket around your entire applescript application, which makes it difficult to debug, because when an error occurs you have no clue where in the applescript it happened, which means that every time you debug the script you have to remember to comment out the try/on error/end try so that you can see where the error is.

Of course, when FileMaker captures the error the same thing applies, but when that happens I just take the AppleScript string (I always execute AppleScript from a FileMaker global so that I know exactly what code was generated if it failes) and plug it into an AppleScript editor and run it to find out exactly where the error is.

- David


At 1:26 PM +1100 10/30/06, Tim Mansour wrote:
On 30/10/2006, at 7:53 am, David Crowe wrote:

Is there any reasonable way to capture an AppleScript error via a FileMaker script?

I'd trap the error in the AppleScript and pass the result back to FileMaker via a global field. For example:


try
  -- AppleScript that may produce an error
on error msg number num
  set cell "Result" of table "Sys" to "ERROR " & num & ": " & msg
end try

(this uses FM7 terminology and assumes "Result" is a global field).



--
Tim Mansour <email@hidden>
Mobile 0405 500 846

_______________________________________________ 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/mailman//archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: FileMaker/AppleScript interactions: Get(LastError)
      • From: Tim Mansour <email@hidden>
References: 
 >FileMaker/AppleScript interactions: Get(LastError) (From: David Crowe <email@hidden>)
 >Re: FileMaker/AppleScript interactions: Get(LastError) (From: Tim Mansour <email@hidden>)

  • Prev by Date: Re: FileMaker/AppleScript interactions: Get(LastError)
  • Next by Date: Re: Writing to file as UTF8 with BOM ?
  • Previous by thread: Re: FileMaker/AppleScript interactions: Get(LastError)
  • Next by thread: Re: FileMaker/AppleScript interactions: Get(LastError)
  • Index(es):
    • Date
    • Thread