0 Replies Latest reply on Jan 29, 2015 1:40 AM by Evgeny_Trefilov

    .prototype in html panel JSX

    Evgeny_Trefilov Level 1

      Hello all,

       

      I'm used to add new methods to photoshop DOM in jsx scripts with .prototype, i.e.

       

      var Document = function(){};

       

      Document.prototype.activate = function()

      {

      app.activeDocument = this;

      }

       

       

      but when I add this to Photoshop.jsx in html panel, these methods are not added/defined. Is there correct way to do it? I'm currently converting prototypes to functions for workaround, i.e.

       

      function activateDoc(docRef)

      {

           app.activeDocument = docRef;

      }

       

      but it's a pain. and it worked fine for flex extensions..

      I looked through some samples, but seems like no one is using this technique.

       

      Please advise. Thanks a lot!