Skip to main content
Known Participant
August 23, 2024
Question

How to Set Up Default Layers for Every New InDesign File

  • August 23, 2024
  • 5 replies
  • 3963 views

Hi,

Is it possible to create every new Indesign file with the same set of layers?

(Like you can add "default" swatches to every new indesign by making these with no open files)

 

Basically I would like every new file to have 3 layers by default: Diecut / images / design (f.ex.)

Tx

kind regards
vanessa

 

 

<Title renamed by MOD>

This topic has been closed for replies.

5 replies

Willi Adelberger
Community Expert
September 26, 2024

Create a file with all layers and save as InDesign Template INDT. To create a new file open the template file. 

Frans v.d. Geest
Community Expert
September 26, 2024

i still use this:

https://indisnip.wordpress.com/2011/02/25/script-tomaxxilayers®-add-layer-sets-to-document/

 

but not sure if it is still available for download...

 

EDIT: nope, downloadlink is dead...

James Gifford—NitroPress
Brainiac
September 26, 2024

You can set many document parameters and style aspects by setting them with no document open — if thre's no doc, setting the color to red will make red the default color for all new documents. There's quite a few things you can set this way, and doing so accidentally is a common cause of questions — "Why do all of my new text boxes have a black border?"

 

Unfortunately... layers seem to be a document-specific element and can't be preset in this manner. The best you could do is create a document template. (Set up a "perfect" blank doc with all elements, settings and parameters, then save it in INDT format. The main thing that extension does is force you to save the file in INDD format under a new name and location so that you don't overwrite the template.)

Community Expert
August 23, 2024

Hi @OutlineG ,

this could be done with an ExtendScript (JavaScript) script that reacts on the "afterNew" event, fetches the new document and adds new layers to every new document on the fly.

 

When executed from the User folder in the Scripts panel of InDesign, the code below will add two layers in every new InDesign document until you quit InDesign:

 

 

#targetengine addLayersAfterNew

var listenerName = "addLayersAfterNew";
var myEventListener = app.eventListeners.itemByName(listenerName);

// Toggle. If already there, remove the event listener and add it again:
if(myEventListener.isValid){ myEventListener.remove() );

// Toggle. If not there, add:
myEventListener = app.addEventListener( "afterNew", addLayersAfterNew, false );
myEventListener.name = listenerName;
  
function addLayersAfterNew( evt )
{
	var doc = evt.parent;

	doc.layers.add
	(
		{
			layerColor : UIColors.GOLD ,
			name : "New Layer 1"
			
		}

	);

	doc.layers.add
	(
		{
			layerColor : UIColors.MAGENTA ,
			name : "New Layer 2"
			
		}

	);

};

 

 

Copy the code to an unformatted text file and save it with the suffix *.jsx.

How to install the script file see:

https://indiscripts.com/pages/help#hd0sb2

https://www.danrodney.com/scripts/directions-installingscripts.html

 

If you want a more permanent solution so that InDesign loads the script's code every time after starting automatically, you have to put the script file in a folder named  startup scripts in the parent folder of the Scripts Panel folder on your machine. You'll find the Scripts Panel folder when you select the User folder in your Scripts panel of your InDesign and execute the menu command for Show in Finder on a Mac or Show in Explorer on a Windows machine.

 

All possible values* for layerColor are listed at:

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#UIColors.html#d1e87840

Change the name of a given folder by changing "New Layer 1" to something different.

Note: A layer name in a given InDesign document must be unique. Some characters cannot be used for a name. For example, a layer's name must not start with character [ and must not end with ] .

 

* It's also possible to use a triplet of RGB values like:

 

layerColor : [255,0,0]

 

 

Regards,
Uwe Laubender
( Adobe Community Expert )

 

PS EDITED THE SCRIPT

Community Expert
August 23, 2024

NOTE: I edited the script for the usage with a startup scripts folder.

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Abhishek Rao
Community Manager
Community Manager
August 23, 2024

Hi @OutlineG

 

Thank you for reaching out!

Yes, creating new InDesign files with a set of default layers is possible. To achieve this, you can create a template with your desired layers and save it for future use. Here’s a quick guide:

1. Open InDesign and create a new document with the layers you want (e.g., Diecut, Images, Design).
2. Go to the Layers panel (Window > Layers) and create the needed layers.
3. Go to File > Save As, and choose "InDesign Template" (.indt) from the file format options. This will save your file as a template with all your layers in place.

In the future, when you need a new document, simply open this template, and your layers will be ready to go!

 

If you have any more questions or need further assistance, feel free to ask.

 

Thank you,   
Abhishek Rao