Function app.openDoc not returning Doc object although run in privileged function Hello, I would very much appreciante your help. I have a privileged function stored on my local PC:global.trustedSimpleFcn = app.trustedFunction(function(originalDoc)
{
app.beginPriv();
var originalPath = originalDoc.path;
// Get the path for the temp file
var tempPath = app.getPath("user", "temp") + "/esc_temp_pdf.pdf";
// This saves the original file as temp
originalDoc.saveAs(tempPath);
// Open original again
app.openDoc(originalPath);
// Open the temp to get the doc object
this.disclosed = true; // Because I heard it must be disclosed ??
app.openDoc(originalPath);
var tempDoc = app.openDoc(tempPath);
if (!tempDoc) {
app.alert("tempDoc is empty!", 0, 0, "Error");
app.endPriv();
return "";
}
app.endPriv();
app.alert("tempDoc is provided!", 0, 0, "Info");
return tempDoc.documentFileName;
})I am basically trying to save a copy of the current document as temp (and later manipulate it, flatten form and move it as a first page to other document, like a do