4 Replies Latest reply on Sep 1, 2017 10:32 PM by sajidk54358625

    documents[i].artboards.length not working (illustrator scripting)

    sajidk54358625

      Hi there!

      I'm working on an illustrator extendscript where I have to get number of artboards for each opened document. The code may look like this

       

      for (  var i=0  ;  i<app.documents.length  ;  i++  ) {

                    alert(app.documents[i].artboards.length);

           }

       

      But each time I run this script, it returns the number of artboards for active document (only) each time.

      for example if I've 3 documents opened ie. doc1 , doc2 , doc3

      the number of artboards in doc1 is 1, doc2 is 4, and in doc3 is 2

      and I'm currently working with doc2 ( doc2 is active)

      then the script alerts 3 times saying: 4, 4 and 4 each time.

      please help me

      Also tell me if this code is correct or not

       

      thanks in advance

       

      update: I also tried alert( app.documents[1].artboards.length ); , It doesn't work either. having the same problem with this too (shows no: of artboards for active doc)

       

      Tell me if I'm doing wrong