Copy link to clipboard
Copied
"Can I copy an object and paste it into all pages in the same position as if I pressed Ctrl+Shift+Alt+V using a script? Could someone please provide the code?"
Hi @aghanjar16430960 , Also, a script can duplicate a selected page item and skip the copy and paste. Something like this:
//a selected object
var s = app.activeDocument.selection[0]
var pg = app.activeDocument.pages.everyItem().getElements()
for (var i = 0; i < pg.length; i++){
s.duplicate(pg[i])
}
Copy link to clipboard
Copied
Yes.
If your document is a single page per Spread then you can iterate through Pages collection and just use app.pasteInPlace().
If multiple pages per Spread - then after initial app.pasteInPlace() you'll have to move horizontally by the width of the page - positive or negative - depends on from which page you've copied it from.
Of course you need to take into consideration if all pages have the same width and orientation, etc.
Copy link to clipboard
Copied
Hi @aghanjar16430960 , Also, a script can duplicate a selected page item and skip the copy and paste. Something like this:
//a selected object
var s = app.activeDocument.selection[0]
var pg = app.activeDocument.pages.everyItem().getElements()
for (var i = 0; i < pg.length; i++){
s.duplicate(pg[i])
}
Copy link to clipboard
Copied
thanks