2 Replies Latest reply on Jul 30, 2010 10:32 AM by Gustavo Del Vechio

    Display the filed instructions (that´s under IPTC Core metadata).

    Gustavo Del Vechio Level 3

      Hi all

       

      I´m new on programing scripts in Photoshop..and tried everything but was not able to change the script below. Let´s explain this script is found at Adobe Photoshop default folder and works to show the Camera Model used to the current image.

       

      Now..the challenge...I want to change the scripts so when you run the it shows a field called Instructions (that´s located in the IPTC Core XMP metadata Tab. (In Photoshop > open an Image > go to File menu > File Info option and see the IPTC Core Tab > Instruction field).

       

      Can anyone please help me to change this lines. It could look very simple for you but it´s actually very difficult to me; This base-script is what I have and works fine to display the camera model:

       

      try {

           var xmpString = activeDocument.xmpMetadata.rawData.toString();

           var tiffModelLength = ('<tiff:Model>').length;

           var tiffModel = xmpString.search( '<tiff:Model>' );

           var tiffModelEnd = xmpString.search( '</tiff:Model>' );

           var tiffModelStr = xmpString.substr( tiffModel + tiffModelLength, tiffModelEnd - tiffModel - tiffModelLength );

       

           if ( tiffModelStr.length > 0 ) {

                alert( tiffModelStr + localize ( '$$$' ) );

           }

       

           // check the exif

           var exifModelStr = '';

           var exifData = activeDocument.info.exif;

           for ( var i = 0; i < exifData.length; i++ ) {

                if ( exifData[i][0] == 'Model' ) {

       

                }

       

           }

       

      } // try end

       

      catch( e ) {

      // always wrap your script with try/catch blocks so you don't stop production

      // remove comments below to see error for debugging

      // alert( e );

      }

       

       

       

       

      ---
      Thank you a lot for any help.
      Gustavo.