List the variables in a folder?

Posted on
Mon Jul 31, 2017 3:50 am
racarter offline
User avatar
Posts: 191
Joined: Jun 18, 2016
Location: North Yorkshire, UK

List the variables in a folder?

Python question:

Other than checking all variables and seeing which folder they're in, is there a more elegant way of getting a list of all the variables in a folder?

Posted on
Mon Jul 31, 2017 6:00 am
DaveL17 offline
User avatar
Posts: 4761
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: List the variables in a folder?

racarter wrote:
Python question:

Other than checking all variables and seeing which folder they're in, is there a more elegant way of getting a list of all the variables in a folder?

There's probably several ways to do this, but here's one way:

Code: Select all
for thing in indigo.variables.iter():
   if thing.folderId == 1863978771:
      indigo.server.log(unicode(thing.name))

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

[My Plugins] - [My Forums]

Posted on
Mon Jul 31, 2017 7:09 am
racarter offline
User avatar
Posts: 191
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: List the variables in a folder?

Thanks Dave - that's exactly how I did it. :)

Posted on
Mon Jul 31, 2017 9:40 am
matt (support) offline
Site Admin
User avatar
Posts: 19042
Joined: Jan 27, 2003
Location: Texas

Re: List the variables in a folder?

Yeah, there isn't an API or filter arg to do this elegantly currently so it has to be brute-force checked.

Image

Posted on
Mon Jul 31, 2017 3:37 pm
racarter offline
User avatar
Posts: 191
Joined: Jun 18, 2016
Location: North Yorkshire, UK

Re: List the variables in a folder?

Thanks Matt :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests