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

A template? Action? Excel and Photoshop? Help!!!

Guest
Nov 28, 2022 Nov 28, 2022

Is it possible to make Text information duplicated in several places from one text layer?
For example, I create a table in which there are Numbers
, but I need to make this table in different sizes, is it possible to do so, I make several templates of different types, enter values into one of them and the information is substituted into all the others? or do I create templates, enter the necessary information into the necessary layers and it is duplicated in all templates?

TOPICS
Actions and scripting , macOS , Windows
1.1K
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 ,
Nov 28, 2022 Nov 28, 2022

you can use excel as a data source for text layers and for visibility of layers. after preparation with assigning excel columns to text layers you can start a serial production of psd mutations or change the files look and content by choosing an excel row. i've done an elaborated example about PS/XLS integration for a magazines article. this function is pretty old and the article too. i'd need to dig in my archive ...

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 ,
Nov 28, 2022 Nov 28, 2022
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
LEGEND ,
Nov 28, 2022 Nov 28, 2022
LATEST

Along with data-driven graphics, you could use a script to read values from a CSV/tab-delimited file and add them to a document. You could potentially use artboards to handle different sizes.

Photoshop doesn't have a feature to auto-update variable values but a Smart Object might be of use, you can modify that and anywhere it is used, it will update to the latest edit.

https://helpx.adobe.com/photoshop/using/create-smart-objects.html

https://helpx.adobe.com/photoshop/using/artboards.html

 

Below is a sample script to add text layers from a file:

/*
Utility Pack Scripts created by David M. Converse ©2018-22

This script adds text to a Photoshop document from a text file

Last modified 11/28/2022

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#target photoshop

addText();

function addText(){
    if(documents.length > 0){
        var originalDialogMode = app.displayDialogs;
        app.displayDialogs = DialogModes.ERROR;
        var originalRulerUnits = preferences.rulerUnits;
        preferences.rulerUnits = Units.PIXELS;
        try{
            var testFile = new File('~/Desktop').openDlg('Select import file', '*.txt');
            if(testFile != null){
                testFile.open('r');
                var textLine = testFile.readln();
                var docRef = activeDocument;
                var LayerRef = null;
                var TextRef = null;
                var pos = 200;
                while(textLine != ''){ //read in text one line at a time
                    LayerRef = docRef.artLayers.add();
                    LayerRef.kind = LayerKind.TEXT;
                    TextRef = LayerRef.textItem;
                    TextRef.contents  = textLine;
                    //optional text styling, can be customized to suit
                    pos = pos + 50;
                    TextRef.position = new Array(pos, pos);
                    preferences.rulerUnits = Units.POINTS;
                    TextRef.size = 24;
                    TextRef.useAutoLeading = false;
                    TextRef.leading = 24;
                    TextRef.font = 'Calibri-Bold';
                    TextRef.justification = Justification.CENTER;
                    TextRef.autoKerning = AutoKernType.METRICS;
                    //end optional text styling
                    textLine = testFile.readln();
                    }
                testFile.close();
                }
            }
        catch(e){
            alert(e + e.line);
            preferences.rulerUnits = originalRulerUnits;
            app.displayDialogs = originalDialogMode;
            return;
            }
        preferences.rulerUnits = originalRulerUnits;
        app.displayDialogs = originalDialogMode;
        }
    else{
        alert('You must have a document open to run this script.');
        return;
        }
    return;
    }
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