Copy link to clipboard
Copied
Hi Thom, Its me again!
I am using the action wizard and the built in Search and Remove Text action to mark certain phrases for redaction, moving to that page in javascript and adding a bookmark there. Unfortunatley I have to use variable names in the Search and Remove Text action that I read from a different file. I was wondering if there were a way to either add a variable to the Search and Remove Text action, or use the search and remove text action through Javascript, where I could use a variable?
Any help would be very appreciated
Copy link to clipboard
Copied
As pointed out by Try67, the Redact Search parameters cannot be accessed from JavaScript. But the Redact Search does have an option for loading a list of search strings from a file. You could create a separate script for creating this file. So it'd be a two step process.
1. Run the tool to create the search list
2. Run the Redact Search, manually loading the search list.
Copy link to clipboard
Copied
> I was wondering if there were a way to either add a variable to the Search and Remove Text action
- No.
> or use the search and remove text action through Javascript, where I could use a variable?
- Yes, but doing it like that is much less efficient and much more complicated. It will not likely work with very large files.
Copy link to clipboard
Copied
To clarify the second point, you can't actually call the Search & Remove Text command using JS, but you can mimic what it does using a script. The code for it will have to be written in full, though, and it's not a trivial task (especially not if the search terms are more than one word).
Copy link to clipboard
Copied
TRY 67?! What have you done with Thom!
Copy link to clipboard
Copied
Do you think I could do it by reading the variables to a text file and importing the text file in the Search and DESTROY action
Copy link to clipboard
Copied
This is a public forum. If you want to send Thom Parker a private message do so via the PM system.
Copy link to clipboard
Copied
> Do you think I could do it by reading the variables to a text file and importing the text file in the Search and DESTROY action
Yes, but that can't be automated. You will have to do it manually.
Copy link to clipboard
Copied
As pointed out by Try67, the Redact Search parameters cannot be accessed from JavaScript. But the Redact Search does have an option for loading a list of search strings from a file. You could create a separate script for creating this file. So it'd be a two step process.
1. Run the tool to create the search list
2. Run the Redact Search, manually loading the search list.
Copy link to clipboard
Copied
Thanks Thom! You are the Best!