See below the results (and my comments at the end)
tell current application
do shell script "ps axww|grep -e \"osascript.*Wunderground\"|grep -v grep|wc -l"
--> " 0"
end tell
tell application "IndigoServer"
exists variable "Wunderground_Observation_Time_rfc822"
--> true
get value of variable "Wunderground_Observation_Time_rfc822"
--> "Tue, 26 Feb 2013 02:04:17 GMT"
get value of variable "Wunderground_Observation_Time_rfc822"
--> "Tue, 26 Feb 2013 02:04:17 GMT"
get value of variable "isDaylight"
--> false
exists variable "_Wunderground_APT"
--> true
get value of variable "_Wunderground_APT"
--> "SBRJ"
exists variable "_Wunderground_PWS_List"
--> true
get value of variable "_Wunderground_PWS_List"
--> "IRJRIODE13"
end tell
tell current application
do shell script "> /var/tmp/wunderground_SBRJ_sync_temp.xml;/usr/bin/curl -s -S -m 30
http://api.wunderground.com/auto/wui/ge ... query=SBRJ >/var/tmp/wunderground_SBRJ_sync_temp.xml"
--> ""
do shell script "/usr/bin/egrep \"<station_id>SBRJ</station_id>\" /var/tmp/wunderground_SBRJ_sync_temp.xml"
--> " <station_id>SBRJ</station_id>"
end tell
tell application "System Events"
get XML element 1 of XML file "var:tmp:wunderground_SBRJ_sync_temp.xml"
--> XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_SBRJ_sync_temp.xml"
get XML element "display_location" of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_SBRJ_sync_temp.xml"
--> XML element 5 of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_SBRJ_sync_temp.xml"
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_SBRJ_sync_temp.xml" whose name = "weather"
--> {"Clear"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_SBRJ_sync_temp.xml" whose name = "icon"
--> {"clear"}
end tell
tell current application
do shell script "> /var/tmp/wunderground_PWS_sync_temp.xml;/usr/bin/curl -s -S -m 30
http://api.wunderground.com/weatherstat ... IRJRIODE13 >/var/tmp/wunderground_PWS_sync_temp.xml"
--> ""
do shell script "/usr/bin/egrep \"<station_id>IRJRIODE13</station_id>\" /var/tmp/wunderground_PWS_sync_temp.xml"
--> " <station_id>IRJRIODE13</station_id>"
end tell
tell application "System Events"
get XML element 1 of XML file "var:tmp:wunderground_PWS_sync_temp.xml"
--> XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml"
get XML element "location" of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml"
--> XML element 4 of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml"
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "observation_time"
--> {"Last Updated on February 25, 11:05 PM BRT"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "observation_time_rfc822"
--> {"Tue, 26 Feb 2013 02:05:20 GMT"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "station_id"
--> {"IRJRIODE13"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "temperature_string"
--> {"81.9 F (27.7 C)"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "temp_f"
--> {"81.9"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "temp_c"
--> {"27.7"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "relative_humidity"
--> {"63"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "wind_string"
--> {"From the NNW at 6.0 MPH Gusting to 7.0 MPH"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "wind_dir"
--> {"NNW"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "wind_degrees"
--> {"333"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "wind_mph"
--> {"6.0"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "wind_gust_mph"
--> {"7.0"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "pressure_string"
--> {"29.78\" (1008.4 mb)"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "pressure_in"
--> {"29.78"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "dewpoint_string"
--> {"68.1 F (20.1 C)"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "dewpoint_f"
--> {"68.1"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "heat_index_f"
--> {"85"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "precip_1hr_metric"
--> {"0.0"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "precip_today_in"
--> {"0.00"}
get value of every XML element of XML element 1 of contents of XML file "Macintosh HD:private:var:tmp:wunderground_PWS_sync_temp.xml" whose name = "precip_today_metric"
--> {"0.0 cm"}
end tell
(*0.0 cm*)
tell current application
do shell script "/bin/echo \"0.0 cm\" |/usr/bin/sed -e \"s/[ a-zA-Z]//g\""
--> "0.0"
end tell
tell application "IndigoServer"
log "ParseXML:Can’t make \"0.0\" into type number.(-1700)" using type "Wunderground"
log "Null data from Station 1: IRJRIODE13" using type "Wunderground"
Result:
error "Can’t make \"0.0\" into type number, date or text." number -1700 from "0.0" to number, date or text
The error occurs in the line:
"if precip_1hr_m < 0 then"
If i comment the line above I get an error on the next if clause
"if precip_today_in < 0 then" and the error is "error "Can’t make \"0.00\" into type number, date or text." number -1700 from "0.00" to number, date or text"
If I comment it as well the error moves to the next if clause
"if precip_today_m < 0 then" and the error is "error "Can’t make \"0.0 cm\" into type number, date or text." number -1700 from "0.0 cm" to number, date or text"
If I comment it as well the error happens now in
"set currentTemp to temp_f as number" and the error is error "Can’t make \"81.8\" into type number." number -1700 from "81.8" to number