Copy link to clipboard
Copied
Hello. I would like to know if there is a way to delete all of the buttons in a document. I'm creating a print version of a digital file so all of the checkmarks and text fields need to be removed. Currently, I can only select one at a time and I have over 80 in the document. I even tried selecting them all on layers on each page, but when I do that, the delete button is greyed out. Is there a way to delete multiple buttons at once?
Dave's answer is the correct one, here. It's much faster to delete interactive elements after the fact in Acrobat, because you can multi-select buttons. I don't know what it is about InDesign's incomplete & wonky forms implementation, but you can't select two buttons at once. The only way to affect multiple buttons at once is via scripting, where you'd collect all the buttons and then loop over them, actually the script would still be deleting them one at a time.
Worth pointing out here that i
...Copy link to clipboard
Copied
Why not set them to non-printing (visible but doesn't print)?
In Acrobat Pro, you can select all your buttons and delete or set to non-printing.
Copy link to clipboard
Copied
Thanks for your response. I'd like to have them gone in ID so I don't have to re-delete them every time I make an edit and save a new pdf. Changing them to non-printing cannot be done all at once. I'd need to select each one and set it that way one at a time. That would take longer than deleting them. Is there a way to do that as a batch?
Copy link to clipboard
Copied
>>>Changing them to non-printing cannot be done all at once.
If you are referring to doing that in Acrobat, yes you can.
Also, if your underlying form changes (not the fields or buttons), you can simple replace the page in Acrobat. The form elements will stay.
Copy link to clipboard
Copied
Dave's answer is the correct one, here. It's much faster to delete interactive elements after the fact in Acrobat, because you can multi-select buttons. I don't know what it is about InDesign's incomplete & wonky forms implementation, but you can't select two buttons at once. The only way to affect multiple buttons at once is via scripting, where you'd collect all the buttons and then loop over them, actually the script would still be deleting them one at a time.
Worth pointing out here that if you are exporting to PDF from InDesign, then buttons won't export if you choose Print PDF from the file type dropdown when exporting. You'd need to select a specific option ("Appearance Only" in the "Interactive Elements" dropdown of the General section of the Export Adobe PDF dialog) to even see the non-working buttons onscreen in Acrobat.
If it's just one INDD document that you want to repurpose for print, Dave's way is the fastest.
If it's something you'd have to do repeatedly, I'm sure I could figure out how to adapt one of my form field scripts to mass delete buttons.
Copy link to clipboard
Copied
If you have a script that could do that, it would help me greatly. This is something I do repeatedly often and would love to be able to select multiple buttons at once. You are correct about exporting to print. After trying it, I realized that the checkmarks don't appear in the final print file even if their default state is set to "on". Thanks for your help.
Copy link to clipboard
Copied
app.activeDocument.buttons.everyItem().remove();
https://creativepro.com/how-to-install-scripts-in-indesign/
But it will remove ALL buttons from the active document !!!
But, if you work on Windows and need something with more finesse:
(link to original thread: https://community.adobe.com/t5/indesign-discussions/audio-in-interactive-pdf/m-p/15251607#M619559)
Browsing part - bottom part on the above screenshot - is completely free - but if you would like to be able to remove in bulk only selected - BatchMode - after you filter out / sort - that functionality isn't free.
Copy link to clipboard
Copied
You know, Robert, that one-liner will work for simple cases. When bullets are anchored objects, everyItem() won't capture them. I honestly don't know what other conditions might cause buttons to not be caught by everyItem(), but even though it's a fantastically useful method in the right circumstances, I don't trust it, because of the number of times in the last twelve months that I've found that it doesn't actually capture Every Item.
Kathy, if you know that you don't have any anchored buttons, then Robert's one-line script will probably work.
Copy link to clipboard
Copied
app.activeDocument.buttons.everyItem().remove();
app.activeDocument.groups.everyItem().buttons.everyItem().remove();
app.activeDocument.stories.everyItem().buttons.everyItem().remove();
app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().texts.everyItem().buttons.everyItem().remove();
app.activeDocument.stories.everyItem().groups.everyItem().buttons.everyItem().remove();
app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().texts.everyItem().groups.everyItem().buttons.everyItem().remove();
This should cover everything?
But would most likely require some extra try...catch'es - in case groups have only two elements - and one of them is a button.
But then won't process the rest of the groups. So a much longer version - with getElements() and a loop would be required.
That's why my IDT is the best solution 😉 because you don't have to be a coder - just know how to use InDesign.
Copy link to clipboard
Copied
@Robert at ID-Tasker said: "… But would most likely require some extra try...catch'es - in case groups have only two elements - and one of them is a button."
Hi Robert,
well in this case, a group with two objects, and one of them would be removed by scripting, you will end up still with a group object containing only one single object.
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
well in this case, a group with two objects, and one of them would be removed by scripting, you will end up still with a group object containing only one single object.
By @Laubender
Right, forgot about that - there was a discussion about that.
Copy link to clipboard
Copied
@Robert at ID-Tasker said: "… This should cover everything"
Hm. No. It would not consider buttons in tables that are nested in table text cells.
And it would not consider buttons in MultiStateObjects' states.
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
@Robert at ID-Tasker said: "… This should cover everything"
Hm. No. It would not consider buttons in tables that are nested in table text cells.
And it would not consider buttons in MultiStateObjects' states.
By @Laubender
Right again 😉
And, for some reason - this doesn't work?
app.activeDocument.stories.everyItem().texts.everyItem().groups.everyItem().buttons.everyItem().remove();
With or without ".texts.everyItem()"?
Copy link to clipboard
Copied
[...]
That's why my IDT is the best solution 😉 because you don't have to be a coder - just know how to use InDesign.
Browsing part - free - top three Buttons are part of Groups placed in the first Cell of Tables InLined in another Tables:
It doesn't matter where the object is.
Just the Buttons:
Effect of the BatchProcessing - Task run on all selected objects - paid functionality:
But even in the free version - it's just a few clicks - to simulate BatchProcessing - without the need to scroll throught the whole document.