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

Need an Acrobat JavaScript to do the following:

Community Beginner ,
Nov 16, 2017 Nov 16, 2017

Copy link to clipboard

Copied

01. Number pdf file names in a folder.

02. ADD a number at the beginning of each file name but not change the original file name.

    examples: abc.pdf becomes 0001 abc.pdf; xyz.pdf becomes 0002 xyz.pdf etc.

03. To make this less complex, add a 4 digit number (0001, 0002, 0003 etc) unless there is a way to fine tune the number of digits depending on the number of files in the folder.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

403

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Beginner , Nov 16, 2017 Nov 16, 2017

Thanks a bunch.

Votes

Translate

Translate
Community Expert ,
Nov 16, 2017 Nov 16, 2017

Copy link to clipboard

Copied

JS can't rename files.

Votes

Translate

Translate

Report

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 16, 2017 Nov 16, 2017

Copy link to clipboard

Copied

What Try means is that the Acrobat scripting environment is sandboxed for security, and so the model has very limited access to the local file system. There simply is no functionality for what you want to do.

So, your best option, since your task is all in the file system, is to use an easily accessible scripting/programming language for your system. Something like Batch Scripting if you are on Windows, or AppleScript if you are on a Mac.

If you are a VB programmer, then that is the best way to do it on Windows

Also lookup "Windows Scripting" on Google.

Well Actually, there is a way to do something like this in Acrobat. You can create an "Action" that will open all the files in a folder and save them to a different folder with new names. But not as clean as the previously discussed solutions.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

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 ,
Nov 16, 2017 Nov 16, 2017

Copy link to clipboard

Copied

Thanks to you guys for the feedback. I'm not a programmer so vb is out. Could you give me some ideas as to how to do the open and save with new names without doing it one file at a time.

Votes

Translate

Translate

Report

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 16, 2017 Nov 16, 2017

Copy link to clipboard

Copied

See this Tutorial

https://acrobatusers.com/tutorials/how-to-create-and-share-actions

Acrobat DC is a little different,

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

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 ,
Nov 16, 2017 Nov 16, 2017

Copy link to clipboard

Copied

LATEST

Thanks a bunch.

Votes

Translate

Translate

Report

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