Skip to main content
Participant
September 21, 2020
Question

Batch insert values to Subject and Keywords of pdf file description from the File Name

  • September 21, 2020
  • 1 reply
  • 1006 views

My task is to insert metadata in batch of pdf files: Title, Author, Subject and Keywords.

While Title and Author are the same for all files, I created Action - Add File Description, and processed batch quite easily and efficiently.

I can't do the same for Subject and Keywords, since these values are unique to each document. Both pieces of information are part of the File Name, for example:

PDF File Name is A_B_C.pdf 

A needs to be in the Subject line

B needs to be in Keywords line 

Is there a way to automate the process for batch of files, and insert desired information into each file description? I'll appreciate any helpful comments. Thank you.

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
September 22, 2020

Yes, you can do it using a script, like this:

this.info.Subject = this.documentFileName.split("_")[0];

this.info.Keywords = this.documentFileName.split("_")[1];

Participant
September 22, 2020

try67 - Thank you very much for your help!

I've never used scripts before (in Adobe at least) but digged in , and was able to apply what's needed and execute it.

The result was exactly as expected.

I hope you have a great day!!