This may not be the prettiest script, but it appears to be doing what I need it to do (constructive criticism always welcomed). The only part I can't get to work properly however, is passing the value of a WeathermanX variable into the Indigo log. I'm trying to log the time of the "Conditions Time" timestamp as used in WeathermanX. Here is my script:
- Code: Select all
tell application "WeatherManX"
set the lastMod to Update Time
set the ConTime to Conditions Time
-- This loop holds the script until WeathermanX does its update
repeat until Update Time is greater than lastMod
UpdateNow
end repeat
set the wet to the Humidity of City "Trabuco Canyon, CA"
end tell
using terms from application "Indigo"
try
-- If it's raining, disable and try again tomorrow
if wet is greater than "98" then
disable time date action "Winter Lawn Sprinklers" for "86400"
log "Winter Lawn Sprinklers action disabled for 24 hours. Will check again tomorrow."
disable time date action "Winter Flower Bed Sprinklers" for "86400"
log "Winter Flower Bed Sprinklers action disabled for 24 hours. Will check again tomorrow."
else
log "Weather check OK. Will continue with sprinklers as scheduled based on conditions checked at {ConTime}"
end if
end try
end using terms from
As you can see, I am trying to pass the value of ConTime into the log. Anyone who has an interest in assisting with this, your time is appreciated.