Copy link to clipboard
Copied
I'm working with Acrobat X.
In Tools > Protection > Search and Remove Text, you have the option to search for regular expression patterns found here:
C:\Users\[user name]\AppData\Roaming\Adobe\Acrobat\10.0\Preferences\Redaction\ENU\SearchRedactPatterns.xml
I want to create an Action that calls that list of Acrobat regular expressions.
In the Action Wizard, when creating a new Action (Protection > Search & Remove Text), you don't get the option to look for those patterns. Has anyone done this? Dose anyone know a simple way to modify the generated .sequ file so it will do this?
<</Commands [/c << /0 [/c << /Config [/c << /UIPolicy [/i 3]
>>]
/HandlerName [/a /SearchAndRedactCmd]
/Params [/c << /CaseSensitive [/b false]
/WholeWord [/b false]
/WordList [/n null]
>>]
/Title [/t (Search & Remove Text)]
>>]
>>]
/Description [/t (calls standard Acrobat regex patterns)]
/Input [/c << /FileVariation [/i 3]
>>]
/Output [/c << /AddToBaseName [/b false]
/DontOverwrite [/b false]
/EmbedIndex [/b false]
/FileVariation [/i 1]
/HandleOutput [/b true]
/NumbericNaming [/b false]
/OptimizePDF [/b true]
/PresetName [/t (Standard)]
/RunPDFOptimizer [/b false]
>>]
>>
Acrobat uses EMCA JavaScript which includes the Regular Expression object. To use this object one needs to write some custom JavaScript cod. There is no "Regular Expression" option in the GUi for Acrobat's Action or batch processing. One needs to select the "JavaScript" action and then the necessary code to call a user written string function to find the word(s) using the specified Regular Expression include all of the custom code within the JavaScript code being added to the Batch Action. Form
...Copy link to clipboard
Copied
Acrobat uses EMCA JavaScript which includes the Regular Expression object. To use this object one needs to write some custom JavaScript cod. There is no "Regular Expression" option in the GUi for Acrobat's Action or batch processing. One needs to select the "JavaScript" action and then the necessary code to call a user written string function to find the word(s) using the specified Regular Expression include all of the custom code within the JavaScript code being added to the Batch Action. Form what you have posted it looks like you only have the necessary housekeeping actions to select and save processed files.
See Text matching with regular expressions using JavaScript by Thom Parker.
I would develop the code for processing an open PDF and then move that code into the Action.
See Acro Law's Creating and Using Custom Redaction Patterns.
Copy link to clipboard
Copied
Thank you for answering the question. It took me a while to figure that out but you're right. Got the code to work with some insight from Thom Parker and Ricardo Falegnami. I'll try to get something published to the Actions Exchange in the near future
Find more inspiration, events, and resources on the new Adobe Community
Explore Now