0 Replies Latest reply on Apr 20, 2016 4:45 AM by Legalized

    catching activeDocument change - photoshop cs6 html widget


      I'm working on a html widget panel for photoshop cs6 (company won't upgrade for another year or two). Made a flash container with configurator 4 that shows a html page from assets folder. All of the ui and code is neatly packed in that html and onload everything is working fine. Panel is reading _Adobe.JSXInterface.app.activeDocument and on window load javascript is populating classname and innerhtml. That part works like it should.


      Problem starts when activeDocument is changed (either by switching to another document or document close). Way I 'hacked' this problem was to implement onmouseover event (with 1sec timeout to debounce) that rereads activeDocument and repopulates classname and innerhtmls. Which kinda works - if I move mouse over panel. And has some lousy side-effects: mouse loses window resize grab after 1sec. I did it this way because I was unable to catch documentAfterActivate event or figure out any other proper way of handling this issue.


      So, does anyone have any idea how to tackle this problem in photoshop cs6?


      (TLDR version: How to "refresh" html widget panel in cs6 when app.activeDocument changes?)


      Thanks in advance!