3 Replies Latest reply on Nov 13, 2012 1:34 AM by SmallHangHang03030

    Colum count does not work    T.T

    SmallHangHang03030

      pls help >.<

      i don't know what happened..

       

       

      i want to count the number to colnum and doing someing else...

       

       

       

       

       

       

      function myProcessText(myTextObject){

          var myDoc=app.activeDocument;

      var    myParagraphStyle = myDoc.paragraphStyles.item("50 Table_txt");

              myName = myParagraphStyle.name;

          app.selection[0].applyParagraphStyle(myParagraphStyle, true);

      var tabletable = myDoc.tableStyles.item("Table");

      var myTable = app.selection[0].convertToTable("\t","\r");

       

       

      var whichScript = myTable.columns.length;

       

      switch(whichScript){

       

      case  (whichScript = 3) :

       

      {

      myTable.appliedTableStyle= tabletable

          myTable.rows.itemByRange(0,3).rowType = RowTypes.headerRow;

          myTable.columns.item(0).width = "92 mm";

      myTable.columns.itemByRange(1,2).width = "30 mm";

      var celltable = myDoc.cellStyleGroups.item('Hang').cellStyles.item('Table');

      myTable.cells.everyItem().appliedCellStyle = celltable;

       

      break;}

       

       

      case (whichScript = 4)  :

       

       

      {myTable.appliedTableStyle= tabletable

          myTable.rows.itemByRange(0,3).rowType = RowTypes.headerRow;

          myTable.columns.item(0).width = "77 mm";

      myTable.columns.itemByRange(1,2,3).width = "25 mm";

      var celltable = myDoc.cellStyleGroups.item('Hang').cellStyles.item('Table');

      myTable.cells.everyItem().appliedCellStyle = celltable;

       

      break;}

       

       

       

       

      }

       

       

       

       

       

       

       

      }