It's a bug.
You need to use a string and not an enum.
The problem is the different ID language interfaces have different strings, but if it's just for you the you should ok.
The strings are what you see in the UI, except for one of the Hebrew one's that has a space at the end of the string. I think the guy who did that was antisemitic. It took quite a bit of time to figure out!
1 person found this helpful
I don't think its a bug, because DOM documentation also hints to a String as possible value for the property.
You can apply a string or an enumerator for numberingFormat.
FWIW: If you read out the value of the property its always a String.
var doc = app.documents.add(); // Basic Paragraph Style: doc.paragraphStyles.numberingFormat = NumberingStyle.FORMAT_NONE; // Adding two paragraph styles: var paraStyle1 = doc.paragraphStyles.add(); var paraStyle2 = doc.paragraphStyles.add(); // Style 1: Applying an enumerator: paraStyle1.numberingFormat = NumberingStyle.SINGLE_LEADING_ZEROS; // Style 2: Applying a string: paraStyle2.numberingFormat = "01,02,03..."; // Reading out the values: $.writeln(paraStyle1.numberingFormat.constructor.name+"\t"+paraStyle1.numberingFormat); // String 01,02,03... $.writeln(paraStyle2.numberingFormat.constructor.name+"\t"+paraStyle2.numberingFormat); // String 01,02,03...
IMHO it's a bug.
Their are other properties that accept strings as well as Enums, for example pageNumberStyle.
PageNumberStyle.reflect.properties.join('\n'); // lists enums Note missing full width?
app.activeDocument.sections.pageNumberStyle = "01,02,03..."; // => 01,02,03...
app.activeDocument.sections.pageNumberStyle; // => SINGLE_LEADING_ZEROS
app.activeDocument.sections.pageNumberStyle === PageNumberStyle.SINGLE_LEADING_ZEROS; // => true
Now as it happens their are problems also with the pageNumberStyle property also but I won't go into them, the point is that when one checks a property it should return the Enum when it's available even it the property was set by a string as it does in the case of pageNumberStyle and not as a string as in the case of numberingFormat.
I'll leave it to you to check out other properties that take both strings and enums.