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

Modifying specific metadata property on a document

Community Beginner ,
Sep 29, 2020 Sep 29, 2020

Copy link to clipboard

Copied

Hi,
I am writing a custom plugin. I am setting custom metadata on a document using kAppendMetaDataCmdBoss. Now I want to be able to modify a particular property on the metadata. For that I am using set function of  IMetaDataAccess and then saving it.The steps are : 

 

1) I get the front document using Utils<ILayoutUIUtils>()->GetFrontDocument();

2) Modify property using  IMetaDataAccess->Set

3) Save document using : Utils<IDocumentCommands>()->Save(::GetUIDRef(theFrontDoc));

The metadata is correctly modified for the particular property. But When the document is closed it causes indesign to crash.

It this correct way of modifying particular property in metadata?

 

Thanks

TOPICS
SDK

Views

122

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
Guide ,
Sep 30, 2020 Sep 30, 2020

Copy link to clipboard

Copied

LATEST

Like most modifications, invoke your Set() … thru a command - write an own command for that.

For an example, see kSetAdobeMediaMgmtMDCmdBoss with its IID_ISETADOBEMEDIAMGMTMDCMDDATA .

 

Alternatively copy the entire metadata to a stream, modify it on a local copy, then write back the entire stream - again with an own command. Apparently kSetMetaXAPCmdBoss uses that approach but IID_ICHARSTRINGDATA is undocumented.

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