Copy link to clipboard
Copied
Hi,
I am new to scripting for indesign, but I recently found a script that automatically created specific layers, so I edited it to make the layers that I always use. I would now like to make it so that the script automatically runs every time I make a new document, is this possible?
Here is the script as it is now:
app.activeDocument.layers.add ({name: 'Guides', layerColor: UIColors.VIOLET});
app.activeDocument.layers.add ({name: 'Background', layerColor: UIColors.LIGHT_BLUE});
app.activeDocument.layers.add ({name: 'Text', layerColor: UIColors.DARK_GREEN});
app.activeDocument.layers.add ({name: 'Images', layerColor: UIColors.RED});
app.activeDocument.layers.item('Layer 1').remove();
Copy link to clipboard
Copied
have a look for the event after_new:
Adobe InDesign CS6 (8.0) Object Model JS: Document
place it in the startupscripts
#targetengine "session"
app.eventListeners.add("afterNew", afterNewFunction, false);
function afterNewFunction(){
//your stuff
}
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more