Skip to main content
Inspiring
April 15, 2023
Question

Script for Adobe Indesign CS5

  • April 15, 2023
  • 1 reply
  • 270 views

Hello!


Could someone provide me a script for Adobe Indesign CS5
with the following format:

 

Font Taz (TT);
Size 8;
Black color;
Justified alignment (with the last line on the left);

First line of paragraph: 5mm
Character Style: [None];
Language: Portuguese: Brazilian

 

I know I can create a paragraph style, but for some erros I need this script. And I don´t wanna create a paragraph style in the script.

 

Thank you, anyway!

This topic has been closed for replies.

1 reply

rob day
Community Expert
Community Expert
April 15, 2023

Hi @Cris Ider , Can’t test this in CS5, but it works in CC2021. Note the the applied font is the font family followed by a tab then the font style. I’m using Arial Regular here because I’m guessing "Taz" doesn’t work.

 

This expects some text to be selected:

 

 

 

var doc = app.activeDocument;
var sp = doc.selection[0].paragraphs.everyItem().getElements();
for (var i = 0; i < sp.length; i++){
    sp[i].properties = {
    appliedParagraphStyle:doc.paragraphStyles.itemByName("[No Paragraph Style]"), 
    appliedCharacterStyle:doc.characterStyles.itemByName("[None]"),
    //name of the applied font is the font family followed by a tab then the style
    appliedFont:"Arial	Regular",
    pointSize: 8,
    fillColor: "Black",
    justification: Justification.LEFT_JUSTIFIED,
    firstLineIndent: "5mm",
    appliedLanguage: "Portuguese: Brazilian"}
};