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

Photoshop Actions - setup for automatically adding name of the file to the printed image in corner

Community Beginner ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

Hello,

 

I am using combination of Adobe Bridge and Adobe Photoshop actions in order to batch print multiple image files. How do i modify the scripted actions (via rec function) to get the name of the image file in corner of every printed paper so i know how it is each document called without manually editing every image and write in corner of picture the name by myself ?

TOPICS
Actions and scripting

Views

856

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 2 Correct answers

Community Expert , Feb 21, 2023 Feb 21, 2023

This is beyond an action, you need a script for this task.

 

If you search the forum for filename watermarking scripts, you will find more than one option. Chances are they will need editing for your specific requirements, or perhaps you can add extra steps into your action to edit the text layer.

 

Here is one example:

 

...

Votes

Translate

Translate
Community Expert , Mar 27, 2023 Mar 27, 2023

Insert the line 

app.displayDialogs = DialogModes.ERROR;

at the start of the Script. 

Votes

Translate

Translate
Adobe
Community Expert ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

This is beyond an action, you need a script for this task.

 

If you search the forum for filename watermarking scripts, you will find more than one option. Chances are they will need editing for your specific requirements, or perhaps you can add extra steps into your action to edit the text layer.

 

Here is one example:

 

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 ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

You helped me so much ! Thank you.

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 ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

You're welcome, so you are all sorted?

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 ,
Mar 27, 2023 Mar 27, 2023

Copy link to clipboard

Copied

Well not quite. I am using the script down below. I included this script in actions with other commands and it works very well if i play the actions in photoshop. Problem comes when i try use those actions which include this script in batch process from adobe bridge. When i start batch processing than with each image file i try to edit with those actions the preferences window comes up and than it wants from me to click through every step of add naming and positioning layers of things which the script is doing with recorded positioning movements.

Do you know any fix which could help me sort this out? I can not work without batch processing.

Thank you.

 

//Check if a document is open

if ( documents.length > 0 )
{
var originalRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PERCENT;

try
{
var docRef = activeDocument;

// Create a text layer at the front


var myLayerRef = docRef.artLayers.add();
myLayerRef.kind = LayerKind.TEXT;
myLayerRef.name = "Filename";
var myTextRef = myLayerRef.textItem;

//Set your parameters below this line



var TextBefore = "Reference No:";


var TextAfter = "_";

// Set font size in Points

myTextRef.size = 10;

//Set font - use GetFontName.js to get exact name

myTextRef.font = "ComicSansMS";

//Set text colour in RGB values

var newColor = new SolidColor();
newColor.rgb.red = 0;
newColor.rgb.green = 0;
newColor.rgb.blue = 0;
myTextRef.color = newColor;

// Set the position of the text - percentages from left first, then from top.

myTextRef.position = new Array( 2, 98);

// Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.

myLayerRef.blendMode = BlendMode.NORMAL;

// select opacity in percentage

myLayerRef.opacity = 100;

// The following code strips the extension and writes the text layer. fname = file name only


di=(docRef.name).indexOf(".");
fname = (docRef.name).substr(0, di);
//use extension if set
if ( ShowExtension == "y" )
{
fname = docRef.name
}


myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;


}
catch( e )
{
// An error occurred. Restore ruler units, then propagate the error back
// to the user
preferences.rulerUnits = originalRulerUnits;
throw e;
}

// Everything went Ok. Restore ruler units
preferences.rulerUnits = originalRulerUnits;
}
else
{
alert( "You must have a document open to add the filename!" );
}

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 ,
Mar 27, 2023 Mar 27, 2023

Copy link to clipboard

Copied

Insert the line 

app.displayDialogs = DialogModes.ERROR;

at the start of the Script. 

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 ,
Mar 27, 2023 Mar 27, 2023

Copy link to clipboard

Copied

LATEST

What a magical piece of code. It is working now! Thank you so much!!

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