2 Replies Latest reply on Oct 13, 2011 7:19 AM by richardh6

    [JS CS5] Getting a reference to a document as you open it

    richardh6 Level 1



      I was wondering how you get a reference to a document that is being opened from a template.  The Object Model Viewer says that app.open() returns a value of type "varies."


      I tried



      var docRef = app.open ("<templatePath>");


      but that returned undefined.


      If I was opening regular documents, I could find the document by name after I open it, but I am opening templates, which get assigned names like "Untitled-<xx>" after you open them.


      Also, if I was opening the document with a window, I could use app.activeDocument() to find it, but I am opening it in the background, with no window.


      Any ideas?