Newbie Question - AppleScript

Posted on
Tue Feb 23, 2016 5:51 am
Hank.wheeler offline
Posts: 34
Joined: Nov 24, 2015

Newbie Question - AppleScript

Hi, Sorry for a newbie question ... I am trying a simple applescript to copy a device property value to a variable (named "Watts")


Code: Select all
   set Watts to value of variable "expWattsToday" of device named "EnergyMonitor"


I get the error message:

Can't get value of variable "expWattsToday" of device named "EnergyMonitor"


I know that this property (expWattsToday) exists ... below is from log file

702536144 EnergyMonitor: batteryLevel("0"), expWattsNow("0"), expWattsToday("6049.17"), genWattsNow("0"), genWattsToday("18631.54"),
: lastUpdated("2016/02/23 21:46:41"), networkOwlId("44371910049E"), signalQuality("0"), signalStrength("0"), temperature("25.00"),
: usedWattsNow("0"), usedWattsToday("0"), weatherCode("116"), weatherText("Partly Cloudy"),


... any help will be appreciated.

Posted on
Tue Feb 23, 2016 7:33 am
FlyingDiver offline
User avatar
Posts: 7190
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Newbie Question - AppleScript

That's a property state, not a property value. But I don't do AppleScript, so I don't know if changing that will fix this.

Any reason you're using AppleScript to do this, rather than a variable action?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Tue Feb 23, 2016 10:50 am
jay (support) offline
Site Admin
User avatar
Posts: 18201
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Newbie Question - AppleScript

I don't know what kind of device you're using, but it seems likely it's a custom plugin device. AppleScript has no access to custom state information so you'll need to use a Python script instead, though I agree with FlyingDiver that using the Insert Device State into Variable action is a much faster and less complicated option.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Feb 23, 2016 2:32 pm
Hank.wheeler offline
Posts: 34
Joined: Nov 24, 2015

Re: Newbie Question - AppleScript

thanks guys ... I have definitely over-complicated this :oops: ... I can use the variable actions.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests