Newbie Question

General Discussion of Scripting for Adobe Bridge

Moderators: Tom, Kukurykus

sjg

Newbie Question

Post by sjg »

Hi! Stupid newbie here, and I'm having trouble...

After accidentally wiping a bunch of ratings (i.e., didn't read the warning when clearing my cache), I thought I'd write a quick script that would export ratings into the IPTC Core keywords as "1_stars" - "5_stars". Later, I thought I'd write the reverse function. That way, I could preserve ratings and even access them in other programs.

It's my first time to write a script for Bridge, but it seems like it should be easy enough. I've looked at the examples in the Bridge Scripting Guide. I've tried a number of experiments.

I'm able to *get* the rating information, but I'm having a heck of a time getting my new information to save. I've tried a variety of things, but have failed. I'm sure I'm doing something quite stupid. Anyway, here's the most recent thing I have tried:

Code: Select allif (thisThumb.type == 'file')
   {
   var src_meta = thisThumb.metadata
   src_meta.namespace = "http://ns.adobe.com/xap/1.0/";
               
   var rating = src_meta.Rating + '_stars';
   var dst_meta = thisThumb.metadata
   dst_meta.namespace = "http://ns.adobe.com/photoshop/1.0/";
   dst_meta.Keywords[dst_meta.Keywords.length] = rating;
   }


Any advice?

Thanks!
sjg

Newbie Question

Post by sjg »

OK, I have solved the previous problem (code available on request).

But now I have another issue...

Does anyone know if the EXIF data that can be accessed through the metadata interface is somehow separate from the EXIF data in the image (i.e., in the XMP sidecar?).

When I write a value to an EXIF field, it seems to cause trouble. For specifics, please take a look [url =http://www.adobeforums.com/cgi-bin/webx ... @.3bbec0fc] here [/url] .

I'd appreciate any advice!

Thanks.