NotAllowedError: simple script used to work but not anymore
Hi,
Have a form with 2 fields and a button. When filling in the fields and pressing the button, the button is hidden and the form is flatten. That is, it did in previous versions of Acrobat. Now I get this error:
NotAllowedError: Toegang tot deze eigenschap of methode is niet mogelijk vanwege de beveiligingsinstellingen. (Translates as: access to this property or method is not possible due to the security settings.)
Doc.flattenPages:15:Field FLATTEN:Mouse Up
This is the (complete) script:
// The text in a Question Alert Box is usually in two parts. A short explaination
// and the actual question. It's a good practice to separate the question from the
// explaination by a line, In the text below, this separation is accomplished
// with the escaped line feed characters "\n\n"
//
// The alert box will only show about 6 lines of text, so both explainations and
// text should be kept short
var cMsg = "Zeker weten? Als u nu Ja kiest, wordt het document afgevlakt en kan er niets meer gewijzigd worden. Dit is ook niet te herstellen.";
var nRtn = app.alert(cMsg,2,2,"Question Alert Box");
if(nRtn == 4)
{// A yes Response
// Code for doing the thing you do on a yes
getField("FLATTEN").display = display.hidden;
this.flattenPages();
}
else if(nRtn == 3)
{ // No Response
console.println("The Response Was No");
}
else
{ //Unknown Response
console.println("The Response Was somthing other than Yes/No: " + nRtn);
}
Is there a simple solution?
Thanks for your help.
Jeroen de Haan
the Netherlands
