Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Javascript to remove button, flatten and save as

New Here ,
Mar 12, 2023 Mar 12, 2023

Hi, I have no knowledge of any type of code and wanted to create a Javascript to remove a button called "Save Certifictae", flatten the documnet and save as. I have tried the below, but when i click the button it does seem to do anything.

 

this.removeField("SAVE CERTIFICATE");
this.flattenPages();
app.execMenuItem("SaveAs");

 

If i remove the first line the flatten and save works.

 

Any help woudl be much appreciated.

 

Thanks

TOPICS
JavaScript
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 12, 2023 Mar 12, 2023

Check the JavaScript console.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 12, 2023 Mar 12, 2023

Where do i find that?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 12, 2023 Mar 12, 2023

I found the console and now i get this error:

 

NotAllowedError: Security settings prevent access to this property or method.
Doc.removeField:1:

 

I think its because i am trying to delete the button that truggers the code, is there another way i can do this?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 12, 2023 Mar 12, 2023

You can create a custom tool for this.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 12, 2023 Mar 12, 2023

Is there anyway to do this witin the document itself as it will be used on computers that i dont have access to?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 12, 2023 Mar 12, 2023
LATEST

I have managed to hide the button as work around, and its done the job.

 

Thansk 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines