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

Change Filename To Title

New Here ,
Jul 19, 2018 Jul 19, 2018

I've got around 4500 files that all need to be renamed to what's already been typed as the document title. Is there any way to achieve this with batch processing?

TOPICS
Edit and convert PDFs
6.3K
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 ,
Jul 19, 2018 Jul 19, 2018

OK, I suggest you read this, then:

Adobe Acrobat Pro Action Wizard

Once you did, create a new Action and set it to execute this JavaScript code:

this.saveAs(this.path.replace(this.documentFileName, this.info.Title + ".pdf"));

Then run it on your files, and you're done!

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 ,
Jul 19, 2018 Jul 19, 2018

You can use an Action in Acrobat Pro to save a copy of the files using their Title property, but not rename them.

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 19, 2018 Jul 19, 2018

That sounds like it would work. How would I go about that?

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 ,
Jul 19, 2018 Jul 19, 2018

Do you have Acrobat Pro? If so, do you know how to use Actions in it?

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 19, 2018 Jul 19, 2018

I do have Acrobat Pro, vague understanding of Actions however.

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 ,
Jul 19, 2018 Jul 19, 2018

OK, I suggest you read this, then:

Adobe Acrobat Pro Action Wizard

Once you did, create a new Action and set it to execute this JavaScript code:

this.saveAs(this.path.replace(this.documentFileName, this.info.Title + ".pdf"));

Then run it on your files, and you're done!

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 Beginner ,
Feb 18, 2021 Feb 18, 2021

I need to do the exact opposite to the OP - write the filename to the document title. I tried reversing the example given but it does nothing (I'm not a JS guy).

this.saveAs(this.path.replace(this.info.Title, this.documentFileName));

 Any help appreciated. Acrobat Pro DC, btw.

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 ,
Feb 18, 2021 Feb 18, 2021

Yeah, no, that's not going to work... Try this:

this.info.Title = this.documentFileName;

If you want it without the ".pdf" extension 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
Community Beginner ,
Feb 19, 2021 Feb 19, 2021

Well that is just fine and dandy - thank you so much try67! I don't suppose you can furnish me with the regex to then replace the hyphens with spaces could you? If not, you've already helped a great deal.

 

Newsletter-Spring-2019-Final.pdf (filename) > Newsletter Spring 2019 Final (title)

 

Again, you have my gratitude.

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 ,
Feb 19, 2021 Feb 19, 2021

Sure:

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

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 Beginner ,
Feb 24, 2021 Feb 24, 2021

Another hearty thanks from me try67, much appreciated. 👍

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
Explorer ,
Jul 30, 2021 Jul 30, 2021

Thank you. Superbly useful. All the better as it is rare to find much accurate help for adobe products.

 

xsd

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 ,
Nov 14, 2021 Nov 14, 2021

Hi, I need to change document title to follow filenames as well for a batch of PDF. I've followed the steps but nothing happens. 

In ActionWizard instruction, I've input as below. Is this correct?
this.saveAs(this.path.replace(this.info.Title= this.documentFileName));
P/S - I am not familiar w coding.

 

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 ,
Nov 15, 2021 Nov 15, 2021

Are you trying to rename the file using the Title info, then?

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 Beginner ,
Sep 19, 2023 Sep 19, 2023
LATEST

This has definitely save my day! Thanks a lot!

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