Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

AppleScript.LastError

Returns the last error code.

Component Version macOS Windows Linux Server iOS SDK
AppleScript 1.0 ✅ Yes ❌ No ❌ No ✅ Yes, on macOS ❌ No
MBS( "AppleScript.LastError" )

Parameters

none

Description

Returns the last error code.
Any AppleScript Errors that are not trapped using "try" blocks, will abort the AppleScript. Also returns AppleScript compile errors. This function is useful for error trapping your scripts.

Examples

Get Last Error

MBS( "Applescript.LastError" )

See also

Release notes

  • Version 14.0
    • Fixed AppleScript.Compile to clear last error for AppleScript.LastErrorMessage function.
  • Version 13.2

Blog Entries

This function is free to use.

Created 18th August 2014, last changed 31st October 2016


AppleScript.GetPropertyValue - AppleScript.LastErrorMessage

💬 Ask a question or report a problem