cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a static keyword to a document in a scan queue?

Zachary_Burke1
Star Contributor
Star Contributor

Hello Community,

We are trying to statically add a keyword to every document processed within a specific scan queue. The best way we have come up with to do this is by using a script with the pre-index script hook, as per Steve Reed's recommendation in previous posts. To test our script we are sweeping documents into the scan queue, will this work or do documents need to be scanned into the scan queue? We have been so far unsuccessful and do not understand why the script is not working properly. Can someone please take a took at this and provide us some feedback. 

Code Removed by Community Admin.

2 ACCEPTED ANSWERS

Steve_Reed
Employee
Employee

If you're setting this up as a pre-index script, then it would work the same for both scanned or swept documents, with the caveat that all of these batches are being routed to manual indexing (that is, they aren't skipping indexing because they were scanned/swept in full-index mode).  As a user starts to index a batch, the hooked pre-index script is fired once for each document right at the beginning of the index operation for that document.  So the script as you have it above is getting the keyword panel object and asking it to set the keyword value into the panel (not directly onto the document, just the keyword panel as the user sees it during indexing - the keyword value would be applied to the document when the user hits the index button).  But - your script isn't setting a document type into the panel, so unless the documents coming into the index process already have a document type *and* that document type includes the "Project #/Cost Center" keyword type, you wouldn't see any result (because the script is trying to set a keyword value that isn't currently in the keyword panel).  If this is the case (i.e. either the documents to be indexed don't have a document type, or they do but that document type doesn't include that keyword type) then you may need to modify this script to also set a document type into the panel before adding the keyword value.

View answer in original post

Steve_Reed
Employee
Employee

I wanted to include a screen shot of the two script hook contexts I'm referring to in my comment above, but can't include a screen shot in a comment, so had to respond in a new thread:

View answer in original post

5 REPLIES 5

Steve_Reed
Employee
Employee

I wanted to include a screen shot of the two script hook contexts I'm referring to in my comment above, but can't include a screen shot in a comment, so had to respond in a new thread: