2 Replies Latest reply on Mar 15, 2013 6:22 PM by longcmtn

    Table Script Label




      I'm new to indesign scripting and am using javascript / extendscript.   I paginate a document and get an array of all tables in the paginated document using


      var myTables = myDoc.stories.everyItem().tables.everyItem().getElements();


      I then walk through them in a for loop one by one conditionally applying a block of code.


      I need to make it a little smarter and apply different blocks of code depending on the script label.  I'd like to be able to:


      if(myTables[i].label=="1") {.... do this code ....}

      else if(myTables[i].label=="2") {... do this code ...}


      The problem is it appears I can assign a script label to the text frame the table sits in, but not the table itself.  If that's correct, is there an easy way for me to get the tables text frame's script label from the array element (myTables[i]) I'm currently sitting on in my loop?


      Please speak slowly or it's likely to fly right by me