1 Reply Latest reply on Feb 15, 2012 12:37 PM by Muppet Mark

    Applescript - squence in which InDesign gets objects.


      Hi, I'm a little confused.  I load an element from a library with a bunch of text boxes and some images.  These have xml tags and when load xml data, it gets loaded in correct sequence.  There are a group of text frames all with same script label so trying to loop through x amount of times and each time, do something like:


      set x to 8
      repeat until x = 0
      set myLabel to "Brand"

      tell (text frame 1 whose label is myLabel)

      set label to "Brand" & x
      end tell

      set x to x - 1
      end repeat


      Frames are laid out in sequence that we need xml data loaded as below in 2 different rows.  When try telling text frame 1 with label = myLabel, it does last but then gets all out of whack and does  8-4-7-3-6-2-5-1?


      1  2  5  6

      3  4  7  8


      I've noticed when when laid out straight across, (1 2 3 4 5 6 7 8) all on one line, it works but goes in reverse so when I say tell text frame 1 it would be last box number 9 then goes backwards sequentially.


      Not sure what is going on.  Basically, we would like to label these text frames in same sequence as xml data.   Is there any way to reference the xml data from the script that is associated with that text frame then maybe label then frame accordingly?