1 Reply Latest reply on Jan 25, 2014 10:17 PM by justBE

    Extendscript - Book component type - ES bug or doc error?

    Russ Ward Level 4

      Hi,

       

      (FM 11, Win XP)

       

      When you query ComponentType for an FM document book component, you get hexadecimal 0x200 which happens to equal Constants.FV_BK_FILE. However, the documentation says that this property should return one of:

       

      • Constants.FV_BK_FOLDER (0x02) - Folder

      • Constants.FV_BK_GROUP (0x40) - Group

      • Constants.FV_BK_FM (0x8) - FrameMaker document

      • Constants.FV_BK_MIF (0x10) - MIF document

      • Constants.FV_BK_XML (0x20) - XML document

       

       

      Given the supposed MIF and XML options, I'm not sure if there is a bug in ES or if the documentation is just wrong. An XML component also returns 0x200. Any thoughts?

       

      Thanks,

      Russ

        • 1. Re: Extendscript - Book component type - ES bug or doc error?
          justBE

          Hi Russ,

           

          same issue here (FM 11, Win7). I'm not sure, but in my opinion it's an error in the documentation. The values for ComponentType should be:

           

          • Constants.FV_BK_FOLDER (0x2): Folder
          • Constants.FV_BK_GROUP (0x40): Group
          • Constants.FV_BK_FILE (0x200): File

           

          Additionally you could check the sort of file type via BookComponentFileType (FM, MIF, XML, Ditamap).

           

          In a short test script for traversing a hierarchical book the BookComponentFileType has some more values:

           

          • Constants.FV_BK_FOLDER (0x2): Folder
          • Constants.FV_BK_BOOK (0x4): Book (inside another book)
          • Constants.FV_BK_FM (0x8): FrameMaker document
          • Constants.FV_BK_MIF (0x10): MIF document
          • Constants.FV_BK_XML (0x20): XML document (also Ditamap and Bookmap)
          • Constants.FV_BK_GROUP (0x40): Group

           

          The main difference between ComponentType and BookComponentFileType seems to be the more detailed information about the file type.

           

          Best Regards, Andreas

           

          Message was edited by: justBE