Force/prompt overwrite via this.saveAs - function not working
Hi everyone,
I use the “simple” version of this.saveAs with (this, this.path) without any problems. However, when I use the “extended” version with ({cPath:path, bPromptToOverwrite:true, bCopy:true}) to force/block overwriting or create copies accordingly, nothing happens and the debugger gives the following error:
NotAllowedError: Sicherheitseinstellungen verhindern den Zugriff auf diese Eigenschaft oder Methode.
(NotAllowedError: Security settings prevent access to this property or method)
Here is my entry at folder level:
mySaveAs = app.trustPropagatorFunction(
function(doc,path)
{
app.beginPriv();
doc.saveAs(path);
app.endPriv();
})
mySaveAsFunc = app.trustedFunction(function(doc,path)
{
app.beginPriv();
mySaveAs(doc,path);
app.endPriv();
});
and here my button-script
var indipath = this.getField("path");
var addName = this.getField("Vname").valueAsString + ".pdf";
myFileName = indipath.valueAsString + addName;
this.saveAs({cPath:myFileName, bPromptToOverwrite:true, bCopy:true});
///this works perfectly:
///mySaveAsFunc(this, myFileName);
Do I have to include the this.saveAs({...}) expression somehow in the trusted function first?
Any kind of information is welcome. Many thanks in advance.
