1 Reply Latest reply on Oct 29, 2012 4:52 AM by 4everJang Branched from an earlier discussion.

    Using Find() in ExtendScript to search for Italics

    biomikez Level 1

      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]

        • 1. Re: Using Find() in ExtendScript
          4everJang Level 3

          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