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

How to get numbered list format value in a paragraph style to populate a CSV?

Explorer ,
Jan 20, 2025 Jan 20, 2025

I have a script that pushes the values of all paragraph style settings in an InDesign document to a CSV, but I can't get the numbered list format to export:

 
case ListType.NUMBERED_LIST:
arr.push("Numbered");
switch (ps.NumberingFormat) {
case NumberingStyle.ARABIC:
arr.push("1, 2, 3, 4...");
break;
case NumberingStyle.SINGLE_LEADING_ZEROS:
arr.push("01, 02, 03...");
break;
case NumberingStyle.UPPER_ROMAN:
arr.push("I, II, III, IV...");
break;
case NumberingStyle.LOWER_ROMAN:
arr.push("i, ii, iii, iv...");
break;
case NumberingStyle.UPPER_LETTERS:
arr.push("A, B, C, D...");
break;
case NumberingStyle.LOWER_LETTERS:
arr.push("a, b, c, d...");
break;
default:
arr.push("Not found");
}
 
No matter the numbered list format chosen in the paragraph style, I get "Not found" populated in the CSV. I can't figure what I'm doing wrong.
 
Example:
Paragraph Style Options > Bullets and Numbering:
List Type: Numbers
Format: A, B, C, D...
 
What I'd expect in the CSV:
List typeList Type
NumberedA, B, C, D...

 

What I get:

List typeFormat
NumberedNot found
TOPICS
Scripting
483
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
LEGEND ,
Jan 20, 2025 Jan 20, 2025

Just get the value - it doesn't use enumerator - but returns it as a string.

 

RobertatIDTasker_0-1737411763774.png

 

I'm not doing Select...Case - yet it returns text values.

 

Maybe in ME / Japan version it will - so instead of default "Not found" - push the value.

break;
default:
arr.push(ps.NumberingFormat);
}
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
LEGEND ,
Jan 20, 2025 Jan 20, 2025

Or rather you should be using: 

 

ps.numberingFormat

 

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
Engaged ,
Jan 21, 2025 Jan 21, 2025

or ps.numberingStyle  

?

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
LEGEND ,
Jan 21, 2025 Jan 21, 2025
quote

or ps.numberingStyle  

?


By @Stefan Rakete

 

numberingStyle is set of constants:

 

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

 

numberingFormat is a property of the "text". 

 

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
LEGEND ,
Jan 21, 2025 Jan 21, 2025

@Stefan Rakete 

 

numberingFormat

NumberingStyle

NumberingStyle.ARABIC

NumberingStyle.ARABIC_ABJAD

NumberingStyle.ARABIC_ALIF_BA_TAH

NumberingStyle.DOUBLE_LEADING_ZEROS

NumberingStyle.FORMAT_NONE

NumberingStyle.HEBREW_BIBLICAL

NumberingStyle.HEBREW_NON_STANDARD

NumberingStyle.KANJI

NumberingStyle.KATAKANA_MODERN

NumberingStyle.KATAKANA_TRADITIONAL

NumberingStyle.LOWER_LETTERS

NumberingStyle.LOWER_ROMAN

NumberingStyle.SINGLE_LEADING_ZEROS

NumberingStyle.TRIPLE_LEADING_ZEROS

NumberingStyle.UPPER_LETTERS

NumberingStyle.UPPER_ROMAN

String

read/write

Numbering format options. Can return: NumberingStyle enumerator or String.

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
Explorer ,
Jan 21, 2025 Jan 21, 2025

Thank you so much!! I was way over complicating it! 

arr.push(ps.numberingFormat); // Number list format
returns exactly what I was looking for. I appreciate it so much!
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
LEGEND ,
Jan 21, 2025 Jan 21, 2025
LATEST

@prdh67

 

You are welcome. 

 

But you should keep all options in select..case - just in case 😉 

 

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