'waitForObject returns the first object matching the pattern. Is there a way I can get list of all objects?
I need a list of all objects with same property/type. Is there a way or an API(just like waitForObject) where I give the type/property and get list of all objects. I am using Python script for Squish.
Solution 1:[1]
You can findAllObjects(objectName):
This function finds and returns a list of object references identified by the symbolic or real (multi-property) name objectName. Because it can return multiple object references, the name must not contain the occurrence property. The given name can also be a native script dictionary (resp. hash) value.
Solution 2:[2]
An other (more complicated but more generic) way might be using the object.children() to the container of the objects you are looking for. The list of children needs to be filtered afterwards.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | frog.ca |
Solution 2 | A_Wdgnm |