title: get all methods and properties of an object
body: <p>If I use (on a text frame):</p>
  
  <pre><code>b.selection().fit(FitOptions.frameToContent);
  </code></pre>
  
  <p>Then it works as expected, this means that the selected object has a fit method.</p>
  
  <p>If I use:</p>
  
  <pre><code>for (var property in b.selection()) {
      b.println(property);
  }
  </code></pre>
  
  <p>On the same selection then it doesn't print a fit method.</p>
  
  <p>If I use this:</p>
  
  <pre><code>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()));
  </code></pre>
  
  <p>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?</p>