Page 1 of 1

Applescript conversion needed

PostPosted: Sun Dec 10, 2017 7:02 pm
by CraigM
Could some please show me how to convert this to Python
Code: Select all
set t to value of variable "TemporaryAuthCode"
set value of variable "TemporaryAuthCode" to t & "1"

Re: Applescript conversion needed

PostPosted: Sun Dec 10, 2017 9:58 pm
by jay (support)
Code: Select all
t = indigo.variables[VARIDHERE].getValue(int)
indigo.variable.updateValue(VARIDHERE, value=str(t+1))

Re: Applescript conversion needed

PostPosted: Mon Dec 11, 2017 11:30 am
by jay (support)
I may have misread your script. On first glance it looked like you were trying to increment a variable. However, your script is appending a "1" onto the end of the variable value. If that's what you want, then:

Code: Select all
t = indigo.variables[VARIDHERE].value
indigo.variable.updateValue(VARIDHERE, value=t + "1")

Re: Applescript conversion needed

PostPosted: Mon Dec 11, 2017 1:06 pm
by CraigM
jay (support) wrote:
I may have misread your script. On first glance it looked like you were trying to increment a variable. However, your script is appending a "1" onto the end of the variable value. If that's what you want, then:

Code: Select all
t = indigo.variables[VARIDHERE].value
indigo.variable.updateValue(VARIDHERE, value=t + "1")

Thanks Jay