3 Replies Latest reply on Feb 11, 2011 4:18 PM by Jennifer IceRider

    [PS]  Why does app.activeDocument go out of scope/null ?

    Jennifer IceRider Level 1

      In a  Timer callback in my AS3 code, I try to get  the current active PSD document :

       

                          var myDocument:com.adobe.photoshop.Document = app.activeDocument;

       

      The document is open, in fact it is the only open document, yet activeDocument comes out null when read from the Timer callback.

       

      I have a button in my extension panel, which when clicked also tries to read the active document property. That works. Suggesting some issue with async callbacks ?

       


      So why should it matter if an asynchronous callback is requesting the activeDocument. Same issues occurs from inside an HttpService

      callback (on request completion).

       

      Exact same code work in InDesign.

       

      Is this a bug in PS CS-SDK ? Any recipie to deal with the activeDocument issue ?  I can't change the code to become synchronous, have

      to rely on timer/Http service callbacks  to pull the activeDocument property.