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

Paragraph Style script: How to set tab stop position to the left margin?

Participant ,
Jul 16, 2023 Jul 16, 2023

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:

IMG_1675.jpeg


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

 

TOPICS
How to , Scripting

Views

125

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jul 17, 2023 Jul 17, 2023

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

Votes

Translate

Translate
Participant ,
Jul 17, 2023 Jul 17, 2023

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

Votes

Translate

Translate

Report

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
Community Expert ,
Jul 17, 2023 Jul 17, 2023

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

Votes

Translate

Translate

Report

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
Participant ,
Jul 17, 2023 Jul 17, 2023

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!

Votes

Translate

Translate

Report

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
Community Expert ,
Jul 17, 2023 Jul 17, 2023

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

Votes

Translate

Translate

Report

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
Participant ,
Jul 18, 2023 Jul 18, 2023

Copy link to clipboard

Copied

LATEST

Thanks @Manan Joshi! It worked just as expected 🙂

Votes

Translate

Translate

Report

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