Skip to main content
Lordrhavin
Inspiring
April 6, 2024
Question

scripting bug: why does layer.printable always yield true? [solved]

  • April 6, 2024
  • 2 replies
  • 238 views

My layer.printable always returns true:

 

 

 

for (var i = 0; i < app.activeDocument.layers.length; ++i) {
	var layer = app.activeDocument.layers[i];
	if (!layer.visible)
		alert("Layer " + layer.name + " is invisible.");
	if (!layer.printable)
		alert("Layer " + layer.name + " is not printable.");
}

 

 

 

 

Indesign 2024, can anyone confirm? I set this by selecting the Layer in the layer pane and clicking on "not printable" in the attributes pane. It saves the setting but it seems to not change the boolean. The invisiblility settin works.
https://developer.adobe.com/indesign/dom/api/l/Layer/

Never min, just found it out: even with selecting the layer, it just spills the attributes on the objects. To set it for the lyer, you need the layer dialog.

This topic has been closed for replies.

2 replies

rob day
Community Expert
Community Expert
April 6, 2024

Hi @Lordrhavin , Just in case the behaviour is not completely clear, the Attributes panel is setting the selected object’s properties, not the active layer properties. If there is nothing selected, it sets the default for newly created page items. PageItems have a .nonprinting property, and there is the .pageItemDefault preference, which also has .nonprinting property. Non printing page items are hidden when Overprint/Separation Preview is turned on:

 

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

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

m1b
Community Expert
Community Expert
April 6, 2024

Hi @Lordrhavin it works as expected for me: ExtendScript, Indesign 19.3 MacOS 14.4.1. Are you using UXP?

- Mark