display dialog "Make sure your temperature to convert its written down on the calculator app before going any further." with title "Temperature Converter" buttons {"Fahrenheit to Rankine", "Rankine to Fahrenheit", "Cancel"}
set the button_pressed to the button returned of the result
if the button_pressed is "Fahrenheit to Rankine" then
tell application "Calculator" to activate
tell application "System Events"
keystroke "+459.67" --FAHRENHEIT TO RANKINE FORMULA
key code 36
keystroke "c" using command down
end tell
else if the button_pressed is "Rankine to Fahrenheit" then
tell application "Calculator" to activate
tell application "System Events"
keystroke "-459.67" --RANKINE TO FAHRENHEIT FORMULA
key code 36
keystroke "c" using command down
end tell
end if
Fahrenheit to Rankine and Rankine to Fahrenheit temperature converter.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.