Skip to main content
jacksonw74630625
Participant
March 11, 2018
Question

Run a Script Automatically When a New Document is Made

  • March 11, 2018
  • 1 reply
  • 498 views

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();

This topic has been closed for replies.

1 reply

Inspiring
March 11, 2018

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

    }