Skip to main content
Participating Frequently
October 28, 2024
Answered

Script for spezial Metadata read an write

  • October 28, 2024
  • 4 replies
  • 641 views

Hello Scripters in Bridge - Metadata

 

I'm looking for a solution to read the following IPTC field:
"http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "extDescrAccessibility"

It should be appended to the existing content of the description using a script.

Thank you very much for your help

Tom

This topic has been closed for replies.
Correct answer Stephen Marsh

Hi again, Tom. Try these three scripts. The third script is a combined version of the first two scripts.

 

/*
Append AltTextAccessibility to the Headline Metadata.jsx
Stephen Marsh
v1.0 - 4th November 2024
https://community.adobe.com/t5/bridge-discussions/script-for-spezial-metadata-read-an-write/td-p/14945771
*/

#target bridge

addAltTextToHeadline = {};

addAltTextToHeadline.execute = function () {
    var sels = app.document.selections;
    for (var i = 0; i < sels.length; i++) {
        var md = sels[i].synchronousMetadata;

        // Access the existing Headline metadata
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        var currentHeadline = md.Headline || ""; // Get existing headline or empty if not set

        // Access the existing AltTextAccessibility metadata
        md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
        var altTextAccessibility = md.AltTextAccessibility || ""; // Get AltTextAccessibility or empty if not set

        // Append AltTextAccessibility to the Headline metadata
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        md.Headline = currentHeadline + (altTextAccessibility ? " " + altTextAccessibility : "");
    }
}

if (BridgeTalk.appName == "bridge") {
    var menu = MenuElement.create("command", "Append AltTextAccessibility to the Headline", "at the end of Tools");
    menu.onSelect = addAltTextToHeadline.execute;
}

 

 

 

 

/*
Append ExtDescrAccessibility to Description Metadata.jsx
Stephen Marsh
v1.0 - 4th November 2024
https://community.adobe.com/t5/bridge-discussions/script-for-spezial-metadata-read-an-write/td-p/14945771
*/


#target bridge

addExtDescrToDescription = {};

addExtDescrToDescription.execute = function () {
    var sels = app.document.selections;
    for (var i = 0; i < sels.length; i++) {
        var md = sels[i].synchronousMetadata;

        // Access the existing Description metadata
        md.namespace = "http://purl.org/dc/elements/1.1/";
        var currentDescription = md.description || ""; // Get existing description or empty if not set

        // Access the ExtDescrAccessibility metadata
        md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
        var extDescrAccessibility = md.ExtDescrAccessibility || ""; // Get ExtDescrAccessibility or empty if not set

        // Append ExtDescrAccessibility to the Description metadata
        md.namespace = "http://purl.org/dc/elements/1.1/";
        md.description = currentDescription + (extDescrAccessibility ? " " + extDescrAccessibility : "");
    }
}

if (BridgeTalk.appName == "bridge") {
    var menu = MenuElement.create("command", "Append ExtDescrAccessibility to Description", "at the end of Tools");
    menu.onSelect = addExtDescrToDescription.execute;
}

 

 

 

 

/*
Append AltTextAccessibility to Headline & ExtDescrAccessibility to Description Metadata.jsx
Stephen Marsh
v1.0 - 4th November 2024
*/

#target bridge

appendAccessibilityToMetadata = {};

appendAccessibilityToMetadata.execute = function () {
    var sels = app.document.selections;
    for (var i = 0; i < sels.length; i++) {
        var md = sels[i].synchronousMetadata;

        // Access and modify Headline metadata
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        var currentHeadline = md.Headline || ""; // Get existing headline or empty if not set

        // Access AltTextAccessibility metadata
        md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
        var altTextAccessibility = md.AltTextAccessibility || ""; // Get AltTextAccessibility or empty if not set

        // Append AltTextAccessibility to Headline
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        md.Headline = currentHeadline + (altTextAccessibility ? " " + altTextAccessibility : "");

        // Access and modify Description metadata
        md.namespace = "http://purl.org/dc/elements/1.1/";
        var currentDescription = md.description || ""; // Get existing description or empty if not set

        // Access ExtDescrAccessibility metadata
        md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
        var extDescrAccessibility = md.ExtDescrAccessibility || ""; // Get ExtDescrAccessibility or empty if not set

        // Append ExtDescrAccessibility to Description
        md.namespace = "http://purl.org/dc/elements/1.1/";
        md.description = currentDescription + (extDescrAccessibility ? " " + extDescrAccessibility : "");
    }
}

if (BridgeTalk.appName == "bridge") {
    var menu = MenuElement.create("command", "Append AltTextAccessibility to Headline & ExtDescrAccessibility to Description", "at the end of Tools");
    menu.onSelect = appendAccessibilityToMetadata.execute;
}

 

 

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

4 replies

Stephen Marsh
Community Expert
Stephen MarshCommunity ExpertCorrect answer
Community Expert
November 3, 2024

Hi again, Tom. Try these three scripts. The third script is a combined version of the first two scripts.

 

/*
Append AltTextAccessibility to the Headline Metadata.jsx
Stephen Marsh
v1.0 - 4th November 2024
https://community.adobe.com/t5/bridge-discussions/script-for-spezial-metadata-read-an-write/td-p/14945771
*/

#target bridge

addAltTextToHeadline = {};

addAltTextToHeadline.execute = function () {
    var sels = app.document.selections;
    for (var i = 0; i < sels.length; i++) {
        var md = sels[i].synchronousMetadata;

        // Access the existing Headline metadata
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        var currentHeadline = md.Headline || ""; // Get existing headline or empty if not set

        // Access the existing AltTextAccessibility metadata
        md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
        var altTextAccessibility = md.AltTextAccessibility || ""; // Get AltTextAccessibility or empty if not set

        // Append AltTextAccessibility to the Headline metadata
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        md.Headline = currentHeadline + (altTextAccessibility ? " " + altTextAccessibility : "");
    }
}

if (BridgeTalk.appName == "bridge") {
    var menu = MenuElement.create("command", "Append AltTextAccessibility to the Headline", "at the end of Tools");
    menu.onSelect = addAltTextToHeadline.execute;
}

 

 

 

 

/*
Append ExtDescrAccessibility to Description Metadata.jsx
Stephen Marsh
v1.0 - 4th November 2024
https://community.adobe.com/t5/bridge-discussions/script-for-spezial-metadata-read-an-write/td-p/14945771
*/


#target bridge

addExtDescrToDescription = {};

addExtDescrToDescription.execute = function () {
    var sels = app.document.selections;
    for (var i = 0; i < sels.length; i++) {
        var md = sels[i].synchronousMetadata;

        // Access the existing Description metadata
        md.namespace = "http://purl.org/dc/elements/1.1/";
        var currentDescription = md.description || ""; // Get existing description or empty if not set

        // Access the ExtDescrAccessibility metadata
        md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
        var extDescrAccessibility = md.ExtDescrAccessibility || ""; // Get ExtDescrAccessibility or empty if not set

        // Append ExtDescrAccessibility to the Description metadata
        md.namespace = "http://purl.org/dc/elements/1.1/";
        md.description = currentDescription + (extDescrAccessibility ? " " + extDescrAccessibility : "");
    }
}

if (BridgeTalk.appName == "bridge") {
    var menu = MenuElement.create("command", "Append ExtDescrAccessibility to Description", "at the end of Tools");
    menu.onSelect = addExtDescrToDescription.execute;
}

 

 

 

 

/*
Append AltTextAccessibility to Headline & ExtDescrAccessibility to Description Metadata.jsx
Stephen Marsh
v1.0 - 4th November 2024
*/

#target bridge

appendAccessibilityToMetadata = {};

appendAccessibilityToMetadata.execute = function () {
    var sels = app.document.selections;
    for (var i = 0; i < sels.length; i++) {
        var md = sels[i].synchronousMetadata;

        // Access and modify Headline metadata
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        var currentHeadline = md.Headline || ""; // Get existing headline or empty if not set

        // Access AltTextAccessibility metadata
        md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
        var altTextAccessibility = md.AltTextAccessibility || ""; // Get AltTextAccessibility or empty if not set

        // Append AltTextAccessibility to Headline
        md.namespace = "http://ns.adobe.com/photoshop/1.0/";
        md.Headline = currentHeadline + (altTextAccessibility ? " " + altTextAccessibility : "");

        // Access and modify Description metadata
        md.namespace = "http://purl.org/dc/elements/1.1/";
        var currentDescription = md.description || ""; // Get existing description or empty if not set

        // Access ExtDescrAccessibility metadata
        md.namespace = "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/";
        var extDescrAccessibility = md.ExtDescrAccessibility || ""; // Get ExtDescrAccessibility or empty if not set

        // Append ExtDescrAccessibility to Description
        md.namespace = "http://purl.org/dc/elements/1.1/";
        md.description = currentDescription + (extDescrAccessibility ? " " + extDescrAccessibility : "");
    }
}

if (BridgeTalk.appName == "bridge") {
    var menu = MenuElement.create("command", "Append AltTextAccessibility to Headline & ExtDescrAccessibility to Description", "at the end of Tools");
    menu.onSelect = appendAccessibilityToMetadata.execute;
}

 

 

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

Participating Frequently
November 4, 2024

Jaaaaa, das funktioniert so. Best und thanks!

Stephen Marsh
Community Expert
Community Expert
November 4, 2024
quote

Jaaaaa, das funktioniert so. Best und thanks!


By @ShuttleTom

 

You're welcome!

Stephen Marsh
Community Expert
Community Expert
November 3, 2024

@ShuttleTom 

 

Hi Tom, the quickest and easiest way to append one metadata entry to another is via the command line-driven ExifTool app.

 

exiftool -overwrite_original '-headline<$headline ${alttextaccessibility}' 'system path to the file or folder'

 

exiftool -overwrite_original '-description<$description ${extdescraccessibility}' 'system path to the file or folder'

 

Or both combined into a single command:

exiftool -overwrite_original '-headline<$headline ${alttextaccessibility}' -execute '-description<$description ${extdescraccessibility}' -common_args 'system path to the file or folder'

 

These commands are formatted for the Mac, Windows would use double-straight " quote marks rather than single straight ' quote marks.

 

Scripting is much harder, I can't promise anything as I don't script Bridge very often, I usually only modify existing code.

Stephen Marsh
Community Expert
Community Expert
October 29, 2024

Here is a list of namespaces:


AEScart: => http://ns.adobe.com/aes/cart/
DICOM: => http://ns.adobe.com/DICOM/
Iptc4xmpCore: => http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/
Iptc4xmpExt: => http://iptc.org/std/Iptc4xmpExt/2008-02-29/
adobe: => http://ns.adobe.com/xmp/aggregate/1.0/
album: => http://ns.adobe.com/album/1.0/
as11c: => http://amwa.tv/mxf/as/11/core/
as11s: => http://ns.adobe.com/mxf/as/11/structural/
as11u: => http://amwa.tv/mxf/as/11/ukdpp/
asf: => http://ns.adobe.com/asf/1.0/
aux: => http://ns.adobe.com/exif/1.0/aux/
bext: => http://ns.adobe.com/bwf/bext/1.0/
bmsp: => http://ns.adobe.com/StockPhoto/1.0/
cq: => http://www.day.com/jcr/cq/1.0
creatorAtom: => http://ns.adobe.com/creatorAtom/1.0/
crs: => http://ns.adobe.com/camera-raw-settings/1.0/
custom_date: => http://ns.custom_date.com/custom_date/
dam: => http://www.day.com/dam/1.0
dc: => http://purl.org/dc/elements/1.1/
egBarc: => http://ns.esko-graphics.com/barcode/1.0/
egBarcL: => http://ns.esko-graphics.com/barcodelist/1.0/
egCadL: => http://ns.esko-graphics.com/cadlist/1.0/
egCadReg: => http://ns.esko-graphics.com/cadreg/1.0/
egExtF: => http://ns.esko-graphics.com/extfile/1.0/
egExtFL2: => http://ns.esko-graphics.com/extfileslist/2.0/
egExtFL: => http://ns.esko-graphics.com/extfileslist/1.0/
egGr: => http://ns.esko-graphics.com/grinfo/1.0/
egInk: => http://ns.esko-graphics.com/inkinfo/1.0/
egInkCov: => http://ns.esko-graphics.com/inkcov/1.0/
egInkCovL: => http://ns.esko-graphics.com/inkcovlist/1.0/
egJob: => http://ns.esko-graphics.com/jobinfo/1.0/
egLay: => http://ns.esko-graphics.com/layer/1.0/
egLayL: => http://ns.esko-graphics.com/laylist/1.0/
egPDFNat: => http://ns.esko-graphics.com/pdfnatversion/1.0/
egPag: => http://ns.esko-graphics.com/pagerange/1.1/
egPagL: => http://ns.esko-graphics.com/pagerangelist/1.0/
egPrF: => http://ns.esko-graphics.com/prodfile/1.0/
egSmartID: => http://ns.esko-graphics.com/smartid/1.0/
exif: => http://ns.adobe.com/exif/1.0/
exifEX: => http://cipa.jp/exif/1.0/
fwr: => http://ns.fotoware.com/iptcxmp-reserved/1.0/
iX: => http://ns.adobe.com/iX/1.0/
iXML: => http://ns.adobe.com/ixml/1.0/
idPriv: => http://ns.adobe.com/xmp/InDesign/private
illustrator: => http://ns.adobe.com/illustrator/1.0/
jp2k: => http://ns.adobe.com/jp2k/1.0/
jpeg: => http://ns.adobe.com/jpeg/1.0/
kbrg3D: => http://ns.adobe.com/bridge/3D
kbrg: => http://ns.adobe.com/bridge/1.0/
lr: => http://ns.adobe.com/lightroom/1.0/
pdf: => http://ns.adobe.com/pdf/1.3/
pdfaExtension: => http://www.aiim.org/pdfa/ns/extension/
pdfaField: => http://www.aiim.org/pdfa/ns/field#
pdfaProperty: => http://www.aiim.org/pdfa/ns/property#
pdfaSchema: => http://www.aiim.org/pdfa/ns/schema#
pdfaType: => http://www.aiim.org/pdfa/ns/type#
pdfaid: => http://www.aiim.org/pdfa/ns/id/
pdfx: => http://ns.adobe.com/pdfx/1.3/
pdfxid: => http://www.npes.org/pdfx/ns/id/
photoshop: => http://ns.adobe.com/photoshop/1.0/
plus: => http://ns.useplus.org/ldf/xmp/1.0/
png: => http://ns.adobe.com/png/1.0/
rdf: => http://www.w3.org/1999/02/22-rdf-syntax-ns#
riffinfo: => http://ns.adobe.com/riff/info/
skyview: => http://ns.fotoware.com/skyview/1.0/
stCamera: => http://ns.adobe.com/photoshop/1.0/camera-profile
stDim: => http://ns.adobe.com/xap/1.0/sType/Dimensions#
stEvt: => http://ns.adobe.com/xap/1.0/sType/ResourceEvent#
stFnt: => http://ns.adobe.com/xap/1.0/sType/Font#
stJob: => http://ns.adobe.com/xap/1.0/sType/Job#
stLoc: => http://ns.adobe.com/xap/1.0/sType/DataLocation#
stMfs: => http://ns.adobe.com/xap/1.0/sType/ManifestItem#
stRef: => http://ns.adobe.com/xap/1.0/sType/ResourceRef#
stVer: => http://ns.adobe.com/xap/1.0/sType/Version#
swf: => http://ns.adobe.com/swf/1.0/
tiff: => http://ns.adobe.com/tiff/1.0/
wav: => http://ns.adobe.com/xmp/wav/1.0/
x: => adobe:ns:meta/
xapG: => http://ns.adobe.com/xap/1.0/g
xml: => http://www.w3.org/XML/1998/namespace
xmp: => http://ns.adobe.com/xap/1.0/
xmpBJ: => http://ns.adobe.com/xap/1.0/bj/
xmpCA: => http://ns.adobe.com/xmp/1.0/ContentAnalysis/
xmpDM: => http://ns.adobe.com/xmp/1.0/DynamicMedia/
xmpG: => http://ns.adobe.com/xap/1.0/g/
xmpGImg: => http://ns.adobe.com/xap/1.0/g/img/
xmpMM: => http://ns.adobe.com/xap/1.0/mm/
xmpNote: => http://ns.adobe.com/xmp/note/
xmpPMAssign: => http://xmlns.sony.net/pro/metadata/planningmetadata/assignment/
xmpPMMemo: => http://xmlns.sony.net/pro/metadata/planningmetadata/memo/
xmpRights: => http://ns.adobe.com/xap/1.0/rights/
xmpScript: => http://ns.adobe.com/xmp/1.0/Script/
xmpT: => http://ns.adobe.com/xap/1.0/t/
xmpTPg: => http://ns.adobe.com/xap/1.0/t/pg/
xmpidq: => http://ns.adobe.com/xmp/Identifier/qual/1.0/
xmpx: => http://ns.adobe.com/xmp/transient/1.0/

Stephen Marsh
Community Expert
Community Expert
October 29, 2024

Hi Tom,

 

The namespace would appear to be:

 

"http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/"

 

Bridge File Info Raw Data reports:

 

<Iptc4xmpCore:ExtDescrAccessibility>

 <rdf:Alt>

  <rdf:li xml:lang="x-default">extDescrAccessibility TEST</rdf:li>

 </rdf:Alt>

</Iptc4xmpCore:ExtDescrAccessibility>

 

ExifTool reports:

 

[XMP-iptcCore] ExtDescrAccessibility