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

Adding footer/logo to the image - Action Script needed

New Here ,
Apr 30, 2020 Apr 30, 2020

I want to add logo or footer to every image. My image has to have whitebackground, image has to be top aligned (image has been resized to 1300*1050), I want to add footer with logo or text. 

 

I have 200 images and need action script. I tried recording my actions but it is not working

 

I recorded and spent 18 hours already and not able to accomplish this. Pls share your experience/link/action script. 

 

I am attaching the sample input and output file. 

Input file:

2017-05-25 22.41.54 1522559975644724186_32026802530.jpg

Desired Output File:

yashmehtaym_0-1588305899282.png

Hope this community can help. I have tried lightroom as well and saved presets but it will not allow this option for batch exporting this page layout, instead it allows batch exporting watermarks wheras this is an identity plate at the bottom. Please give me a fix regarding photoshop.

TOPICS
Actions and scripting
2.4K
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 ,
Apr 30, 2020 Apr 30, 2020

Where is the problem when trying to record action? What have you tried so far, explain steps and problem.

From what I can understand you want fixed size image and you want to place logo but other parts of design are not clear to me whether other parts like text on top are fixed or not, do you have files with text and image or not... you must give us more details, before after does not help much in this case.

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 ,
Apr 30, 2020 Apr 30, 2020

Hi, 

I intend to do the following thing in action  script

  1. Select the photo to edited
  2. Move the photo to top aligne (I am doing this by selection and selection+Movement is not recorded properly)
  3. I am embedding the footer logo as paste embed 
  4. I am resizing the logo 
  5. I am moving the layer - Photo on top layer and logo below layer

 

When I am running the script, I am getting following two errors

1. The command "Select" is currently not available

2. The command "Move" is not currently available

 

I think there must be alternate mechanism to achieve what I want. Not able to get through. 

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 ,
Apr 30, 2020 Apr 30, 2020

What are you trying to select? To align to top edge you can select everything using Ctrl + A keyboard shortcut. 

To align to selection you must have active selection and proper layer selected in the Layers panel, are you aware of that requirement?

align to selection.jpg

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 ,
May 01, 2020 May 01, 2020
LATEST
/* ==========================================================
// 2017  John J. McAssey (JJMack) 
// ======================================================= */
// This script is supplied as is. It is provided as freeware. 
// The author accepts no liability for any problems arising from its use.
/*
<javascriptresource>
<about>$$$/JavaScripts/PlaceWatermark/About=JJMack's PlaceWatermark ^r^rCopyright 2017 Mouseprints.net^r^rPhotoshop Script^rCustomize using first four var</about>
<category>JJMack's Script</category>
<enableinfo>true</enableinfo>
</javascriptresource>
*/
#target photoshop;  
app.bringToFront();  
var logoFile = "~/Desktop/JJMack.png";						// Watermark file should be large for resize down works better than up
var LogoSize = 10;											// percent of document height to resize Watermark to
var LogoMargin = 1;                                         // percent of Document height the Watermark should have as a margin
var BottomLetf = false;										// false = Bottom Right true Bottom Left 
//placeWatermark(logoFile, LogoSize, LogoMargin);           // Place Watermark into the bottom of the document
if (documents.length) app.activeDocument.suspendHistory('placeWatermark','placeWatermark(logoFile,LogoSize,LogoMargin)' );
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function placeWatermark(Image,Size,Margin){  
	if(!documents.length) return;  							// if no document return
		var fileObj = new File(Image);	                	// the passed file
	if(!fileObj.exists){  									// If file does not exits tell user 
		alert(fileObj.name  + " does not exist!"); 			// Alert User 
		return;  											// return
		}  
	try{  
		var doc = app.activeDocument;						// set Doc object to active document
		app.displayDialogs = DialogModes.NO;				// Dialog off 
		var strtRulerUnits = app.preferences.rulerUnits;	// Save Users ruler units 
		var strtTypeUnits = app.preferences.typeUnits;		// Save Users Type units 
		app.preferences.rulerUnits = Units.PIXELS;			// work with pixels 
		app.preferences.typeUnits = TypeUnits.PIXELS;		// work with pixels 
		var layers = app.activeDocument.layers;				// get layers
		app.activeDocument.activeLayer = layers[0];			// Target Top Layer
		placeFile(fileObj); 								// Place in file the Watermark png file
		activeDocument.activeLayer.resize(100 ,100,AnchorPosition.MIDDLECENTER); // Insure Place did not scale layer  
		var SB = activeDocument.activeLayer.bounds; 		// get layers bounds 
		var layerHeight = SB[3] - SB[1];					// get layers height  
		var resizePercent = (100/layerHeight)*(Size/100*doc.height.value); // Percent to resize by 
		activeDocument.activeLayer.resize(resizePercent ,resizePercent,AnchorPosition.MIDDLECENTER);  // Resize width and height by percentage 
		SB = activeDocument.activeLayer.bounds;				// get resized layers bounds  
		activeDocument.activeLayer.translate(-SB[0].value,-SB[1].value); // Move resized layer to top left canvas corner 
		var LayerWidth = (SB[2].value - SB[0].value);		// get resized layers width  
		var LayerHeight = (SB[3].value - SB[1].value);  	// get resized layers height
		marginSize = Margin/100*doc.height.value;			// Margin size
		// move resized watermark into the document lower right corner with some margin or lower left
		if  ( BottomLetf) {activeDocument.activeLayer.translate(marginSize,( doc.height.value -marginSize - LayerHeight));}
		else {activeDocument.activeLayer.translate((doc.width.value -marginSize - LayerWidth),( doc.height.value -marginSize - LayerHeight));}
	}
	catch(e) { alert(e + ': on line ' + e.line); }			// inform user of error  
	finally{  
		app.preferences.rulerUnits = strtRulerUnits;		// Restore user ruler units  
		app.preferences.typeUnits = strtTypeUnits;			// Restore user type units    
	};  
}; 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
function placeFile(placeFile) {  
    var desc21 = new ActionDescriptor();  
    desc21.putPath( charIDToTypeID('null'), new File(placeFile) );  
    desc21.putEnumerated( charIDToTypeID('FTcs'), charIDToTypeID('QCSt'), charIDToTypeID('Qcsa') );  
    var desc22 = new ActionDescriptor();  
    desc22.putUnitDouble( charIDToTypeID('Hrzn'), charIDToTypeID('#Pxl'), 0.000000 );  
    desc22.putUnitDouble( charIDToTypeID('Vrtc'), charIDToTypeID('#Pxl'), 0.000000 );  
    desc21.putObject( charIDToTypeID('Ofst'), charIDToTypeID('Ofst'), desc22 );  
    executeAction( charIDToTypeID('Plc '), desc21, DialogModes.NO );  
};  
JJMack
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