3 Replies Latest reply on Dec 20, 2010 12:08 AM by Cooroo

    [AS] Set Gradient Fill Angle

    Cooroo Level 1

      I am using XTags to build a document in ID, but for some reason all my gradient fills have a 0degree angle and they all need changing to 90deg.


      I can change a single box successfully, so I know the 'core' line of script works. My problem is finding a loop that does the job. The results are erratic. If the boxes with the fills are part of a group they don't change. If I ungroup everything (which I don't want to do as each group is a product image, description, price and need to move together), then a change happens - but although the gradient box shows 90deg, the boxes all look to be filled with solid red (instead of light to dark red as they should be).


      This is the sort of thing I'm playing with:


      tell application "Adobe InDesign CS5"

      tell document 1

      set gradboxes to object reference of every text frame whose name of fill color is "PromotionTypeGradient"

      repeat with i in gradboxes

      tell i

      set gradient fill angle to 90

      end tell

      end repeat

      end tell

      end tell

      I tried doing this with find/change, but got the same result - the fill seems to be solid red.
      Any suggestions? Is my approach fundamentally wrong?