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
set gradient fill angle to 90
To get at grouped items, you need to use "all page items', and filter from there. Something like:
set gradient fill angle of every item of all page items whose class is text frame and name of fill color is "PromotiontypeGradient" to 90
Aha! Yes it was the grouped items. I still have a problem where the colour seems to go solid, but I think that's just my monitor. When I redefine the gradient with contrasting colours (as opposed to 2 shades of red as it should be) it all works, so I will try this at work tomorrow and fingers crossed a lot of time will be saved.
... Unfortunately, this is still resulting in flat red panels, with no gradient. I've posted in the general forum, as I think my scripting problem is solved, but something else is very wrong!