Append metadata template is easy. How to delete a template?

General Discussion of Scripting for Adobe Bridge

Moderators: Tom, Kukurykus

NScript

Append metadata template is easy. How to delete a template?

Post by NScript »

Hi

If you right-click on a thumbnail in Bridge, select "File Info" and "Advanced" you get a list of top-level metadata groups. You can append a new metadata group using the "Append" button and then delete this group using the "Delete" button. This works fine manually - but how does one achive this using a script?

I can append a metadata template using a script as follows:

metadata.applyMetadataTemplate( templateFileName, mode );

Is there an equivalent scripting function to delete a top-level metadata group as done by the "Delete" button?

Regards, NScript
patrucci

Append metadata template is easy. How to delete a template?

Post by patrucci »

Hi,

use the File Object's remove() -function, like this: tempTmpl.remove();

-patrucci-
NScript

Append metadata template is easy. How to delete a template?

Post by NScript »

Hi Patrucci

Unfortunately the metadata object in Bridge does not have a "remove" function.

The only way I can think of doing this is as follows:

1. Save all the metadata to an XMP file.
2. Delete the right number of lines from the XMP file that correspond to the namespace to be deleted.
3. Replace the metadata using "applyMetadataTemplate(tempTmpl, replace)"

I have not yet scripted or tried this. Any other suggestions are welcome!

Regards, NScript