It's not clear what your problem is:
Identifying the object or Identifying the value/text of the object
obj_get_info("obj_name", "text", VarName);
should work just fine.
If the actual name of your object changes
with each iteration, then you need to modify
the object's label and use wildcards.
i.e. my app creates a window/screen based
upon the user's name. For my testing,
I create every user name "the same",
Testuser 021603, Testuser 021703.
My screen name becomes Testuser 021603
or Testuser 021603.
So, I edit the label of my object from:
"Testuser 021603" or whatever name the label had when recorded, and save it as:
Logical Name: Testuser