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

How to select same font and apply auto kerning?

Explorer ,
Dec 13, 2011 Dec 13, 2011

How to select all text frames with same font (for example 'NewCenturySchlbk-Roman') and apply auto kerning?

Thanks.

TOPICS
Scripting
1.2K
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

correct answers 1 Correct answer

Explorer , Dec 14, 2011 Dec 14, 2011

For all opened documents:

for (i = 0; i < app.documents.length; i++) {

    var targetDocument = app.documents;

    activeDocument = targetDocument;

    var docRef = app.activeDocument;

    for (var w = 0; w < docRef.textFrames.length; w++) {

        var textRef = docRef.textFrames;

        if (textRef.textRange.characterAttributes.textFont == textFonts.getByName('NewCenturySchlbk-Italic')) {

            textRef.textRange.characterAttributes.kerningMethod = AutoKernType.AUTO;

        }

    }

redraw();

}

Translate
Adobe
Explorer ,
Dec 14, 2011 Dec 14, 2011

For all opened documents:

for (i = 0; i < app.documents.length; i++) {

    var targetDocument = app.documents;

    activeDocument = targetDocument;

    var docRef = app.activeDocument;

    for (var w = 0; w < docRef.textFrames.length; w++) {

        var textRef = docRef.textFrames;

        if (textRef.textRange.characterAttributes.textFont == textFonts.getByName('NewCenturySchlbk-Italic')) {

            textRef.textRange.characterAttributes.kerningMethod = AutoKernType.AUTO;

        }

    }

redraw();

}

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
New Here ,
Jul 17, 2014 Jul 17, 2014
LATEST

Hi,

Do you how we could change this script to select every text which has the same font type ? (for example select every "Zurich TL - Bold" etc)

Thank you,

PY

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