Skip to main content
Participating Frequently
May 21, 2016
Answered

Run an Action only on files in a folder with file names that begin with "PDF"

  • May 21, 2016
  • 1 reply
  • 1263 views

I want to run an Adobe Action, on a network folder where copiers save scanned files, to remove PDF/A from files that will have it. I know the files will all begin with "PDF" due to the HP scanner software naming convention. I don't want to run on all files since there are scanned files from multiple machines and only the HP gives us PDF/A. It wouldn't be a big deal to run on all, but the action changes the date file was modified, so it makes all the files appear to have be scanned at the same time, which is confusing when people are used to finding a file by the time it was scanned. I think javascript is the way to go for this, but I may be way off. I'm new.

Acrobat Pro 10. Win 7.

This topic has been closed for replies.
Correct answer try67

You can do it if you save the file using JS. Use this code:

if (/^PDF/.test(this.documentFileName)) this.saveAs(this.path);

Make sure not to add a separate Save command, of course.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
May 21, 2016

You can do it if you save the file using JS. Use this code:

if (/^PDF/.test(this.documentFileName)) this.saveAs(this.path);

Make sure not to add a separate Save command, of course.

Participating Frequently
May 24, 2016

Hmmm.

I removed the save command from the action and added the code as written

(cut & paste) but now no files are updated. Do I need to change the code to

specify where to save? Thank you for your assistance - it's much

appreciated.

try67
Community Expert
Community Expert
May 24, 2016

No, it should work as is... Are you sure your files actually begin with "PDF" (in upper-case)?