O'Reilly logo

AppleScript® Programming for the Absolute Beginner by Jerry Lee Ford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building Error Handlers

Try as you may, it is not possible to anticipate and prevent every possible error. Hard drives crash. Network and Internet connections fail. Files and folders get moved around or accidentally deleted. And users often behave in extremely unexpected ways. The best that you can sometimes do is to anticipate where errors are most likely to occur and then add a little program code to try to prevent them. For example, you can often add input validation handlers to process and ensure good user input, or use default data in the event the user fails to provide input. You can check for the existence of files and folders before attempting to access them. Still, some problems like a crashed disk drive or a failed Internet connection ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required