14 Replies Latest reply on Oct 5, 2008 2:15 AM by (Simon_Paterson)

    [CS3][JS][ScriptUI] Observing changes to user selection (advanced)

    (Simon_Paterson) Level 1
      I have a simple ScruitUI palette working in InDesign which displays the area of a selected page item.
      When the user selects a page item and launches the palette the area is calculated and the palette displays the result correctly.

      I cannot work out, however, how to update the calculated area when the user changes the selection. I can use the onMove and onResize events on the palette window to trigger the recalculation, but I would like another way that did not involve the user moving or re-sizing the palette. Something like onActive so that all the user had to do was click on the palette to trigger a recalculation.

      The simple way out is to create a button on the palette which the user clicks to update the area information, and this may be the best I can do at the moment. I was just wondering if any of the experts had some insight into other techniques for observing changes to selection from a palette. It would be amazing to have a scripted observer that could change the palette without the user doing anything special, in the same way that InDesign panels (like Info) work, but I realize I'm asking a lot from a scripting DOM that is already amazingly comprehensive.