how i can define variable to point to a document. is
var mySourceDocument = app.documents ;
it produce Result:undefined.
That does not mean that your variable mySourceDocument is undefined.
The whole script—that one line—is returning that to the ESTK console.
If you would add a second line like that:
var mySourceDocument = app.documents; mySourceDocument
the result in the ESTK console—if a document is open—would be:
Result: [object Document]
The script would not return anything to the ESTK console if you would add e.g. exit() as second line:
var mySourceDocument = app.documents; exit();
Thanks a lot! that is true. while waiting for the answer i tried to define the variable without var i.e
and result in the ESTK console is