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

Using Find() in ExtendScript to search for Italics

Guest
Oct 28, 2012 Oct 28, 2012

Copy link to clipboard

Copied

I believe it would be the right place to place my query.

I'm trying to search for all Italics in my Document with Extendscript.

findParams = AllocatePropVals(1);

findParams[0].propIdent.num = Constants.FS_FindCharFmt;

findParams[0].propVal.valType = Constants.FT_String, etc..

How do I specify italic in the params?

Michael

[Thread split from original by moderator]

TOPICS
Scripting

Views

961
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
Advocate ,
Oct 29, 2012 Oct 29, 2012

Copy link to clipboard

Copied

LATEST

Michael,

First about the right place to place your query: you should start a new discussion instead, as your question will then appear in the list of topics rather than Oliver John's original question.

About your query:

Your code searches for a character format from the Character Catalog. If you have a character format that makes the text show up in Italics, you can use the name of that character format (which might or might not be "Italics"). But that will not include text sections that have been manually set to Italics (i.e. without applying a character format tag).

If you want to find all text in italics in your document, you should go via the text properties instead of the character format tags. That method will include all text that is set to italics, regardless of the method (manual overrides or character format tags). Spelling out the entire code would take me too much time right now, but the outline is as follows:

Loop through all Pgf objects in your document and do the following for each of them:

Use the GetText method with the parameter FTI_CharPropsChange.

In the array of TextItem objects, check whether the FTF_ANGLE property has changed.

If the FTF_ANGLE property has changed, you use GetTextProps on the start location of the TextItem to establish whether the found text string has Italics applied.

Good luck

Jang

Votes

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