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

Bridge 2023 - bug - metadata.applyMetadataTemplate() broken

Community Expert ,
Oct 28, 2022 Oct 28, 2022

Copy link to clipboard

Copied

Using the below code snippet tries to write metadata but fails. An XMP sidecar is created but the template data is not written to it. Please note the differences below it, the first history item uses the script and the second uses the Metadata panel menu item (which works correctly.)

    try{        
        var thumbs = app.document.selections;
        var fileMeta = thumbs[0].synchronousMetadata; //new metadata object
        fileMeta.applyMetadataTemplate('2022', 'append');
        }
    catch(e){
        alert(e + e.line);
        }

 

<xmpMM:History>
<rdf:Seq>
<rdf:li
stEvt:action="saved"
stEvt:instanceID="xmp.iid:9804ae16-b19f-6145-b31f-3197fea74e2f"
stEvt:when="2022-10-28T15:45:26-04:00"
stEvt:softwareAgent="Adobe Photoshop Camera Raw 15.0"
stEvt:changed="/metadata"/>
<rdf:li
stEvt:action="saved"
stEvt:instanceID="xmp.iid:67edb6b7-cdb4-de46-bf01-0083752faf56"
stEvt:when="2022-10-28T15:45:26-04:00"
stEvt:softwareAgent="Adobe Photoshop Camera Raw 15.0 (Windows)"
stEvt:changed="/metadata"/>
</rdf:Seq>
</xmpMM:History>
TOPICS
Bug , Metadata , Problem or error , Scripting

Views

20

Likes

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
no replies

Have something to add?

Join the conversation