[CS3 JS] How to force XMP metadata update for a thumbnail?

Hi Folks,
In a JavaScript in Bridge CS3, I'm updating a value in the XMP metadata for a Thumbnail. Later in the script I want to read the updated XMP metadata information from the Thumbnail, but often Bridge hasn't updated the metadata by the time I read it. In other words, my script reads the value prior to the update. I'm guessing there's a caching issue going on.
I'm new to Bridge scripting, and I am hoping someone here can offer suggestions on how I can (or, even *if* I can) force Bridge to update the XMP metadata cache for a file so that when I read it later in the script it will reflect the recent changes. I've tried using Thumbnail.refresh(), but that doesn't seem to do the trick. I don't mind a slower script, I just want to be able to read the correct value.
Thanks in advance for any help!
-- Jim

Hi David,
I'm running this script on a MacBook Pro, 2.5GHz, 4GB RAM.
Here is a sample JSX that shows the issue I'm having:
#target "bridge-2.0"
main();
function main() {
    if( xmpLib == undefined ) {
        var pathToLib = Folder.startup.fsName + "/AdobeXMPScript.framework";
        var libfile = new File( pathToLib );
        var xmpLib = new ExternalObject("lib:" + pathToLib );
    var myValue = "Headline Test";
    var myFilePath = "~/Desktop/TestFile.tif";
    var curHeadlineStr = XMPGetHeadline(myFilePath);
    $.writeln("Headline value: \"" +  curHeadlineStr + "\"");
    XMPWriteHeadline(myFilePath, myValue);
    // *** I would like to refresh the cache here ***
    curHeadlineStr = XMPGetHeadline(myFilePath);
    $.writeln("Headline value: \"" +  curHeadlineStr + "\"");
function XMPGetHeadline(theFilePath) {
    var thumb = new Thumbnail(File (theFilePath) );
    md = thumb.synchronousMetadata;   
    xmp = new XMPMeta(md.serialize());
    var myHeadlineXMPProp = xmp.getProperty
        (XMPConst.NS_PHOTOSHOP, "Headline", XMPConst.STRING);
    return myHeadlineXMPProp;
function XMPWriteHeadline(theFilePath, theTextStr){
    var thumb = new Thumbnail(File (theFilePath) );
    md = thumb.synchronousMetadata;   
    xmp = new XMPMeta(md.serialize());
    var myOrigHeadlineXMPProp = xmp.getProperty
        (XMPConst.NS_PHOTOSHOP, "Headline", XMPConst.STRING);
    xmp.deleteProperty(XMPConst.NS_PHOTOSHOP, "Headline");
    xmp.setProperty(XMPConst.NS_PHOTOSHOP, "Headline", theTextStr, 0, XMPConst.STRING);
    var updatedPacket = xmp.serialize
        (XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
    thumb.metadata = new Metadata(updatedPacket);
To run this script, in main(), set the myFilePath variable to the path of a file that has an "IPTC Code" "Headline" property.
This script, when run, sets the "Headline" property value to the value of myValue. After runing the script for the first time, take a look at the console log. You should see that Headline value displayed does not change between the two console entries. My log looks like this after the first run:
  Headline value: "undefined"
  Headline value: "undefined"
The thing is, the second entry in the console listing, above, was created after the Headline value was set by XMPWriteHeadline(). The two values should be different between the two console entries.
If you run the script a second time against the same file, you will see that the Headline value does contain the value that was written in the first run of the script--it just took some time to update the cache, I'm guessing. Here's the second run's log:
  Headline value: "Headline Test"
   Headline value: "Headline Test"
So, what I'm looking for is a way to insert code (where the comment line "//*** I would like to refresh the cache here ***" appears), to force Bridge CS3 to refresh its cache so that when I call XMPGetHeadline() after calling XMPWriteHeadline(), the Headline value will return the value that was just written.
I hope this is clear enough...
Thanks!!!!
-- Jim

Similar Messages

  • How to Force enable, silent updates for Adobe flash in windows 8

    How to Force enable updates, silently for Adobe flash in windows 8 using group policy?
    I have followed this Article:
    http://helpx.adobe.com/flash-player/kb/administration-configure-auto-update-notification.h tml
    http://gpyall.com/archives/disable-adobe-flash-updates-on-64-bit-windows-with-group-policy /
    This looks promising but not working.
    Also, I cannot even manually create a file, in Win 8  (C:\Windows\SysWOW64\Macromed\Flash)
    So how would group policy can put mms.cfg in this location with following vaule:
    AutoUpdateDisable=0
    SilentAutoUpdateEnable=1
    Thanks in Advance.

    You will find more information in http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/flashplayer/pdfs/flas h_player_11_7_admin_guide.pdf

  • How to import XMP metadata in pdf

    Could you please explain me, how to import XMP metadata in pdf file through "Live Cycle ES"?

    Yes, with LiveCycle ES (almost) all services can be invoked from any of the available endpoints (watch folder, EJB, WebService, etc).
    In this case since the ImportXMP requires two input files (the PDF and the XMP) you will need to drop a directory containing both of your files into the watch folder (not the individual files). This is because several requests can be dropped into the watch folder at the same time and without the sub directories LiveCycle couldn't tell what XMP when with what PDF.
    A com.adobe.idp.Document - AKA: Document - object is one of the common object types used across all LiveCycle products. When you deal with PDFs and many other binary file objects they are stored a Document object. It is more important that you know this when using Workbench, web services or the Java API.
    You should have a look at the documentation at: http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/001553.html

  • How to import XMP Metadata?

    Could you please explain me, how to import XMP metadata in pdf file through "Live Cycle ES"?

    > Please give any samples.
    As I said, the samples are in the API Reference. All you have to do is look them up.

  • How do i install firmware updates for time capsule?

    How do I install firmware updates for time capsule?

    If you are using the Lion or Mountain Lion operating system on your Mac.....
    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click on the Time Capsule icon
    A message will be displayed if there are any available updates. Click to update if that is the case.
    If you are using the Leopard or Snow Leopard operating system......
    Open Macintosh HD > Applications > Utilities > AirPort Utility
    Click on the Time Capsule icon, the click Manual Setup
    Click on the word Version (3rd line on the page) and any available updates will be displayed. Click on Update to proceed.

  • Does anyone know how often camera raw is updated for new cameras I have a nikon D750

    HI, I was wondering how often camera raw is updated for new cameras as I have just got a Nikon D750 and at present cannot adjust raw files

    Thanks for the image sample, bsailus. I am also unable to open the file.
    A couple of questions.
    How did you import the image (Nikon transfer, Adobe Photo Downloader, etc.)?
    What was the in-camera quality setting for the image (NEF (RAW), Lossless compressed, 12-bit, 14-bit, etc.)?
    Thanks!
    - Chris

  • How do I STOP automatic updates for firefox & thunderbird?

    How can I STOP automatic updates for firefox & thunderbird?

    Go to Tools > Options, Advanced, Update.
    Under "automatically check for updates," uncheck the box next to Firefox.
    Then click the button next to "ask me" under
    "[[https://support.mozilla.com/en-US/questions/872089 When updates to Firefox are found]]"
    If you don't see anything, wait eleven minutes and try again.

  • HT1311 My account registered in Malaysia, but currently I'm in Indonesia and using local sim card, how could i download an update for any application purchased?

    My account registered in Malaysia, but currently I'm in Indonesia and using a local provider sim card, how could i download an update for any application purchased in my iPhone?

    Apple takes a few days to bill your credit card. By removing to information the next day Apple could not bill you therefore creating the predicament your in. Try contacting iTunes support so they can help you resolve the issue.
    http://www.apple.com/support/itunes/

  • How do i get iOS updates for my ipad?  I never received an automatic update for it.

    how do i get iOS updates for my ipad?  I never received an automatic update for it.

    The option to update without the computer (Over the air) was made available with iOS 5. If your iDevice is using a version of iOS lower than 5, you will need to use iTunes on your syncing computer to perform the upgrade. Use the Apple link below as a guide for the upgrade.
    http://support.apple.com/kb/HT4972
    Also read the instructions from the section entitled "Update your device using iTunes" at the link below.
    http://support.apple.com/kb/HT4623
    Information regarding transferring purchases from your iDevice to iTunes on your syncing computer can be found at the link below.
    http://support.apple.com/kb/ht1848

  • How to get XMP MetaData as an XML String in a process?

    Hi there,
    I have a process where I would like to export a documents XMP MetaData, manipulate the XMP MetaData and then import the MetaData again to the document.
    I thougt first I will use the service Name "XMPUtilityService" with the Service Operation "Export XMP" to export the XMP MetaData as a document.
    Hoewer I am not sure how to manipulate the output document from the Export XMP service.
    When I print out the document.toString() in a execute Script Service I get the following:
    <document state="active" senderVersion="0" persistent="false" senderPersistent="false" passivated="false" senderPassivated="false" deserialized="false" senderHostId="null" callbackId="0" senderCallbackId="0" callbackRef="null" isLocalizable="true" isTransactionBound="false" defaultDisposalTimeout="600" disposalTimeout="600" maxInlineSize="65536" defaultMaxInlineSize="65536" inlineSize="3440" contentType="null" length="-1"><cacheId/><localBackendId/><globalBackendId/><senderLocalBackendId/><senderGl obalBackendId/><inline><?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
    <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="A...</inline><senderPullServantJndiName/><attributes/></document>
    Actually I expected something like this:
    <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
    <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.0-jc006 DEBUG-1.0, 2009 Jun 23 11:07:21-PDT">
       <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
          <rdf:Description rdf:about=""
                xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
             <pdf:Producer>Adobe LiveCycle PDF Generator ES2</pdf:Producer>
          </rdf:Description>
          <rdf:Description rdf:about=""
                xmlns:xmp="http://ns.adobe.com/xap/1.0/">
             <xmp:ModifyDate>2010-04-20T20:43:59+02:00</xmp:ModifyDate>
             <xmp:MetadataDate>2010-04-20T20:43:59+02:00</xmp:MetadataDate>
          </rdf:Description>
          <rdf:Description rdf:about=""
                xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
             <xmpMM:DocumentID>uuid:0cf2c6c6-2fba-2b39-5fb6-33ad8ccf58aa</xmpMM:DocumentID>
             <xmpMM:InstanceID>uuid:187bc5a2-acb0-2fa9-711d-33ad8ccf58aa</xmpMM:InstanceID>
          </rdf:Description>
       </rdf:RDF>
    </x:xmpmeta>
    <?xpacket end="w"?>
    What do I need to do to get the XMPMeta data as an XML String from a document within a process?
    Thanks in advance!
    Paul

    Hi,
    thanks for the answer.
    I know that I can retrieve the XMPUtilityMetadata object, but this object provides only access to a few information suche as creator, subject, producer, etc.
    However I would like to retrieve the whole XML String of the XMP Metadata.
    How is this possible?
    Thanks.
    Paul

  • [CS3 JS] How To Access Custom Metadata?

    I have InCopy documents that contain custom XMP metadata in two namespaces, Dublin Core and PRISM, e.g.:<br /><br />    ...<br />    <rdf:Description<br />      rdf:about=""><br />      <dc:format<br />        xmlns:dc="http://purl.org/dc/elements/1.1/">application/x-incopy</dc:format><br />      <dc:title>Chickens and You</dc:title><br />    </rdf:Description><br />    <rdf:Description<br />      rdf:about=""><br />      <prism:publicationName<br />        xmlns:prism="http://prismstandard.org/namespaces/basic/1.2/"<br />        >Poultry Daily</prism:publicationName><br />    </rdf:Description><br />    ...<br /><br />In my JavaScript, I can access the Dublin core values but cannot access the PRISM values and I'm not sure why not.<br /><br />For example, I have this:<br /><br />doc = app.activeDocument;<br />metadata = doc.metadataPreferences;<br /><br />namespaces["dc"] = "http://purl.org/dc/elements/1.1/";<br />namespaces["prism"] = "http://prismstandard.org/namespaces/basic/1.2/";<br /><br />$.writeln("dc:title=" + <br />     metadata.getProperty(namespaces["dc"], <br />          "title/*[1]"))<br />// Returns expected result "Chickens and You"<br /><br />$.writeln("prism:publicationName=" + <br />     metadata.getProperty(namespaces["prism"], <br />          "publicationName/*[1]"))<br />// Returns unexpected empty result, should be "Poultry Daily".<br /><br />If I do metadata.save() I see the PRISM metadata in the saved result:<br /><br />     <rdf:Description rdf:about=""<br />            xmlns:prism="http://prismstandard.org/namespaces/basic/1.2/"><br />         <prism:publicationName>Poultry Daily</prism:publicationName><br />     </rdf:Description><br /><br />So I'm sort of at a loss but I suspect that I don't really understand what the path value should be--I haven't been able to find any clear documentation on what the path is addressing or how its actually interpreted.<br /><br />What am I missing or doing wrong?<br /><br />Thanks,<br /><br />Eliot

    [email protected] wrote:
    > Dude, I started that thread :-)
    Missed that. It's been a long week.
    The problem is this line (probably).
    metadata.getProperty(namespaces["prism"], "publicationName/*[1]")
    You apparently copied the syntax from dc:title in the previous line. dc:title is
    an 'Lang Alt' kind of property which is, effectively, an array. Your
    prism:publicationName is a simple value property. I suspect that the "[1]"
    syntax (and possible the "/*" before it) are what's causing problems.
    I don't recall seeing docs for this either.
    -X

  • [CS3] the file cannot store XMP metadata

    Hello,
    I want to add some metadatas like keywords and description to my video files (raw avi and mpg). It works for most of them in bridge but some will not accept any changes. I get the following error message: "xxx.avi cannot store XMP metadata. No changes will occur." Even so all the video files have been recorded during the same session (no visible differences between the files), some of them work, some do not work.
    Do you know a known problem with embemdding XMP into video files? Or if the problem comes from Bridge, how can I do?
    Thanks to everyone who could help me.
    Steeven
    from France

    Clear the cache in preferences.

  • How to force LR to update previews in bulk

    hi all,
    is there a method or setting to force LR4 to update the prewies in "bulk", means outside of the grid too?
    problem is that when applying development changes on image sequences with hundreds of images, or even a smaller bunch of images LR4 only shows the applied changes in the current grid view.
    for updating the previews one has to go back and forth in preview by hand. this seems a bit stone age and can take a while.
    this was never a problem in bridge, which - although it took its time to create ALL previews - afterwards allowed for quick scrolling trough images with all previews generated. this was especially good for watching stop-motion movies and applying xmp RAW development changes.
    for LR4 RC3, this would be a nice option to have... classic, like it is now, and a "force update previews outside grid view" with a true progress indicator / counter, like with bridge.
    an example where we started using lightroom during production and ran exactly into the problem of slow / missing preview updates after applying batch XMP / development changes can be seen here (about 32000 raw files processed, 7500 used for the film)
    http://www.astronomerswithoutborders.org/news/1066-astronomers-paradise-is-a-journey-for-e veryone.html
    or here on NAT GEO
    http://newswatch.nationalgeographic.com/2012/02/21/new-time-lapse-gives-rare-glimpse-at-at acamas-starry-nights/
    any info or idea would be appreciated. systems used are current Macs with OSX 10.6.8 and Lion 10.4.7.
    thanks
    chris

    hi dorin,
    I don't have that. but I found:
    lightroom>preferences>file handling>import DNG creation>JPG preview - none, medium, full size (with "embed fast load data", "embed original raw file")
    lightroom>preferences>catalog setting> standard preview size/preview quality/automatically discard 1:1 previews...
    also "camera raw cache settings" could be interesting? in preferences>file handling
    cheers
    c

  • How to read XMP metadata of an indd file using Actionscript

    Hi All,
    I am trying to read XMP metadata of an indd file using CS Extension Builder in Flash Builder 4.5.
    The documentation has many class like XMPmeta, XMPStruct, etc.
    I have got the currently opened document in InDesign as follows:
    var myDoc:Document = InDesign.app.activeDocument();
    And a new XMPmeta object is created as follows:
    var myXMP:XMPMeta = new XMPMeta();
    How to initialize document's xmp metadata in the XMPMeta object? Or is there any other way to get the XMP metadata of currently opened document in InDesign?

    I have found that the XMP data of an InDesign document can be retrieved in actionscript as follows:
    InDesign.app.activeDocument.metadataPreferences
    This returns the MetadataPreference object.
    But I am not able to iterate each namespace in the xmp. There isn't any XMPFile class which allows me to serialize the object to xml file so that I can iterate all elements in the XMP.
    I could not relate class like XMPMeta, XMPProp, etc. with the MetaDataPreference class. So, how to obtain the entire xmp packet from the MetadataPreference object?
    Can anyone shed light on this?

  • How to remove xmp metadata?

    I need to remove the "XMP metadata" information in the tiff(photoshop) files via scripting. Is it possible? Kindly advice me. Please provide examples.
    Thanks for looking into this..
    Regards,
    Maria Prabudass

    This will remove as much metadata that is possible by using scripting, anything else you need ExifTool.
    #target photoshop
    var f = File(Folder.desktop + "/example.tif");
    removeMetadata(f);
    function removeMetadata( file){
    if ( !ExternalObject.AdobeXMPScript ) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
            var xmpf = new XMPFile( File(file).fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE );
            var xmp = xmpf.getXMP();
            XMPUtils.removeProperties(xmp, "", "", XMPConst.REMOVE_ALL_PROPERTIES);
          if (xmpf.canPutXMP( xmp )) {
             xmpf.putXMP( xmp );
          xmpf.closeFile( XMPConst.CLOSE_UPDATE_SAFELY );
    The only other way is to save for web, open the file again and save as a tif.

Maybe you are looking for

  • Help me, why Oracle Application raised error:no such trigger.

    Dear friend, I have developed a form program in FORMs 6I, and it works in my ORACLE APPLICATIONS ,but after it is installed in another Server,it popup the error windown, it said : FRM-40700:No such trigger:menu_to_appcore. I don't know why, somebody

  • Narrated slide shows; best delivery format?

    If I want to deliver narrated slide shows to 5G video iPods and 4G photo iPods, what is the best format, producing the most compact size? (e.g. maintain still images as still images, and not as motion video) Also, I have heard that Enhanced Podcasts

  • How can you change the default setting for the alarm for new events?

    When I create a new Event, it will create an alarm that will activate 15 minutes before the event. I'd like to change the settings so the default setting would be that when I create a new event it will activate 1 day before the actual event. Is it po

  • Automatic selection of paper tray

    I have my printer set up to automatically  select the tray with paper, if one tray is empty. It does not work.  In the settings on the printer, I have Tray 1 as default, and no lock on.  In the printer settings in Windows, it says that the second tra

  • Wireless Security... Am I doing it right.

    Pls bear with me, I'm a wireless n00b. Ok I'm using a Netgear D834DG with a pipex broadband connection and my PB with Airport Exreme. In the airport menu, there are other networks available (presumably from the flats around me). I have set up somethi