If you were wanting to write your report back to the same location as the template file you opened you could…
var docRef = app.activeDocument; $.writeln(docRef.filePath.parent + '/');
Unless he opened the template the usual way -- as an untitled copy. Untitled files have no path (and no name either).
Jongware got my question.
Is there any way to get the path?
Jongware wrote that they have no path, and what isn't there you can't get.
try : app.activeDocument.fullName;
it seems working well
Dobatho, the point was that opening a template in the default way -- as a copy -- creates an Untitled document, just as when you select "New Document". An Untitled document does not have a name (yet); and not a path either.