Copy link to clipboard
Copied
I need to import specific layers from a template into lots of documents. The source template contains 5 layers but I need only the items on layers 2 & 3 to be duplicated or (paste in place) into Master A-Plates page of the destination documents. The script below indeed works but it is duplicating the items of layers2 &3 on the pages. I need them to be in the Master page A-Plates of the destination document so that way they are available when a new page is added.
tell application "Adobe InDesign 2017"
set doc1 to document 1 -- document to copy from
set doc2 to document 2 -- document to copy to
set allItems to every page item of doc1 whose name of item layer is "Layer2"
-- layer name to copy from
set pageOne to page 1 of doc2
-- page to copy to
duplicate allItems to pageOne
set allItems to every page item of doc1 whose name of item layer is "Layer3"
-- layer name to copy from
set pageOne to page 1 of doc2
-- page to copy to
duplicate allItems to pageOne
end tell
I modified the script to do the same but on the master page but no luck. Any suggestions?
tell application "Adobe InDesign CC 2017"
set doc1 to document 1 -- document to copy from
set doc2 to document 2 -- document to copy to
set allItems to every item of master page items of doc1 whose name of item layer is "layer2" -- layer name to copy from
set pageOne to page 1 of doc2 -- page to copy to
duplicate allItems to pageOne
set allItems to every item of master page items of doc1 whose name of item layer is "layer3" -- layer name to copy from
set pageOne to page 1 of doc2 -- page to copy to
duplicate allItems to pageOne
end tell
Copy link to clipboard
Copied
I need to import specific layers from a template into lots of documents. The source template contains 5 layers but I need only the items on layers 2 & 3 to be duplicated or (paste in place) into Master A-Plates page of the destination documents. The script below indeed works but it is duplicating the items of layers2 &3 on the pages. I need them to be in the Master page A-Plates of the destination document so that way they are available when a new page is added.
tell application "Adobe InDesign 2017"
set doc1 to document 1 -- document to copy from
set doc2 to document 2 -- document to copy to
set allItems to every page item of doc1 whose name of item layer is "Layer2"
-- layer name to copy from
set pageOne to page 1 of doc2
-- page to copy to
duplicate allItems to pageOne
set allItems to every page item of doc1 whose name of item layer is "Layer3"
-- layer name to copy from
set pageOne to page 1 of doc2
-- page to copy to
duplicate allItems to pageOne
end tell
I modified the script to do the same but on the master page but no luck. Any suggestions?
tell application "Adobe InDesign CC 2017"
set doc1 to document 1 -- document to copy from
set doc2 to document 2 -- document to copy to
set allItems to every item of master page items of doc1 whose name of item layer is "layer2" -- layer name to copy from
set pageOne to page 1 of doc2 -- page to copy to
duplicate allItems to pageOne
set allItems to every item of master page items of doc1 whose name of item layer is "layer3" -- layer name to copy from
set pageOne to page 1 of doc2 -- page to copy to
duplicate allItems to pageOne
end tell
Copy link to clipboard
Copied
Might my suggestion in this question be the solution to your problem ?
(Set the option for InDesign to retain the originating layer information.)
Copy link to clipboard
Copied
Hi nellyann,
there is no command to copy or duplicate whole layers from one document to another in InDesign.
Not in the UI, not by scripting.
I cannot help with AppleScript code, but maybe I can solve your issue with ExtendScript code.
But first I have to fully understand what you are after.
What does the source document contain? Some master spreads? Any number of document pages?
And you want to duplicate every page item from all document pages and all master pages of a distinct layer to a certain master spread of the target document? Do I get this right?
Thanks,
Uwe Laubender
( ACP )