5 Replies Latest reply on Mar 17, 2015 9:54 AM by Dirk Becker

    Constructor function load sequence

    Manan Joshi Level 4

      Hi All,


      I observed that InDesign's JS scripting, scripting engine does not load all the classes by default even the primitive ones like Enumerator. Unless and until something is accessed that returns an object of that type. To exemplify i tried the code below




      This gives me an error "Enumerator is undefined"


      Now if i precede this with any statement that returns an object of type Enumerator, the error vanishes. For ex


      var a = app.userColor; //returns an Enumerator type value


      I also verified this by looking at the Data Browser(Extended Script IDE) window in the first code snippet i don't see the Enumerator but in the second instance it is visible.

      Seems like InDesign does a lazy loading of classes(constructor functions), isn't this a hindrance as we can't even access the datatype. Use case i want to use a typeof Enumerator