Some more information would have been helpful, I had to try different things for myself to see when this exactly happens. Apparently, you have some text selected and do an "app.selection.createOutlines(true)" on that -- that gives the result you describe, a new anchored object in the active story (and as a side result, the original text disappears).
Since you are converting to outlines yourself, it would be easiest to label the new object as 'this was text'. The createOutlines method returns the newly created object as an array (and I think it always has just one item, but you should check that -- I repeat you should check that), and you can change your code to
a = app.selection.createOutlines(true);
a.label = "this used to be text, honestly";
Later on, if you need to know whether a specific anchored object used to be text, check its label.
If you already converted tons of text to outlines and only now thought of checking, I guess any object with more than a certain number of path segments would qualify as 'not a regular frame'. A quick check using
shows that rectangles and ellipses have only 1 path, the text 'Wot', converted to outlines, is a single polygon consisting of 4 paths (the outside of characters 'W', 'o', and 't', and the inner circle of the 'o'). In case of doubt with a single path, you could check the number of pathPoints per path:
(where you probably should check every path, not assume it's the 0-th one). This results 4 for a single rectangle or ellipse, and 24 for a 'W' converted to outlines.
Note that this is not a 100% sure way of checking. A 5-pointed star drawn with the polygon tool has 10 path points; on the other end, a lowercase Helvetica 'L', converted to outlines, is for all practical purposes indistinguishable from a regularly created rectangular frame.
this is not working that you gave,
can you tell me one?
how can i get access anchor object text frame text value
pls tell me..
Perhaps this will help:
shows how to get the inline items, if you run it with the text cursor within a story (a text frame). If you select a frame it shows the number of contained items (anchored objects or inline items) plus 1, as it counts the frame itself as well. I don't know how to differentiate between anchored objects and inline ones at this point.