I am currently working on a way to take an image, resize it and add exactly what is in it's file name (before extension) as a text layer. I have succeded in this BUT am having issues with file names that require more than one line of text.
I need the text to align to the bottom of the image & the script or action must then resize the image so that the text does not overlap.
Any ideas on how this can be done?
At the moment I am using:
-"Fit Image.jsx" to resize my image to a specific size (This was included in the Photoshop CS5 scripts)
- A script to add the file name without extension and place the file name at a specific position.
if ( documents.length > 0 )
// Now create a text layer at the front
// Everything went Ok. Restore ruler units
Can the position be changed to allow more rows of text but keep it aligned with the bottom of the layer?
How can I script in a way to make the image resize based on the amount of text lines?
Any help would be greatly appreciated.
You can add a text layer any where the only thing you need to worry about is the size of the font you use. You can normally calculate a font size by saving the images resoltuion and then setting its resolution to 72 DPI calculate a font size basied of the images pixel width and the number of characters you want in a line. After adding the text layer you can restore the image to its original resolution and align the text layer by making a selection and alignint the text layer to the selection. There are nine posibilites like the positions in the selection you can align to like a tick tack toe board. You need to use a script to add the text layer because your retrieving the filename. The positioning of the text layer could be done easily in an action the would use the scriot to add a text layer the do a select all the align the added text layer to the selection.
About your script don't make text paragraph just add new line characters to make a multi line text layer So it can be positioned easily
I do just that with my stampexif action. The action uses my stampexif Photoshop java script to add a multi line text layer containing some formatted EXIF data then the action centers the text layer and add a layer style to it. Link http://www.mouseprints.net/old/dpr/StampExif.jsx Example