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

How to copy keywords to description

New Here ,
Mar 27, 2015 Mar 27, 2015

Copy link to clipboard

Copied

In the fileinfo panel, I would like to copy what's in the keywords and append it to the description. Any ideas? Thanks. I'm using Photoshop CC 2014.

TOPICS
Actions and scripting

Views

2.1K

Translate

Translate

Report

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

correct answers 1 Correct answer

Enthusiast , Mar 29, 2015 Mar 29, 2015

As the others have shown this can be done with the file open in Photoshop, and can be done in one line of code.

activeDocument.info.caption = activeDocument.info.caption + ";" + activeDocument.info.keywords.toString();

But if you need to do a batch of files without opening them it would be better using a Bridge script.

Votes

Translate

Translate
Adobe
Community Expert ,
Mar 28, 2015 Mar 28, 2015

Copy link to clipboard

Copied

Does this javascript statement help any

alert(app.activeDocument.info.keywords);

alert(app.activeDocument.info.instructions);

app.activeDocument.info.instructions = app.activeDocument.info.instructions + " " + app.activeDocument.info.keywords;

alert(app.activeDocument.info.instructions);

alert(app.activeDocument.info.description);  // most have some other name .description is undefined

JJMack

Votes

Translate

Translate

Report

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 ,
Mar 28, 2015 Mar 28, 2015

Copy link to clipboard

Copied

Thanks for your reply. I'll give it a whirl Monday morning.

Votes

Translate

Translate

Report

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 ,
Mar 28, 2015 Mar 28, 2015

Copy link to clipboard

Copied

Looking at the ExtendScript  Object Model Viewer it looks like there is no Documentinfo description property or method. I can set the description files in Photoshop File Info XMP panel and I can retrive it in a Photoshop script by parsing the document xmpmetadata.   However document xmpmetadata is read only in Photoshop scripting.  However I do not know scripting well I just hack at it. You may be able to do it from the bridge or Photoshop by creating a metadata template.  I seen some documentation on that subject

Photoshop Help | Metadata and notes

Capture.jpg

JJMack

Votes

Translate

Translate

Report

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 ,
Mar 29, 2015 Mar 29, 2015

Copy link to clipboard

Copied

It turns out the Description is info caption so the script is easy.  I have never written a Bridge script but it all you want to do is batch update metadata the bridge is what you should use.  The main reason I use bridge is for metadata editing to update metadata and select groups of raw files the their thumbnails look to have similar exposures to develop ACR setting and sync setting using ACR.  Files are not opened into Photoshop this way and processing is faster.   I normally only use Windows File explorer and Photoshop when I edit images. Bridge can slow down processing if it needs to populate its cache....

JJMack

Votes

Translate

Translate

Report

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
Guru ,
Mar 29, 2015 Mar 29, 2015

Copy link to clipboard

Copied

Today I wrote a similar script: with "layer names" instead of "keywords". It was easy to adjust it to use keywords.

29-03-2015 13-35-32.jpg

It was written and tested in CS6 for Windows; hope it would work in newer versions as well.

var cTID = function(s) { return app.charIDToTypeID(s); };

var sTID = function(s) { return app.stringIDToTypeID(s); };

main();

function main() {

    if (app.documents.length > 0) {

        var doc = app.activeDocument,

        keywords = doc.info.keywords.join(", ");

        if (keywords != "") {

            writeToDescription(keywords);

        }

        else {

            alert("No keywords were found.", "Write keywords to description", true);

        }

    }

    else {

        alert("Please open a document and try again.", "Write keywords to description", true);

    }

}

function writeToDescription(str) {

    var desc1 = new ActionDescriptor();

    var ref1 = new ActionReference();

    ref1.putProperty(cTID('Prpr'), cTID('FlIn'));

    ref1.putEnumerated(cTID('Dcmn'), cTID('Ordn'), cTID('Trgt'));

    desc1.putReference(cTID('null'), ref1);

    var desc2 = new ActionDescriptor();

    desc2.putString(cTID('Cptn'), str);

    desc1.putObject(cTID('T   '), cTID('FlIn'), desc2);

    executeAction(cTID('setd'), desc1, DialogModes.NO);

}

Votes

Translate

Translate

Report

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
Enthusiast ,
Mar 29, 2015 Mar 29, 2015

Copy link to clipboard

Copied

As the others have shown this can be done with the file open in Photoshop, and can be done in one line of code.

activeDocument.info.caption = activeDocument.info.caption + ";" + activeDocument.info.keywords.toString();

But if you need to do a batch of files without opening them it would be better using a Bridge script.

Votes

Translate

Translate

Report

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
Guru ,
Mar 29, 2015 Mar 29, 2015

Copy link to clipboard

Copied

Thanks Philip for pointing this out. It is not immediately obvious (at least for me) that "description" hides under the term "caption".

Votes

Translate

Translate

Report

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 12, 2015 Apr 12, 2015

Copy link to clipboard

Copied

Thank you. This worked great!

Votes

Translate

Translate

Report

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 Beginner ,
Jan 31, 2019 Jan 31, 2019

Copy link to clipboard

Copied

LATEST

Can someone clarify the answer for a beginner? I would like a script to batch copy keywords to comments, description or any other more universal field in Bridge (not for photo files). Thank you

Votes

Translate

Translate

Report

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