Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

[JS] CS6 .duplicate to top-left of varying size doc

$
0
0

Hey guys,

 

I have a script that prompts the user for a code, opens a doc matching that code from a folder of templates, duplicates those contents on the currently already open document (created by another process), then closes the template doc.

 

It's all working nicely, though the .duplicate() part always places the contents on the template document on the  Left, and Vertically Centered. 
Is there anyway to make it Top-Left ?

 

The blank document templates are being pasted on could vary though, so i guess it would involve getting the dimensions of the blank doc and using them in someway?

 

I see you can specifiy coordinates but 0,0 its always Left, and Vertically Centered, and any other hard-coded numbers might not work for different size docs

doc1.pages[i].pageItems.everyItem().duplicate(doc2.pages[i],[0, 0]);

 

Hope that makes sense!


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>