AppleScript Tutorial Wiki
Advertisement

Code[]

This is the source code for a particular script.

set x1 to text returned of (display dialog "What is X1?" default answer "")
set y1 to text returned of (display dialog "What is Y1?" default answer "")
set x2 to text returned of (display dialog "What is X2?" default answer "")
set y2 to text returned of (display dialog "What is Y2?" default answer "")
display dialog "Slope = " & (y2 - y1) / (x2 - x1)

Slope Script

Results of running the Slope Script.

Advertisement