Skip to main content
Participant
January 14, 2019
Question

Rename each page individually

  • January 14, 2019
  • 4 replies
  • 13355 views

Is there a script (that works) or does anyone know of any way to rename pages in indesign rather than 1,2,3,4 etc

I manually export each page separately and have to rename them accordingly. Which takes too much time. I have to rename them the page size and language it is in.

Two examples of exported page names-  1080x1080_DE.jpg   1080x1920_FR.jpg

If there is a way to rename all the pages on a template that I can use in the future as it would save hours. Ie, click export all and they would be saved with the correct file names.

I have had a look online and have no joy. 

4 replies

Participant
June 23, 2021
Participant
May 6, 2022

Excelent! 
It's exactly what I was looking for.
Thank You

Roy Marshall
Known Participant
June 14, 2019

var outputs = "1080x1080_DE\

1080x1920_FR\

1080x1080_BE\

1080x1920_UK\

1080x1080_NZ\

1080x1920_AUS";

var doc = app.activeDocument;

for(var i = 0; i<=doc.pages.length-1;i++){

        var output_filename = outputs.split("\n") + ".jpg";

        var pageName = doc.pages.name;

        app.jpegExportPreferences.jpegExportRange=ExportRangeOrAllPages.EXPORT_RANGE;

        app.jpegExportPreferences.pageString = pageName;

        doc.exportFile(ExportFormat.JPG,File("~/Desktop/" + output_filename));

}

Using the Mac Platform, saving to the Desktop.

Just change the outputs variable, and as long as you have the same amount of pages in your document that the outputs variable is looking for then you're sweet!

There is no error handling in this..

Participating Frequently
June 12, 2019

Have a workaround, no script required.

1 In indesign save pages as PDF
2 In acrobat pro, make bookmarks from structure (here you can choose your indesign paragraph style)

3 Acrobat names the bookmarks with the contents in your paragraph style

4 In acrobat split document based on the bookmark names.

5 You now have a PDF file per bookmark with custom filenames (content of text in paragrap styles)

6 In photoshop open 1 PDF and apply your settings (crop box, dimensions, resolution...)

7 In photoshop use the image processor to convert the PDF's to JPG's

this works for me...

BobLevine
Community Expert
Community Expert
January 14, 2019

Though scripters do pop in here, you can ask in the scripting forum.

But it might help to let us know what the endgame is here. Why are you doing this?

tomwhitAuthor
Participant
January 14, 2019

Hi Bob,

thanks for the reply. I wanting to have each page saved out as jpegs.

I would like to name the pages before exporting. So that the file saves with the page name.

So that in the future I could use this as a template an export them all rather having to export each page and rename individually.

Does this make sense?

TᴀW
Legend
January 14, 2019

My ExtractPages (Extract Pages | Id-Extras.com ) exports PDFs and InDesign pages, not JPEGs. But for the naming, it would probably work. What exactly are you exporting? JPEGs?

Ariel