Scripting & Automation
CtrlLayers is fully scriptable — export and import layers programmatically as part of your InDesign/InCopy automation workflows.
Does CtrlLayers expose a scripting API?
Yes. CtrlLayers adds two methods directly to the InDesign Document object — exportLayer() and importLayer() — scriptable via ExtendScript (JavaScript), AppleScript or VBScript.
What does exportLayer() do?
exportLayer(exportFile: File, layerName: string, formatID: number) exports a single named layer to a new file. formatID selects the output format: 0 = .indd, 1 = .inx, 2 = .idml (default 0). Example: app.documents.item(0).exportLayer(new File("C:\\Users\\Ctrl\\Desktop\\English.indd"), "English Texts", 0);
What does importLayer() do?
importLayer(importFile: File, layerName: string) imports a named layer from another file into the active document, returning true or false depending on whether the import succeeded. If a layer with the same name already exists, the imported layer is automatically renamed.
Where do I find the full reference?
Download the CtrlLayers Scripting API Reference (PDF) below for full method signatures, parameters and examples.
You must be logged in to post a comment.