Copy link to clipboard
Copied
I have 6665 images, I am using data merge with the inline merge script to place a flow of 9 square images on each page of my book. Now I need to rotate each image sequencially by -0.054 degrees. Example image one is rotated -0.054, image two by -0.108, image three -0.162 and so on until the last image has been rotated to -360 degrees. I have a .csv file that lists each rotation for each square object. Is there a script that could automate the 6665 rotations? If not, anyone willing to create on for me?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi Obi-wan,
how do you calculate the position of the graphic frames on the page to get the right order of rotating the elements?
Just a warning:
Do not assume that data merge is doing all objects in timely oder of the CSV list given when creating something.
And that means in the end: Do not assume that pageItem.everyItem() or allPageItems reflect the order the OP wants to see.
A little example with 4 page items in the document:
Here a little snippet:
var e = app.documents[0].pageItems.everyItem().getElements();
for(var n=0;n<e.length;n++)
{
$.writeln(n+"\t"+e
.id+"\t"+"pageItems.everyItem()"+"\t"+ e ); };
var a = app.documents[0].allPageItems;
for(var n=0;n<a.length;n++)
{
$.writeln(n+"\t"+a
.id+"\t"+"allPageItems "+"\t"+ a .getElements()[0]); };
/*
0 234 pageItems.everyItem() [object Oval]
1 236 pageItems.everyItem() [object Rectangle]
2 231 pageItems.everyItem() [object Rectangle]
3 233 pageItems.everyItem() [object Polygon]
0 233 allPageItems
[object Polygon] 1 236 allPageItems
[object Rectangle] 2 234 allPageItems
[object Oval] 3 231 allPageItems
[object Rectangle]
*/
Regards,
Uwe
Copy link to clipboard
Copied
Hi Uwe,
I've tested on 10 pages and the 2 scripts work well!
I've posted a warning about that: the frames need to be placed on the master page I've used in a "right" order.
… or maybe I forget something! …
Maybe a good approach would be to include a supplementary loop to compare the X/Y-offset of each frame per page!?
(^/)
Copy link to clipboard
Copied
Obi-wan Kenobi wrote:
… Maybe a good approach would be to include a supplementary loop to compare the X/Y-offset of each frame per page!?(^/)
Exactly.
Regards,
Uwe
Copy link to clipboard
Copied
Obi Wan Kenobi,
Sorry for my delayed reply! Thank you so much for your help with this, I REALLY appreciate it!
I have been away from this project for a couple of days but I will try out the script now.
All the best
Jennifer