• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is there a InDesign script that rotates objects based on a degree of rotation listed in .csv file?

New Here ,
Feb 04, 2017 Feb 04, 2017

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?

TOPICS
Scripting

Views

775

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 04, 2017 Feb 04, 2017

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 05, 2017 Feb 05, 2017

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:

Polygon-Oval-Rectangles-OnPage.png

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 05, 2017 Feb 05, 2017

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!?

(^/)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2017 Feb 08, 2017

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2017 Feb 07, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines