Copy link to clipboard
Copied
I want to have numbering list like that =
How can I do it?
Copy link to clipboard
Copied
This might get you started:
var t=app.selection[0]; // or any text object
t.bulletsAndNumberingListType = ListType.NUMBERED_LIST;
t.numberingFormat = "I, II, III, IV..."; // in other words, roman numerals
t.numberingExpression = "^#.^t"; // iow: the number is followed by a period and a tab
You then need to set a tab stop to get the spacing you want between the roman numeral and rest of the text.
There other "numbering" parameters you might want to look at:
But my instinct would be to create a paragraph style with the "Bullets and Numbering" properties set up to produce your desired look. Then your script simply has to apply that paragraph style where needed. The point being that it might be easier to tweak the paragraph style than to open up the script every time you need to make the tab bigger or smaller.
Bob