If I use (on a text frame):
b.selection().fit(FitOptions.frameToContent);
Then it works as expected, this means that the selected object has a fit method.
If I use:
for (var property in b.selection()) {
b.println(property);
}
On the same selection then it doesn't print a fit method.
If I use this:
function getMethods(obj) {
var result = [];
for (var id in obj) {
try {
if (typeof(obj[id]) == "function") {
result.push(id + ": " + obj[id].toString());
}
} catch (err) {
result.push(id + ": inaccessible");
}
}
return result;
}
b.println(getMethods(b.selection()));
Then I don't get the fit method either. And I would really like to know all methods and properties of the selected object. So how do i get them?