Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Run a Script Automatically When a New Document is Made

Community Beginner ,
Mar 11, 2018 Mar 11, 2018

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

TOPICS
Scripting
509
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 11, 2018 Mar 11, 2018
LATEST

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

    }

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines