RosettaCodeData/Task/Integer-comparison/AppleScript/integer-comparison-1.applescript

13 lines
432 B
AppleScript
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
set n1 to text returned of (display dialog "Enter the first number:" default answer "") as integer
set n2 to text returned of (display dialog "Enter the second number:" default answer "") as integer
set msg to {n1}
if n1 < n2 then
set end of msg to " is less than "
else if n1 = n2 then
set end of msg to " is equal to "
else if n1 > n2 then
set end of msg to " is greater than "
end if
set end of msg to n2
return msg as string