Advertisement
Guest User

Apple Script Calculator Mac only

a guest
Jun 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. display dialog "What mathematical method you want?" buttons {"Plus", "Minus", "Other"}
  2.  
  3. if the button returned of the result is "Plus" then
  4.     set One to text returned of (display dialog "First Numeral" default answer "" buttons {"OK"} default button 1)
  5.    
  6.     set two to text returned of (display dialog "Second Numeral" default answer "" buttons {"OK"})
  7.     set three to One + two
  8.     display dialog three buttons ("OK")
  9.    
  10. else
  11.    
  12.     if the button returned of the result is "Minus" then
  13.         set One to text returned of (display dialog "First Numeral" default answer "" buttons {"OK"})
  14.        
  15.         set two to text returned of (display dialog "Second Numeral" default answer "" buttons {"OK"})
  16.         set three to One - two
  17.         display dialog three buttons ("OK")
  18.        
  19.     else
  20.        
  21.         if the button returned of the result is "Other" then
  22.             display dialog "What Other method you want?" buttons {"Multiply", "Divide"}
  23.            
  24.             if the button returned of the result is "Multiply" then
  25.                 set One to text returned of (display dialog "First Numeral" default answer "" buttons {"OK"})
  26.                
  27.                 set two to text returned of (display dialog "Second Numeral" default answer "" buttons {"OK"})
  28.                 set three to One * two
  29.                 display dialog three buttons {"OK"}
  30.                
  31.             else
  32.                
  33.                 if the button returned of the result is "Divide" then
  34.                     set One to text returned of (display dialog "First Numeral" default answer "" buttons {"OK"} default button 1)
  35.                     set two to text returned of (display dialog "Second Numeral" default answer "" buttons {"OK"})
  36.                     set three to One / two
  37.                    
  38.                     display dialog three buttons {"OK"}
  39.                 end if
  40.             end if
  41.         end if
  42.     end if
  43. end if
  44.  
  45.  
  46.  
  47. å
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement