Skip to main content
Participant
September 21, 2016
Question

How to skip documents in an action script batch based upon having "secure" in filename.

  • September 21, 2016
  • 1 reply
  • 213 views

I have an action script that adds files in a directory to a batch does OCR, Unskews the pages, encrypts the file, and saves it with the word secure as a suffix to the file name.  This works no problem.  The issue I am having is that I can't figure out how to write a script to skip any documents with secure in the filename. 

I tried variations on the following:

function getDocName(){

if (event.target.documentFileName.contains(secure)){

app.setTimeOut('event.target.closeDoc(true);', 1);

} else {

   return null;

}

}

or

function getDocName(){

if (event.target.documentFileName.contains(secure)){

event.rc = 0;

} else {

   return null;

}

}

This topic has been closed for replies.

1 reply

Inspiring
September 21, 2016

Try the following for the if statment:

if (/secure/.test(event.target.documentFileName)) {