0 Replies Latest reply on Nov 28, 2012 12:02 PM by Mattmcquiff

    Rewriting "Save to" add meta data tag at time of save

    Mattmcquiff Level 1

      What I am trying to achieve is this,


      When I save a file at the moment I select Save As using the shortcut keys.


      However I want to automatically add some meta data to the file every time. So I would write a simple action within photoshop.


      So File info

      then Description Tag

      Author (me) and maybe Author title (photographer)

      Then the next part of the script would be in invoke the "Save as" Command, BUT ITS IMPORTANT TO NOTE I DON'T WANT IT TO AUTOMATICALLY SAVE. it needs to jst put the prompt on the screen so that filename type etc can be filled in manually.

      Then once the script is made I can assign the keystroke CMD Shift S to this script, hide the save as function in the keyboard shortcuts/ menu items.


      Then every time I go to save it would add the meta tags I need as I work?

       

       

      This is the sort of data I want to save,

       

       

      var idsetd = charIDToTypeID( "setd" );

          var desc11 = new ActionDescriptor();

          var idnull = charIDToTypeID( "null" );

              var ref3 = new ActionReference();

              var idPrpr = charIDToTypeID( "Prpr" );

              var idFlIn = charIDToTypeID( "FlIn" );

              ref3.putProperty( idPrpr, idFlIn );

              var idDcmn = charIDToTypeID( "Dcmn" );

              var idOrdn = charIDToTypeID( "Ordn" );

              var idTrgt = charIDToTypeID( "Trgt" );

              ref3.putEnumerated( idDcmn, idOrdn, idTrgt );

          desc11.putReference( idnull, ref3 );

          var idT = charIDToTypeID( "T   " );

              var desc12 = new ActionDescriptor();

              var idCptn = charIDToTypeID( "Cptn" );

              desc12.putString( idCptn, """Description""" );

              var idByln = charIDToTypeID( "Byln" );

              desc12.putString( idByln, """Author""" );

              var idBylT = charIDToTypeID( "BylT" );

              desc12.putString( idBylT, """Author Title""" );

              var idObjN = charIDToTypeID( "ObjN" );

              desc12.putString( idObjN, """Document Title""" );

              var idCprN = charIDToTypeID( "CprN" );

              desc12.putString( idCprN, """Copyright Notice""" );

              var idURL = charIDToTypeID( "URL " );

              desc12.putString( idURL, """Copyright Info URL""" );

          var idFlIn = charIDToTypeID( "FlIn" );

          desc11.putObject( idT, idFlIn, desc12 );

      executeAction( idsetd, desc11, DialogModes.NO );}