Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Constructor function load sequence

$
0
0

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

 

Enumerator

 

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

Enumerator


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


Thanks,

Manan


Viewing all articles
Browse latest Browse all 15932

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>