Activity › Forums › Adobe Photoshop › Watermarking/branding images with file name
-
Watermarking/branding images with file name
Posted by Cináed on September 21, 2007 at 6:29 amHello everybody!
I
Josue Smart replied 14 years, 1 month ago 8 Members · 12 Replies -
12 Replies
-
Ekim Wahs
September 24, 2007 at 9:31 pmScripting would handle this nicely.
here’s a bit that will add a type layer with file name
// set rulers to pixels and save original for resetting
var originalUnits = app.preferences.rulerUnits
app.preferences.rulerUnits = Units.PIXELS// add the pixel position for the left side of your text block below
var textLeftPosition= 60// add the pixel position for the bottom of your text block below
var textBottomPosition= 60var typeLayer = app.activeDocument.artLayers.add();
typeLayer.name = app.activeDocument.name;
typeLayer.kind = LayerKind.TEXT;
typeLayer.textItem.size = 48;
typeLayer.textItem.position = [textLeftPosition, textBottomPosition];
typeLayer.textItem.contents = typeLayername;// return units to original
app.preferences.rulerUnits = originalUnitsYou could use insert menu item action to call the script. Save the above text as a jsx file, and call it from file/scripts/browse
Also, here is a nice script to use as a starting point for processing a folder of images. Insert the operations that you need to perform in the area indicated.
https://www.tranberry.com/photoshop/photoshop_for_geeks/openFolderTemplate.jsxJeff’s Photoshop for geeks area is a nice intro to scripting in Photoshop.
Mike Shaw
Photoshop QE -
Cináed
September 25, 2007 at 5:03 amAh, thanks a lot!
This will probably save me hours of work, and even enable my company to be able to offer yet another service 😉-Kenneth
-
Rob Goldstein
March 4, 2009 at 10:40 pmI Have never used scripts before. Can anyone tell me how I apply this script in photoshop? Unfortunately I look at this and all I see is Greek.
Thanks so much for the help. If I can get this to work it will save me so much time.
-
Paul Hinderer
September 2, 2009 at 4:40 amHi Richard,
I have tried to use your file location watermarking script in SC4 – but I keep getting an error message for line 17 – (typeLayer.textItem.contents = TypeLayername;. The script does load a text layer in the name of the file, but no text appears on the page. I am loading the script by “scripts – browse”. Can you let me know if I am doing something wrong.
Cheers -
Ekim Wahs
September 3, 2009 at 11:00 pmtry adding the line
var layerName = typeLayer.name
before the line
typeLayer.textItem.contents = typeLayername;then change
typeLayer.textItem.contents = typeLayername;
to
typeLayer.textItem.contents = layerName;Mike Shaw
Photoshop QE -
Jed Rosenberg
March 15, 2010 at 7:34 pmThis is working for me, but how do I adjust the color? I’d like to make it white.
-
Ekim Wahs
March 15, 2010 at 8:11 pmset the foreground color before the type layer gets added.
app.foregroundColor.rgb.red = 255
app.foregroundColor.rgb.green = 255
app.foregroundColor.rgb.blue = 255will set the FG color to white
Mike Shaw
Photoshop QE -
Jed Rosenberg
March 17, 2010 at 7:34 pmOne more question … i’m trying to make it ‘right justified’ but my script is not working.
typeLayer.textItem.justification = justification.right
Reply to this Discussion! Login or Sign Up