How to pass variable value into Indigo log

Posted on
Sat Nov 29, 2003 11:36 pm
morps offline
Posts: 122
Joined: Nov 01, 2003

How to pass variable value into Indigo log

OK, for an Applescript hack, I am purty pleased with myself. I just wrote a script to integrate with WeathermanX to query for the humidity level in my area. If it is greater than a particular value, I disable my irrigation system (using Rain8... it's great!).

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.

Posted on
Sun Nov 30, 2003 8:15 am
jrickmd offline
Posts: 109
Joined: Jun 01, 2003
Location: Texas

Re: How to pass variable value into Indigo log

morps wrote:
Code: Select all
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.


Try

Code: Select all
log "Weather check OK. Will continue with sprinklers as scheduled based on conditions checked at " & ConTime

Rick

Posted on
Sun Nov 30, 2003 8:58 am
morps offline
Posts: 122
Joined: Nov 01, 2003

Re: How to pass variable value into Indigo log

jrickmd wrote:

Try

Code: Select all
log "Weather check OK. Will continue with sprinklers as scheduled based on conditions checked at " & ConTime

Perfect. Thanks for your help!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 21 guests