Arithmetic From Dialogue, Applescript

I need to add arithmetic from dialogue boxes in AppleScript. I'm pretty new, so bear with me.


I currently have this, but it doesn't work.


set one to (display dialog "Protons" buttons {"OK"} default button "OK" default answer "#")

set two to (display dialog "Protons" buttons {"OK"} default button "OK" default answer "#")

set answer to one + two

display dialog answer

MacBook Pro 15", macOS 10.14

Posted on Feb 25, 2019 9:59 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 25, 2019 10:04 AM

Use the following:


set one to text returned of (display dialog "Protons" buttons {"OK"} default button "OK" default answer "#")

set two to text returned of (display dialog "Protons" buttons {"OK"} default button "OK" default answer "#")

set answer to one + two

display dialog answer


(168894)

3 replies
Question marked as Top-ranking reply

Feb 25, 2019 10:04 AM in response to PLKids

Use the following:


set one to text returned of (display dialog "Protons" buttons {"OK"} default button "OK" default answer "#")

set two to text returned of (display dialog "Protons" buttons {"OK"} default button "OK" default answer "#")

set answer to one + two

display dialog answer


(168894)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Arithmetic From Dialogue, Applescript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.