Unfortunately, InDesign does not save the direction or percentage of gradient applied - it's a manual task.
To get a gradient to go that direction, you need to use the Gradient Tool from the Tool Bar
With Nothing selected use the Keyboard shortcut (G) to call up the Gradient Tool
You can then drag the gradient tool over the image to alter the appearance of the Gradient.
Drag from the Bottom of the frame up to the Top of the frame to get a similar look.
I do not know if this can be scripted to copy the gradient?
the very strange thing here is that both rectangles have been built using a script which executed the very same code two times.
EDIT: the direction is not an issue, because both have 90 degrees gradient rotation. So, the odd thing is the difference in colour. But I cannot seem to find a difference using Indesign panels...
There must be something going on that makes the script behave differently...
Thanks for checking!
I don't know what script it is? You'd have to post a link to where it can be downloaded from.
Not easy...It's part of a quite complex VB Application that automates Indesign and builds whole portion of catalogues, so it's difficult to reduce and nail it down to something meaningful to be examined.
I'm going to check again the code and do some debug.
What happens now is that at the end of the script execution a random number of these rectangles - which actually are used as background for part photos - are like the left rectangle, and the others are like the right one
But they are all made by the same procedure, so I'm going nuts trying to figure out what's missing or different in their settings.
Contact the maker of the script and ask them if they have a fix.
I am the maker and I'm looking for the fix... but since I don't know what's wrong I don't know what to fix
It looks like I'm on something: if the script applies the gradient before setting the gradient angle, the gradient can get distorted.
By setting the gradient angle before applying the gradient, it seems the gradient is kept consistent.
as I said already - there's nothing anyone can do to help unless they see the script itself.
Try posting it in the scripting forum to see if someone has a fix.