Copy link to clipboard
Copied
Hi,
I try to copy a logo on page 2 and paste it in place on page 3.
When I presee shift+opt+cmd+V, it is pasted on page 2.
Is there any better way?
Hosun
Create an object style and setup the position of the frame in the object syle definition.
Rather than Paste in Place why not put the logo into position on a Parent (aka Master) page since it looks like you are using the same layout on both pages?
Other than that you might want to log this in as a feature request at https://www.adobe.com/products/wishform.html.
OK, this WORKS 😄
//Paste In Place to destination page
//Select a page item, run script, and double-click a page in the Pages panel
#targetengine "pasteinplace";
PasteInPlace()
var el, b, s;
var or = app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
function PasteInPlace(){
if (app.selection.length > 0) {
var doc = app.activeDocument;
s = doc.selection[0];
// b = s.geometricBounds;
// app.copy()
var el = app.addEventListener("a
...
Copy link to clipboard
Copied
I'm away from my laptop to test it - but I can bet it will work even with spreads that have more than two pages 😉
Copy link to clipboard
Copied
Yes it works as long as you explicitly code the destination page.
If I want to choose any page, you will need put up a dialog and ask me which page I want, or listen for an active page event, which is trickier. Paste In Place decides where to paste the object based on the currently active page, which might not be on the same spread as the copied object—it’s whatever page is currently selected in the Pages panel
Also, to imitate Paste In Place with a dialog we need to use the duplicate() method—Paste in Place doesn’t remove the original. So the first script I posted with the dialog would be better the duplicate method.
Copy link to clipboard
Copied
no longer valid 😉 - can be removed by moderator, thx.
Copy link to clipboard
Copied
no longer valid 😉 - can be removed by moderator, thx.
Copy link to clipboard
Copied
OK, this WORKS 😄
//Paste In Place to destination page
//Select a page item, run script, and double-click a page in the Pages panel
#targetengine "pasteinplace";
PasteInPlace()
var el, b, s;
var or = app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
function PasteInPlace(){
if (app.selection.length > 0) {
var doc = app.activeDocument;
s = doc.selection[0];
// b = s.geometricBounds;
// app.copy()
var el = app.addEventListener("afterAttributeChanged", getBounds);
el.name = "PIP"
// alert(app.activeDocument.layoutWindows[0].activePage);
} else {
alert("Please Make a Selection")
return
}
}
function getBounds(e) {
if (e.attributeValue.constructor.name === 'Page') {
app.menuActions.itemByID(118788).invoke();
// alert(doc.activeWindow.activePage);
// app.paste();
// app.selection[0].geometricBounds = b;
// alert(s.attributeValue.constructor.name);
s.duplicate(app.activeDocument.layoutWindows[0].activePage);
app.eventListeners.itemByName("PIP").remove();
app.activeDocument.viewPreferences.rulerOrigin = or;
}
}
Copy link to clipboard
Copied
If you're on the same spread, step and repeat would be the way to go. Just set the horizontal offset to the width of the pages. This setting should be sticky so it would work throughout the document. You'd need to change it if you're pasting from right to left pages.
Copy link to clipboard
Copied
No need for Step & Repeat 😉 there is a quicker way 😉 you can just execute PasteInPlace then - like you've suggested - add page's width to X location - InDesign is doing math automatically in ALL numeric fields 🙂