Copy link to clipboard
Copied
Hi all,
Does anyone know a script that creates a paragraph style and set the tab stop position to the left margin? Instead of using alignment options, I would to like to use the small triangles in the left corner as per the screenshot below:
I have found this code somewhere for the Tab stop position part:
tabStops.add({alignment: TabStopAlignment.CHARACTER_ALIGN, alignmentCharacter: ".", position: 4})
This may be a dumb question, but instead of "alignment", should I use "indent"?
Thanks in advance for the help! 🙂
Rogerio
Try the following
var doc = app.activeDocument;
var a = doc.paragraphStyles.add({name:"Bullets", appliedFont:"Arial", fontStyle: "Regular", leftIndent: "0.25 in", pointSize:7, leading:10.5, bulletsAndNumberingListType: ListType.BULLET_LIST});
a.tabStops.add({alignment: TabStopAlignment.CHARACTER_ALIGN, alignmentCharacter: "."})
-Manan
Copy link to clipboard
Copied
@Manan Joshi, the below script you shared on this post is exactly what I was looking for. Could you please adapt it as per my request above?
var doc = app.activeDocument;
var a = doc.paragraphStyles.add({name:"Bullets", appliedFont:"Arial", fontStyle: "Regular", pointSize:7, leading:10.5, bulletsAndNumberingListType: ListType.BULLET_LIST});
a.tabStops.add({position:"0p6"})
Thanks in advance,
Rogerio
Copy link to clipboard
Copied
Hi @Rogerio5C09,
It seems you have found the code yourself. Does the following work for you
var doc = app.activeDocument;
var a = doc.paragraphStyles.add({name:"Bullets", appliedFont:"Arial", fontStyle: "Regular", pointSize:7, leading:10.5, bulletsAndNumberingListType: ListType.BULLET_LIST});
a.tabStops.add({alignment: TabStopAlignment.CHARACTER_ALIGN, alignmentCharacter: ".", position: 4})
Do mind to mention the unit in position as I have done in my original code else it will pick the unit set in the document i think
-Manan
Copy link to clipboard
Copied
Hey @Manan Joshi, thanks for getting back to me 🙂 The only thing is that this tabStops code uses alignment options instead of the small triangles mentioned on this post. Could you please check? The Tabs panel in the "Bullets" style should match the screenshot above. Thx!
Copy link to clipboard
Copied
Try the following
var doc = app.activeDocument;
var a = doc.paragraphStyles.add({name:"Bullets", appliedFont:"Arial", fontStyle: "Regular", leftIndent: "0.25 in", pointSize:7, leading:10.5, bulletsAndNumberingListType: ListType.BULLET_LIST});
a.tabStops.add({alignment: TabStopAlignment.CHARACTER_ALIGN, alignmentCharacter: "."})
-Manan
Copy link to clipboard
Copied
Thanks @Manan Joshi! It worked just as expected 🙂