Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

batch editing of metadata

Guest
Oct 08, 2020 Oct 08, 2020

is it possible to use the so-called "tokens" as in some other pdf programs to massively change the title in the metadata? i need to add filename to metadata title in many files.

TOPICS
How to
4.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Oct 09, 2020 Oct 09, 2020

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;

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 09, 2020 Oct 09, 2020

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;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 11, 2020 Oct 11, 2020

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").

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 11, 2020 Oct 11, 2020

Use this:

 

this.info.Title = "some text " + this.documentFileName.replace(".pdf", "");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 26, 2021 May 26, 2021

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,

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 26, 2021 May 26, 2021

It's the same, just replace info.Title with info.Author, info.Keywords, etc.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 26, 2021 May 26, 2021

Simple solution... Great! Can I do the following?

 

this.info.Title = "some text ";

 

Thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 26, 2021 May 26, 2021

Yes.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2021 Jun 30, 2021

Hello, How can I write so the JavaScript excludes the suffix .PDF?

 

this.info.Title = this.documentFileName;

 

Thanks,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2021 Jun 30, 2021

Use this:

 

this.info.Title = this.documentFileName.replace(/\.pdf$/i, "");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2021 Jun 30, 2021

Thanks a million for your reply,

 

As is, your script doesn't exclude .pdf.

 

Cheers,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2021 Jun 30, 2021

Sorry, it had a typo... Try it now.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2021 Jun 30, 2021

Marvelous!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2021 Jun 30, 2021

With this:

 

this.info.Title = "some text ";

 

I get "some text". How can I exclude the quotes?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2021 Jun 30, 2021

I get "some text" with the quotes in the Title field.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 30, 2021 Jun 30, 2021

It's not doing that for me...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2021 Jul 02, 2021

Apologize, yes, it works fine.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 19, 2023 Apr 19, 2023

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 19, 2023 Apr 19, 2023
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines