Help with Photoshop Actions. Dynamic Text.

Posted on 2007-08-01
Last Modified: 2013-12-25
Hi there,

We're trying to automate a process in Photoshop but we're getting stuck at the point where we need to type in Text. You see the idea is to create around 465 png files that contain different text in each file.

Here's how it needs to work.

Create a New File Say 400x600

Add a new Text Layer (the text needs to be read from another file or the file name) the first time round it will be January 1st the second time it should read January 2nd, the third time should be January 3rd, well you get the idea, we're trying to put each individual date on each photoshop document.

Then the text layer needs to be rasterized

Then it will need to be skewed V: -9.3 degrees

Then it needs to be centered at X: 200px and Y: 300px

Then it needs to be saved as a .png with the date as the file name (eg: january-1st.png) and have the background transparent.

Is this possible?

I don't have a lot of experience with Photoshop Actions but I thought maybe there is a way to get the text from the file name and use that as the text for the Text Layer?

So I would create 365 files:
January 1st.psd
January 2nd.psd etc.. etc...

Or, can I use Automator to open a text file and read each line into a photoshop macro?

I'm just throwing out ideas here, let me know what your thoughts are on this? I've read a few tutorials on how to create copyright text but our situation is different in that we need the text to change each time.

I have created an action set that does all the steps except for the differing text and the positioning.

Thanks very much for any ideas you can come up with, we'd like to have something sorted out in the next couple of days.

Question by:antum
    LVL 9

    Accepted Solution

    Positioning is NOT recorded in Photoshop actions, so this is in script territory here.

    I did come across this script from I don't know if this will help you or not.

    ( documents.length > 0 ) { /* This script will add copyright information and filename on a text layer */ // set units to pixels var originalRulerUnits = preferences.rulerUnits; preferences.rulerUnits = Units.PIXELS; try { // add art layer var docRef = activeDocument; var artLayerRef = docRef.artLayers.add(); artLayerRef.kind = LayerKind.TEXT; // ============= Personalize your values in the section below ============ // Copyright info var myCopyrightText = "© Anil Mungal 2003 - file: "; // select opacity artLayerRef.opacity = 100; // select the text colour var newColour = new SolidColor(); if (docRef.mode == DocumentMode.CMYK) { newColour.cmyk.cyan = 255; newColour.cmyk.magenta = 255; newColour.cmyk.yellow = 255; = 0; } if (docRef.mode == DocumentMode.RGB) { = 255; = 255; = 255; } artLayerRef.textItem.color = newColour; // select the font name artLayerRef.textItem.font = "ArialMT"; // select the font size artLayerRef.textItem.size = 10; // select the text position - this can be an absolute value too, eg. (10,20) artLayerRef.textItem.position = new Array(docRef.width / 2, docRef.height *0.05); // select the text justification artLayerRef.textItem.justification = Justification.CENTER; // ============= Personalize your values in the section above ============ // add text item on the art layer var textItemRef = artLayerRef.textItem; // text contents is copyright info + filename textItemRef.contents = myCopyrightText +; // dereference pointers docRef = null; artLayerRef = null; textItemRef = null; myCopyrightText = null; newColour = null; } catch( e ) { // received and error ... throw it back to the user preferences.rulerUnits = originalRulerUnits; throw e; } preferences.rulerUnits = originalRulerUnits; } else { alert( "Open a document first." ); }

    Author Comment

    thinkwelldesigns thanks a bunch for your insight, I'd never heard of Photoshop scripting before so it's something I'm looking into now... it just might solve our problem...

    Does anyone know of any other websites that are a good reference for scripting in photoshop?


    LVL 9

    Expert Comment

    Thanks for the grade and points! Hope it helps you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    In a previous article here at Experts Exchange (…
    I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
    Make a selection using the pen tool to trace the selection. Then alter the color of the selection by using the color balance option in Adobe Photoshop.
    After watching the Introduction to GIMP this tutorial will show you additional tools to use in GIMP.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now