Average of two variables?

Posted on
Sun Mar 05, 2017 6:43 pm
riskyone offline
Posts: 2
Joined: May 08, 2013

Average of two variables?

Hello: I'm looking for a little help. I'd like to take the average of two variables and place it in a 3rd variable. Can anyone suggest an easy way to do so? I do not know python, but do know a little applescript - hoping scripting is not necessary. Thank you in advance, John.

Posted on
Sun Mar 05, 2017 7:35 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Average of two variables?

riskyone wrote:
Hello: I'm looking for a little help. I'd like to take the average of two variables and place it in a 3rd variable. Can anyone suggest an easy way to do so? I do not know python, but do know a little applescript - hoping scripting is not necessary. Thank you in advance, John.

Don't worry if you don't know Python--this script should work for you. Replace the large numbers with the IDs of your variables (x and y) are your input variables and (z) is your output variable.

Code: Select all
x = float(indigo.variables[1941717410].value)
y = float(indigo.variables[1506477137].value)

z = (x + y) / 2

indigo.variable.updateValue(283709108, str(z))

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests