Skip to main content
February 25, 2017
Question

How/where can I see the JavaScript behind the "Search & Remove Text" tool?

  • February 25, 2017
  • 2 replies
  • 1720 views

I am building a customised Action in Acrobat using JS and I want to be able to import a list and iterate through it, like the built-in "Search & Remove Text" tool does.  I can't figure out a way to edit the built-in tools though, or a place I can find the code behind them.


If this isn't possible, does anyone know where else I might find JS code that imports a list and iterates through it?

Any help would be very much appreciated!

This topic has been closed for replies.

2 replies

Legend
February 25, 2017

The Acrobat source code is highly secret, and even if it wasn't, the built in functions are not created using JavaScript. Often, make a tool "quite like another one" is a huge project, written in C, where no part of Acrobat can be used, only the low level plug-in API.

try67
Community Expert
Community Expert
February 25, 2017

You can't do it using JavaScript. What you can do, though, is write your own script that searches the entire document for specific phrases and then redacts them, but I should warn you that doing it with JS is much less efficient and fast than using the built-in command, so I would avoid it if possible.

Regarding the list of items: The Actions in Acrobat are defined using an XML file that contains all of the commands in them in plain-text.

The file type is "sequ" (for "sequence"). You can export an Action to a file, open it using a plain-text editor and then see the code in it.

If you do that you'll see that the list of items to redact is easily identifiable and can be expanded using relatively simple means.

After editing the sequ file simply import it back into Acrobat and you're ready to go!

February 25, 2017

When I export the sequ file of an Action that contains the "Search & Remove Text" tool, all that shows up in the code for that step is:

<Group label="Untitled">

  <Command name="SearchAndRedactCmd" pauseBefore="false" promptUser="true"/>

</Group>

Any idea what I could do to see the list implementation you're referring to try67​ ?

try67
Community Expert
Community Expert
February 25, 2017

Add some items to it via the dialog window in the Action Wizard and then

examine it again.