13 Replies Latest reply on Oct 16, 2012 9:53 PM by Green4ever

    Script UI scroll bar is not refreshing. Pls Help Indesign CS5 Win XP

    Green4ever Level 3

      Hi All,


      I need to create a srollbar to scroll a group or panel. First I have collected all paragraphstyles and created a UI window. It is not refreshing after scrolling. Please suggest how to overcome this problem.


      Note: I have tested this for more than 75 paragraph styles. So if you are testing please don't check with less number of paragraph styles.


      #targetengine "session"
      var myParastyleList = app.activeDocument.allParagraphStyles;
      var myTagList = ["Heading1", "Heading2", "Heading3", "Para", "ParaIndented"];
      xml_UI ();
       function xml_UI (){
          var xml_window = new Window('dialog', 'Indesign Test', undefined);
          xml_window.minimumSize.height = 100;
          xml_window.maximumSize.height = 600;
          xml_window.orientation = "row";
          xml_window.alignChildren = "top";
          var scrollGroup = xml_window.add ('panel', undefined, '');
          scrollGroup.orientation = "row";
          var paraStyleGroup  = scrollGroup.add ('group', undefined, '');
          paraStyleGroup.orientation = "column";
          paraStyleGroup.alignChildren = "left";
          var xmlDropListGroup = scrollGroup.add ('group', undefined, '');
          xmlDropListGroup.orientation = "column";
          xmlDropListGroup.alignChildren = "left";
          for(var ps=0; ps<myParastyleList.length; ps++){
              var paraStyle = paraStyleGroup.add('statictext', undefined, myParastyleList[ps].name);
              var xmlTag = xmlDropListGroup.add('dropdownlist', undefined, myTagList);
          var windowBounds = xml_window.windowBounds.height-xml_window.margins[0];
          var scrollBar = xml_window.add("scrollbar", [undefined, undefined, 20, (windowBounds)]);
          scrollGroup.maximumSize.height = windowBounds;
          scrollBar.onChange = function() {
          function scrollTo(move){
              var styleGroup = paraStyleGroup;
              var parGroup = paraStyleGroup.bounds;
              paraStyleGroup.bounds.y = (scrollGroup.bounds.top)-(move);
              xmlDropListGroup.bounds.y = (scrollGroup.bounds.top)-(move);