View unanswered posts | View active topics It is currently Sat May 18, 2013 9:38 am



Reply to topic  [ 12 posts ] 
 Embedded script not working in 10.6 
Author Message

Joined: Dec 26, 2007
Posts: 486
Location: British Columbia
Post Embedded script not working in 10.6
I'm sure (almost) this script worked in 10.5 but not since going 10.6.
What did I screw up?

Code: Select all
if (value of variable "garageTemperature" is greater than 64) then
    -- do whatever you need to do here
    turn on "GI10 FanGarageUp"
    log "GI10 FanGarageUp ON - temp is " & value of variable "garageTemperature"
else
    turn off "GI10 FanGarageUp"
    log "GI10 FanGarageUp OFF - temp is " & value of variable "garageTemperature"
end if

Produces this error:
Code: Select all
  Error              script error: around characters 22 to 23
  Error              script error: Expected “,” but found “"”. (-2741)

I'm basically turning a fan on/off based on variable garageTemperature. The fan is plugged into an Insteon appliance module.

TIA


Sat Sep 26, 2009 11:24 pm
Profile WWW
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post Re: Embedded script not working in 10.6
hwitten wrote:I'm sure (almost) this script worked in 10.5 but not since going 10.6.
What did I screw up?

Code: Select all
if (value of variable "garageTemperature" is greater than 64) then
    -- do whatever you need to do here
    turn on "GI10 FanGarageUp"
    log "GI10 FanGarageUp ON - temp is " & value of variable "garageTemperature"
else
    turn off "GI10 FanGarageUp"
    log "GI10 FanGarageUp OFF - temp is " & value of variable "garageTemperature"
end if

Produces this error:
Code: Select all
  Error              script error: around characters 22 to 23
  Error              script error: Expected “,” but found “"”. (-2741)

I'm basically turning a fan on/off based on variable garageTemperature. The fan is plugged into an Insteon appliance module.

TIA


If you try to run that in an external script (or from Script Editor) you'll get that error because it's not inside a tell to IndigoServer block. I also ran it as an embedded script in an action group and it executed fine.

Where/how is the script actually executing?

_________________
Jay (Indigo Support)
Image


Sun Sep 27, 2009 7:52 am
Profile WWW

Joined: Dec 26, 2007
Posts: 486
Location: British Columbia
Post 
It's a" Trigger" on "variable changes", "Always", "Execute AppleScript" and the code is "Embedded".


Sun Sep 27, 2009 9:31 am
Profile WWW
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post 
hwitten wrote:It's a" Trigger" on "variable changes", "Always", "Execute AppleScript" and the code is "Embedded".


Odd. Like I said, it's working for me. Try these and let me know the results of each:

1) Select the trigger event and click on the "Execute Actions Now" button at the bottom of the screen.
2) Open the trigger event, select the Actions tab, make some trivial change to the script (add then remove a space or something) and click the "Compile" button.
3) Enclose the whole script in a tell to IndigoServer block then click on the "Run" button.

_________________
Jay (Indigo Support)
Image


Sun Sep 27, 2009 1:58 pm
Profile WWW

Joined: Dec 26, 2007
Posts: 486
Location: British Columbia
Post 
I'll try that in a bit. Thanks Jay. Yard work first while it's still sunny out :)

Are you running 10.5 or 10.6?


Sun Sep 27, 2009 2:14 pm
Profile WWW
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post 
hwitten wrote:I'll try that in a bit. Thanks Jay. Yard work first while it's still sunny out :)

Are you running 10.5 or 10.6?


10.6.1

_________________
Jay (Indigo Support)
Image


Sun Sep 27, 2009 5:24 pm
Profile WWW

Joined: Dec 26, 2007
Posts: 486
Location: British Columbia
Post 
This is frustrating.

Same error, no matter what.
Adding a comma after variable moved the error but no clean compile without commenting the 'turn off' in the else.

I'm going to go back to the mini tomorrow, if it's inside weather :), and start over. It's still on 10.5.

Jay, is your 10.6.1 a clean 10.6 install or upgrade.
Mine was an upgrade. Wonder if that could have caused the grief.
Grrrr.


Sun Sep 27, 2009 9:19 pm
Profile WWW
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11675
Location: Texas
Post 
Have you tried a Restart of the Mac? Maybe it has gotten into a bad state.

_________________
Image


Sun Sep 27, 2009 9:36 pm
Profile WWW

Joined: Dec 26, 2007
Posts: 486
Location: British Columbia
Post 
Did another in case I had missed a restart earlier in the heat of battle.

No diff :(


Sun Sep 27, 2009 9:55 pm
Profile WWW

Joined: Dec 26, 2007
Posts: 486
Location: British Columbia
Post 
Back on the Mini, 10.5.8, Indigo 4 beta 2, 2412 controller.
Will upgrade to beta 4 once I get the Mini settled down.
iMac (the 'troublemaker') is turned off, 2414 unplugged from hydro.

Just a double-check.
After getting the Mini up I started a re-sync. Am I doing it correctly?
Interface --> Start Sync INSTEON Device Links...
or should I be using the Sync in Preferences --> Interface Options?

The script works as an embedded. Wasn't dreaming/having a nightmare after all :)


Sun Sep 27, 2009 10:45 pm
Profile WWW
Site Admin
User avatar

Joined: Jan 27, 2003
Posts: 11675
Location: Texas
Post 
hwitten wrote:Just a double-check.
After getting the Mini up I started a re-sync. Am I doing it correctly?
Interface --> Start Sync INSTEON Device Links...
or should I be using the Sync in Preferences --> Interface Options?

Do the first one from the Interface menu. It'll have an option to sync everything. The one in the Interface Options dialog only syncs the PowerLinc's links and not the remote modules.

_________________
Image


Tue Sep 29, 2009 6:01 pm
Profile WWW

Joined: Dec 26, 2007
Posts: 486
Location: British Columbia
Post 
Lucked out. Didi it right :)

Thanks


Tue Sep 29, 2009 7:46 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 12 posts ] 

Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.