Skip to main content
New Participant
December 11, 2024
Answered

UXP/Scripting Solution for Importing and Exporting XMP Metadata

  • December 11, 2024
  • 1 reply
  • 1048 views

I know that there is a manual solution to do this via the File => File Info menu. See images below.

The export option saves an XMP file containing all of the file metadata. 

On a new file, you can import the saved file and select different options about how to treat existing data and what is contained in the file. 

I would like to create a script that performs these actions in a controlled and repeatable way for users.

I am having trouble identifying the relevant UXP objects that would allow me to do this. Has anyone had success with this sort of import and export behavior?

 

 

Correct answer John D Herzog

document.metadataPreference.replace() or document.metadataPreference.append().

1 reply

John D Herzog
Inspiring
December 11, 2024

It looks like document.metadataPreference.

New Participant
December 11, 2024

Thanks!

I was looking at this object independently and saw a save option, but wasn't sure whether this was the same action as exporting via the GUI. 

I was able to use the document.metadataPreference.save option to save to an XMP file. I do not see a method on this object for importing, though. 

Curious if other folks have found a way to do this.

John D Herzog
John D HerzogCorrect answer
Inspiring
December 11, 2024

document.metadataPreference.replace() or document.metadataPreference.append().