The getInstances() function returns a list of object names for the given class, but does not return object handles. The syntax is as follows:

         <listname> = getInstances(<classname>);

The following script example retrieves the names of all instances of the class “Card” and stores them in a list. The names stored in the list cannot be used by ASL to reference objects.

ASL Script (get_obj.asl):
START {
 ..eol
}
do {
 x = getInstances("Card");
 print(x);
}
Input:
none
Output:
$ sm_adapter --server=JS1 get_obj.asl
{ CARD0, CARD1, CARD2 }
$