Odd scripting problem
James Sentman
james at sentman.com
Sun Mar 13 12:49:54 EDT 2016
I don’t see the problem with this one this time. Is there anything above the text in the screen shot? You’d do better to cut and paste the text into the email rather than send screen shots, I can’t cut and paste them into my own editor for testing I have to re-type which takes a lot longer than it needs to. I have mostly re-created the script here and it compiles fine, so something must be above that or I’ve missed something important in there which is entirely possible since other folks seem to be telling you other things that I didn’t see as a problem yet...
The script can be simplified though, you don’t need to check for the arivee twice. And you don’t need to have the phrase to speak in there twice since you’re only adding some more to it and not actually changing it. And we should all be using the newer way to set dates by time for the current date for comparisons since it’s so much easier to read.
try something like:
set Arivee to (Get Unit Property "iPhone First To Leave" from unit "iPhone First To Leave Garage")
write log Arivee
set thePhrase to "Good evening, and welcome home " & Arivee
if time of (current date) ≤ date ("11:59am") then
if Arivee = "Mr. and Mrs. Handley" then
if (status "Tennis Flag") then
set thePhrase to thePhrase & "[[slnc 150]] I hope your tennis game was most exzillerating!"
turnoff "Tennis Flag"
end if
say thePhrase
end if
end if
> On Mar 13, 2016, at 12:16 PM, George Handley <ghandley at kc.rr.com> wrote:
>
> Well, I stripped the parens out and put the argument on one line as I originally started, and now it says I have too many “if”s.
>
> I can’t win!
>
> Do you, or anyone see why this script below won’t compile?
>
Thanks,
James
James Sentman http://www.PlanetaryGear.org http://MacHomeAutomation.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20160313/066072e7/attachment.html>
More information about the XTensionList
mailing list