Skip to main content
July 10, 2009
Answered

Is the UID of a document's first layer always the same?

  • July 10, 2009
  • 2 replies
  • 620 views

I am trying to come up with a reliable way of identifying the default layer in a document; i.e. the layer present when the document is created. Experiment suggests that the layer's UID is always the same for every document:

169 for CS3 on PC

170 for CS3 on Mac

182 for CS4, both platforms


Does anyone know if this correct?

This topic has been closed for replies.
Correct answer Markus Freitag

Do not make any assumption about UIDs in a document or other databases.

Think about a document based on a template document. The template document could be created with an older version of InDesign.

What do you suggest if you work with a document on PC which was created on Mac?

Markus

2 replies

Inspiring
July 10, 2009

Markus is on the point, do not make such assumptions.

With no document ( targeting application defaults ) create a bunch of swatches, character styles, text variables.

These will be copied into the next new document, probably before the layer is created.

Revisit your layer ID - it will be different.

In other words, only depend on IID_IACTIVELAYER or IID_ILAYERLIST.

Dirk

Markus FreitagCorrect answer
Inspiring
July 10, 2009

Do not make any assumption about UIDs in a document or other databases.

Think about a document based on a template document. The template document could be created with an older version of InDesign.

What do you suggest if you work with a document on PC which was created on Mac?

Markus

July 10, 2009

Er, yes, that does rather sink my theory. Thanks for your prompt response, and back to the drawing board for me.

Charles