8 Replies Latest reply on Jan 11, 2012 10:34 AM by Harbs.

    Extending native objects?

    Josh000000 Level 1

      I'm not sure how much is possible as far as extending native objects. I was hoping to add a custom property to the Paragraph object.

       

      Maybe I'm writing this wrong...

       

      var doc = app.activeDocument;
      
      Paragraph.prototype.attempts = 0;
      
      var para = doc.pages[0].textFrames[0].paragraphs[0];
      
      para.attempts = 5;
      
      alert(para.attempts);
      

       

      Returns an error:

       

      Object does not support the property or method 'attempts'

       

      It seems to work as look as you don't try to write to the "attempts" property