Photoshop CS - Mass Edit Metadata, eg Keywords

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Andrew

Photoshop CS - Mass Edit Metadata, eg Keywords

Post by Andrew »

This is something I discovered yesterday, I don't know how widely it is understood.

Say you want to add a keyword (or keywords, or other metadata) to a selection of images in the PS File Browser, but you want to leave all the rest of the metadata for those images untouched.

You can do this by creating an XMP subset of a test files metadata that has been edited to only contain the lines appropriate to the edit you are wanting. For example, to add the keyword flag1, you create the following xmp file:

Code: Select all<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?><x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 3.0-29, framework 1.6'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>

 <rdf:Description rdf:about='uuid:ea5e2913-9d0f-11d9-8b0c-dfc161d10339'
  xmlns:dc='http://purl.org/dc/elements/1.1/'>
  <dc:subject>
   <rdf:Bag>
    <rdf:li>flag1</rdf:li>
   </rdf:Bag>
  </dc:subject>
 </rdf:Description>

</rdf:RDF>
</x:xmpmeta>
<?xpacket end='r'?>

If instead you did the replace with the file 'removekeyword' ALL keywords will be removed from the selected files. The remove file looks like this:

Code: Select all<?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?><x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 3.0-29, framework 1.6'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>

 <rdf:Description rdf:about='uuid:ea5e2913-9d0f-11d9-8b0c-dfc161d10339'
  xmlns:dc='http://purl.org/dc/elements/1.1/'>
  <dc:subject>
   <rdf:Bag>
   </rdf:Bag>
  </dc:subject>
 </rdf:Description>

</rdf:RDF>
</x:xmpmeta>
<?xpacket end='r'?>

I cannot find a way to remove only a specific keyword while leaving others intact (my script ah-flag in the scripts section deals with this problem fine).

To try this out download: bb/files/addremkeywords.zip

Unzip and place the two files in your folder (this is the W XP example, you will have to work out your equivalent):

C:\Documents and Settings\User\Application Data\Adobe\XMP\Metadata Templates\

Open PSCS, open the File Browser, select a couple of test files, go to the File Browser menu: Edit >> Append Metadata and select 'addkeyword'. This will add 'flag1' to the keywords in all selected files. Similarly, Replace Metadata would strike out all the other keywords and add 'flag1'.

The advantage of this method over the script is that I think it is faster, largely because it is doing less (no remove). It does also work for a wider range of image types than the script which is confined to jpg, tif, psd, png. But then I have another script that edits metadata in xmp sidecars that is WAY faster since it does not have to open the underlying images.

Andrew
haggest

Photoshop CS - Mass Edit Metadata, eg Keywords

Post by haggest »

Please post a link.
Thx[/quote]
Andrew

Photoshop CS - Mass Edit Metadata, eg Keywords

Post by Andrew »

My metadata handling scripts / functions are all over the place right now. My xml metadata reader might be of interest.

bb/viewtopic.php?t=115

I will shortly be releasing new versions of my raw image review and image review scripts that have more recent and improved versions (including CS2 functionality) of this stuff.

Andrew