Copy link to clipboard
Copied
I'm not sure what you mean by "tokens", but it is possible to change the metadata of multiple files using an Action in Acrobat Pro, yes. If you want to apply the file's name as its title you can do it using this JavaScript code:
this.info.Title = this.documentFileName;
Copy link to clipboard
Copied
I'm not sure what you mean by "tokens", but it is possible to change the metadata of multiple files using an Action in Acrobat Pro, yes. If you want to apply the file's name as its title you can do it using this JavaScript code:
this.info.Title = this.documentFileName;
Copy link to clipboard
Copied
Thanks for the answer, maybe you can help me? I need the title in metadata consisted of "some text"
+ file name (if possible without ".pdf").
Copy link to clipboard
Copied
Use this:
this.info.Title = "some text " + this.documentFileName.replace(".pdf", "");
Copy link to clipboard
Copied
Hello, Cool answer. It's exactly what I needed, adding file name to file info title. I tested, and it works. Thanks.
Elsewhere, what script could I use to fill the "Author", "Keywords", and "Subject" fields?
Cheers,
Copy link to clipboard
Copied
It's the same, just replace info.Title with info.Author, info.Keywords, etc.
Copy link to clipboard
Copied
Simple solution... Great! Can I do the following?
this.info.Title = "some text ";
Thanks.
Copy link to clipboard
Copied
Yes.
Copy link to clipboard
Copied
Hello, How can I write so the JavaScript excludes the suffix .PDF?
this.info.Title = this.documentFileName;
Thanks,
Copy link to clipboard
Copied
Use this:
this.info.Title = this.documentFileName.replace(/\.pdf$/i, "");
Copy link to clipboard
Copied
Thanks a million for your reply,
As is, your script doesn't exclude .pdf.
Cheers,
Copy link to clipboard
Copied
Sorry, it had a typo... Try it now.
Copy link to clipboard
Copied
Marvelous!
Copy link to clipboard
Copied
With this:
this.info.Title = "some text ";
I get "some text". How can I exclude the quotes?
Copy link to clipboard
Copied
I get "some text" with the quotes in the Title field.
Copy link to clipboard
Copied
It's not doing that for me...
Copy link to clipboard
Copied
Apologize, yes, it works fine.
Copy link to clipboard
Copied
Hi, With Adobe Acrobat 2020, I wish to do the same as described in this tread.
With the script below, it's not working. Can we modify the script or does it only work with Adobe Acrobat Pro?
Copy link to clipboard
Copied
There's no reason the code above shouldn't work in your version, but only the Pro version of Acrobat has batch processing capabilities (via the Action Wizard). So you can use it, but only on one file at a time.