This little script gets the current temperature from app WeatherCat.
All works well except that it often tells me the temperature out to 6, 8 or 10 decimal places.
I would like it to stop at 1 decimal place even it the temperature is exactly a number with no decimal places.
Of course I am a no nothing about apple script.
Any help would be appreciated.
tell application "WeatherCat"
set oldCurrentTemperature to 40
repeat
set currentTemperature to ExternalTemp
if oldCurrentTemperature is not currentTemperature then
tell current application
say "Current temperature is"
say currentTemperature as string
end tell
end if
set oldCurrentTemperature to currentTemperature
delay 60
end repeat
end tell
All works well except that it often tells me the temperature out to 6, 8 or 10 decimal places.
I would like it to stop at 1 decimal place even it the temperature is exactly a number with no decimal places.
Of course I am a no nothing about apple script.
Any help would be appreciated.
tell application "WeatherCat"
set oldCurrentTemperature to 40
repeat
set currentTemperature to ExternalTemp
if oldCurrentTemperature is not currentTemperature then
tell current application
say "Current temperature is"
say currentTemperature as string
end tell
end if
set oldCurrentTemperature to currentTemperature
delay 60
end repeat
end tell