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

Pasting scripts

Explorer ,
Jan 15, 2021 Jan 15, 2021

Copy link to clipboard

Copied

Hi All, I hope you're doing well.

 

I'm hoping to see if anyone knows of similar scripts to help me paste an object on page 1 and then again paste the same object on page 2, move it by certain X or Y, and then paste the same object on the 3rd page, move it by X or Y (same X or Y as before) and so on for every 5 pages or so. Once done the first 5-8 pages and I have to copy a different object to paste before doing the same process.

 

I did this all manually the first time and I spotted a lot have been misplaced. 300+ pages and I can't imagine doing this again for the sake of my wrists! I mean, I would if I have to but I would love the opportunity not to. I tried to find Apple Script as well but no luck so far. Please help!

TOPICS
How to , Scripting

Views

247

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

correct answers 1 Correct answer

Community Expert , Jan 16, 2021 Jan 16, 2021

This JavaScript will duplicate the current selection to the pages after the selection’s page. You can change the r, xoff, and yoff as needed—the units are inches:

 

//times to repeat
var r = 5
//the amounts to offset the x and y
var xoff = .25
var yoff = .25


var d = app.documents.item(0);
d.viewPreferences.properties = {horizontalMeasurementUnits:MeasurementUnits.INCHES, verticalMeasurementUnits:MeasurementUnits.INCHES}
var s = d.selection[0];
var pn = s.parentPage.documentOffset;
for (var i =
...

Votes

Translate

Translate
Community Expert ,
Jan 16, 2021 Jan 16, 2021

Copy link to clipboard

Copied

This JavaScript will duplicate the current selection to the pages after the selection’s page. You can change the r, xoff, and yoff as needed—the units are inches:

 

//times to repeat
var r = 5
//the amounts to offset the x and y
var xoff = .25
var yoff = .25


var d = app.documents.item(0);
d.viewPreferences.properties = {horizontalMeasurementUnits:MeasurementUnits.INCHES, verticalMeasurementUnits:MeasurementUnits.INCHES}
var s = d.selection[0];
var pn = s.parentPage.documentOffset;
for (var i = 1; i < r+1; i++){
    pn++
    var p = d.pages[pn]
    s.duplicate(p, [xoff*i, yoff*i])
};   

 

Here’s the compiled script

https://shared-assets.adobe.com/link/c6a8c906-3c90-443e-5a58-7cd2ecbc126e

 

 

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
Explorer ,
Jan 16, 2021 Jan 16, 2021

Copy link to clipboard

Copied

LATEST

Wow, this is amazing!! Thank you so much for your help. Truly appreciate it!

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