Highlighted

inDesign Import layers via Applescript

New Here ,
May 21, 2020

Copy link to clipboard

Copied

Is it possible via Applescript to import specific layers from an Indesign into another?  I don't need to create the layers in InDesign. Basically, if the ID template contains 5 layers & I need only layers 3 & 4 to be imported into my document.
tell application "Adobe InDesign CC 2017"

   tell document 1
       -- I'm not sure if can be done or not
   end tell
end tell

The other idea I have will be to hide the layers I don't need from the template & leave the ones I need, select all & then copy into my document.  Any thoughts?
I found a javascript in another site that kind does I what I need but I would like to use Applescript since I know a little bit about it
Thank you

Adobe Community Professional
Correct answer by BarlaeDC | Adobe Community Professional

Hi,

 

You should be able to do something like this:

 

tell application "Adobe InDesign 2020"
	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 "Layer 1" -- layer name to copy from
	
-- if you are wanting to keep them to specific pages you will need to sort the pages before you call the duplicate command
	set pageOne to page 1 of doc2 -- page to copy to
	duplicate allItems to pageOne
	
end tell

 

Hope this helps

Malcolm

Topics

How to, Scripting

Views

333

Likes

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

inDesign Import layers via Applescript

New Here ,
May 21, 2020

Copy link to clipboard

Copied

Is it possible via Applescript to import specific layers from an Indesign into another?  I don't need to create the layers in InDesign. Basically, if the ID template contains 5 layers & I need only layers 3 & 4 to be imported into my document.
tell application "Adobe InDesign CC 2017"

   tell document 1
       -- I'm not sure if can be done or not
   end tell
end tell

The other idea I have will be to hide the layers I don't need from the template & leave the ones I need, select all & then copy into my document.  Any thoughts?
I found a javascript in another site that kind does I what I need but I would like to use Applescript since I know a little bit about it
Thank you

Adobe Community Professional
Correct answer by BarlaeDC | Adobe Community Professional

Hi,

 

You should be able to do something like this:

 

tell application "Adobe InDesign 2020"
	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 "Layer 1" -- layer name to copy from
	
-- if you are wanting to keep them to specific pages you will need to sort the pages before you call the duplicate command
	set pageOne to page 1 of doc2 -- page to copy to
	duplicate allItems to pageOne
	
end tell

 

Hope this helps

Malcolm

Topics

How to, Scripting

Views

334

Likes

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
May 21, 2020 0
Adobe Community Professional ,
May 21, 2020

Copy link to clipboard

Copied

Hi,

 

You should be able to do something like this:

 

tell application "Adobe InDesign 2020"
	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 "Layer 1" -- layer name to copy from
	
-- if you are wanting to keep them to specific pages you will need to sort the pages before you call the duplicate command
	set pageOne to page 1 of doc2 -- page to copy to
	duplicate allItems to pageOne
	
end tell

 

Hope this helps

Malcolm

Likes

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
Reply
Loading...
May 21, 2020 2
New Here ,
May 21, 2020

Copy link to clipboard

Copied

Thank you Malcolm for your help.  This is great but then I realized that in some documents I have more than 2 pages. If I  copy the 2 layers from the source document Master pages duplicate those into the master pages of the destination document then info that I need will be available in all the pages of the destination documents. Is that even possible? 

Likes

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
Reply
Loading...
May 21, 2020 0