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

Photoshop Action/Script to Generate Page Numbers

Community Beginner ,
Dec 03, 2015 Dec 03, 2015

How can I create a Photoshop action that would place a page number in the bottom left and bottom right (two numbers) per page?  I would like Photoshop to automatically increment the pages numbers.

Or is there software that can do this for me?

Below is an example for what I am looking for.


001-002.jpg

TOPICS
Actions and scripting
2.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
Adobe
Community Expert ,
Dec 03, 2015 Dec 03, 2015

Naturally that would be a task better fit to Indesign, but if you need to do it in Photoshop how exactly do you want to "increment" the number?

Within one file or across multiple files?

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 ,
Dec 04, 2015 Dec 04, 2015

Good question.  The numbers would be incremented over more than one file.  The idea is that the end results is a number of files that are numbered in order.  Each file would contain two "pages" - an odd and an even one.  So the first file would have numbers 1 & 2, the second file would have 3 & 4, and so on.

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 ,
Dec 04, 2015 Dec 04, 2015

But would you add the numbers in one run or individually?

How are the numbers to be aligned (left left/right right or centred …)?

Can you provide the layered example pagina-file?

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 ,
Dec 04, 2015 Dec 04, 2015

jdybala schrieb:

… Each file would contain two "pages" - an odd and an even one.  So the first file would have numbers 1 & 2, the second file would have 3 & 4, and so on.

Are you sure?

Please take a few books and read. Every left side has even numbers. And normally the first number is number 3 on the right side.

Regards

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 ,
Dec 04, 2015 Dec 04, 2015

What we are doing is creating spreads to show what a final document layout would look like.  We would actually have two pages on each image - the left and right "side" would be on one JPEG.  Hence, we would have two numbers per image.

Should I maybe be looking at scripting Photoshop?  Would that be a better way? 

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 ,
Dec 05, 2015 Dec 05, 2015
LATEST

Once again: This task looks like a better fit for Indesign.

Should I maybe be looking at scripting Photoshop?

As far as I can tell Actions would be useless, so Scripting would be the way to go.

// add two numbers to selected files;

// 2015, use it at your own risk;

#target photoshop

// select files;

if ($.os.search(/windows/i) != -1) {var theFiles = File.openDialog ("please select files", '*.jpg;*.tif;*.pdf;*.psd', true)}

else {var theFiles = File.openDialog ("please select files", getFiles, true)};

theFiles.sort();

if (theFiles.length > 0) {

// set units;

var originalRulerUnits = preferences.rulerUnits;

preferences.rulerUnits = Units.PIXELS;

// do operation;

for (var m = 0; m < theFiles.length; m++) {

var thedoc = app.open(File(theFiles));

var originalResolution = thedoc.resolution;

//////////////////////////////////////////////////////

thedoc.resizeImage (undefined, undefined, 72, ResampleMethod.NONE);

// create text layers;

textLayer (m*2+1, [50, thedoc.height -20]);

textLayer (m*2+2, [thedoc.width - 50, thedoc.height -20]);

//////////////////////////////////////////////////////

// reset;

thedoc.resizeImage (undefined, undefined, originalResolution, ResampleMethod.NONE);

};

// reset;

preferences.rulerUnits = originalRulerUnits;

};

////// get psds, tifs and jpgs from files //////

function getFiles (theFile) {

if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i)) {

return true

};

};

////// text layer //////

function textLayer (theText, thePosition) {

var myLayerRef = activeDocument.artLayers.add();

myLayerRef.kind = LayerKind.TEXT;

var myTextRef = myLayerRef.textItem;

myTextRef.size = 12 * originalResolution / 72;

myTextRef.font = "Arial-BoldMT";

var newColor = new SolidColor();

newColor.rgb.red = 0;

newColor.rgb.green = 0;

newColor.rgb.blue = 0;

myTextRef.color = newColor;

myTextRef.justification = Justification.CENTER;

myTextRef.kind = TextType.POINTTEXT;

myTextRef.position = thePosition;

myLayerRef.blendMode = BlendMode.NORMAL;

myLayerRef.opacity = 100;

myTextRef.contents = theText;

};

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