Pasting scripts

Community Beginner ,
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

95

Likes

translate

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

Adobe Community Professional , 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 =...

Likes

translate

Translate

Translate
Adobe Community Professional ,
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

 

 

Likes

translate

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

Copy link to clipboard

Copied

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

Likes

translate

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