Page 1 of 1

Delete all notes in comments?

Posted: Fri Jul 13, 2018 10:12 am
by chappy72
I had accidentially activated the option that the highlighted text will be copied to the notes pop-up.

Is there a chance of deleting all notes of a selection of annotations? The annotations should remain unchanged of course.

Thanks a lot

Best wishes
Daniel

Re: Delete all notes in comments?

Posted: Fri Jul 13, 2018 10:40 am
by Tracker Supp-Stefan
Hello Daniel,

It might be possible with some JavaScript.
Is it all annotations that you want to clear, or only highlights?

Can you send us a sample (if the original are sensitive - prepare it with a 'safe' file - with all types of annotations as in your original file) - and I will see if I can get a JS that will do what you need.

Regards,
Stefan

Re: Delete all notes in comments?

Posted: Fri Jul 13, 2018 10:51 am
by chappy72
Hi Stefan

thanks for helping!
Here you can download a small example:
https://www.officehilfe.ch/Buttimer1996.pdf

Only highlights should be cleared of the notes.

Best wishes
Daniel

Re: Delete all notes in comments?

Posted: Fri Jul 13, 2018 11:33 am
by Tracker Supp-Stefan
Hello chappy72,

E.g. the below will remove the text from Highlight annotations, while it will leave the sticky note ones intact:

Code: Select all

var annots = this.getAnnots();
for (var i = 0; i < annots.length; i++)
{
  if (annots[i].type == "Highlight")
  {
    annots[i].contents = '';
  }
}
Here is your file's comments pane before:
before.png
and after executing the above script:
after.png
Cheers,
Stefan

Re: Delete all notes in comments?

Posted: Fri Jul 13, 2018 12:15 pm
by chappy72
Hi Stefan

perfect, it works!!
Many thanks and have a nice weekend.

Best wishes
Daniel

Re: Delete all notes in comments?

Posted: Fri Jul 13, 2018 12:27 pm
by Tracker Supp-Stefan
You too have a lovely weekend Daniel!

Cheers,
Stefan

Re: Delete all notes in comments?

Posted: Fri Jul 13, 2018 12:29 pm
by chappy72
thank you:-)

Re: Delete all notes in comments?

Posted: Fri Jul 13, 2018 12:33 pm
by Tracker Supp-Stefan
:)