Skip to main content
Inspiring
October 28, 2022
Open for Voting

Please use commas instead of semicolons Photoshop Metadata Keywords

  • October 28, 2022
  • 13 replies
  • 1184 views

Hello:

More and more applications use commas instead of semicolons to detect keywords. For example, in Woocommerce in the tag section you have to paste tags separated with commas so you cannot paste keywords from the Photoshop info tab because those are separated by semicolons. Use commas, or at least let us in the preference field to choose commas as the method of choice to separate keywords. 

13 replies

Stephen Marsh
Community Expert
Community Expert
September 28, 2023

@DukeNelson – thanks for the update, I'll check out your post!

 

EDIT:

 

Tested with Bridge 2024 (v14) with TIFF and PSD.

 

If multiple files are selected, the file that is right-clicked will be the one with the keywords/subject metadata copied, which makes sense.

 

The code is using a comma+space separator:

 

keys = (keys.join(', '));

 

If the end user doesn't require spaces change it to:

 

keys = (keys.join(','));

 

Good work!

Participating Frequently
September 28, 2023

@Stephen MarshThanks. I've dusted off my 10-years-dormant coding skills and eventually managed to get something to work in Bridge. I'll post in the Bridge forum.

Stephen Marsh
Community Expert
Community Expert
September 27, 2023

@DukeNelson 

 

For me, probably difficult, but I don't know until I try. For those that regularly script Bridge it is probably easy.

 

 I'd suggest that you search the Bridge forum, there might be something there. If not, create a new topic in the Bridge forum and reference this topic.

 

Perhaps:

 

https://raw.githubusercontent.com/Paul-Riggott/PS-Scripts/master/Copy%20Paste%20Metadata.jsx

Participating Frequently
September 27, 2023

@Stephen MarshHow feasible is it to adapt this script to give the same function in Adobe Bridge? (i.e. to copy keywords for the selected image into the Windows clipboard and change delimiter from semicolon to comma).

Chuck Uebele
Community Expert
Community Expert
October 28, 2022

Scripts will not negatively affect PS. They are just text files with the extension jsx. Normally, they are placed in the PS subfolder presets/scripts. To remove it, just delete the file.

mastixAuthor
Inspiring
October 28, 2022

Thank you very much. Two questions:

 

1- I have never installed a script. Can something like this affect negatively photoshop, make it unstable or slower

2- If I install it and for whatever reason don't want it no more how to uninstall it?

 

Thanks again for your help

 

Cristian

Stephen Marsh
Community Expert
Community Expert
October 28, 2022

@mastix – No need to wait for Adobe to possibly change things... The following script will automatically copy the keywords to the clipboard separated by ',' (comma) – ready for pasting into your website etc. This script could possibly save you half a dozen steps per image if doing this from an open image in Photoshop. Once installed, the script can have a custom keyboard shortcut applied, or it could be recorded into an Action with an F-key shortcut.

 

/*
Keywords to Clipboard.jsx
https://community.adobe.com/t5/photoshop-ecosystem-ideas/please-use-commas-instead-of-semicolons-photoshop-metadata-keywords/idc-p/13303783
v1.0 - 28th October 2022, Stephen Marsh
*/

// Legacy IPTC, don't use
// var keys = activeDocument.info.keywords;

// Get the XMP based keywords
if (ExternalObject.AdobeXMPScript === undefined) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
var xmp = new XMPMeta(activeDocument.xmpMetadata.rawData);
var keys = getArrayItems(XMPConst.NS_DC, 'subject');

// Split the keyword array with a comma
keys = (keys.join(','));

// Load the clipboard
var d = new ActionDescriptor();
d.putString(stringIDToTypeID("textData"), keys);
executeAction(stringIDToTypeID("textToClipboard"), d, DialogModes.NO);


// Functions

function getArrayItems(ns, prop) {
    var arrItem = [];
    var items = xmp.countArrayItems(ns, prop);
    for (var i = 1; i <= items; i++) {
        arrItem.push(xmp.getArrayItem(ns, prop, i));
    }
    return arrItem;
}

 

  1. Copy the code text to the clipboard
  2. Open a new blank file in a plain-text editor (not in a word processor)
  3. Paste the code in
  4. Save the text file as .txt
  5. Rename the file extension from .txt to .jsx
  6. Install or browse to the .jsx file to run (see below)

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html#Photoshop

 

mastixAuthor
Inspiring
October 28, 2022

It would be great that if it is only a display convention that Photoshop lets user to have the keywords shown separated by blank spaces, commas or semicolons (I think the later has little utility as most stock sites for example, WordPress etc want commas and not semicolons.)

PECourtejoie
Community Expert
Community Expert
October 28, 2022

Consistency makes sense! Then Bridge needs to come along!

Stephen Marsh
Community Expert
Community Expert
October 28, 2022

Under the hood, the XMP metadata doesn't use semicolons, or commas or any other visible separator, so this is purely a display convention in Photoshop.