AppleScript Programming/Sample Programs/Calculator

Simple Calculator
This simple calculator uses things we learned from the numbers and strings section, display dialog section, and the basic commands section. It also includes the "if" and "else" statements, as well as the tell block. Try putting this into Script Editor and running it.

Here's the code:

Advanced Calculator
This calculator script prevents everything except numbers to be entered. Try putting this into Script Editor and running it.

Here's the code: