2 Replies Latest reply on Feb 13, 2012 2:20 PM by JJ0330

    Applesript - Loop through all object by script label name.

    JJ0330 Level 1

      We have some elements in a library that might contain something like 50 rectangles and within each there is a few text boxes and an image.  When we created all the original objects in this element, each one has a Script Label but not unique to each rectangle,  For instance, each rectangle, will have script label called rectangle then each text box will have a script label like Variety, Brand, Price, Size then the image box would be called image.  This worked fine originally when we would use those names like all rectangles with script label = rectangle and apply attributes such as gradient colors and so on and same type for text boxes and images.  Now, looking to maybe take it a step further and be able to assign a unique script label to each object like the first rectangle would be rectangle1 then rectangle2 and so on the each variety text box would be variety1 then variety2 and so on.

       

      Hope I am not over explaining but would like to do something like:  

       

      set x = 1

      do while x not greater than number of rectangles on current page

        set script label of current rectangle to rectanlge + x

        set script label of current textbox to textbox + x

        x = x 1

      loop  

       

       

      Thanks.