5 Replies Latest reply on Jul 16, 2016 8:49 AM by JJMack

    Saving The Work Via Scripting

    Vfxvenkat98

      Hi,

           I need to Save the current work path in Photoshop as soon as the last anchor point is closed by automatically in the tiff document.Need some help to save all the paths i have created in a document.So that i can use it for later selections.Please tell me the solution as soon as possible.

       

      Thanks,

      Venkatesh.

        • 1. Re: Saving The Work Via Scripting
          JJMack Most Valuable Participant

          I think once you create a work path  you want to be able to use later on all you need to do is rename the work path to keep it with a name you know. If you want to do this more than one in a document  you would need to come up with some way to generate unique names for each rename to avoid path with duplicate names.

           

          This Action Manager code may work for you.

           

          fubction RenameWorkPath(name) {

          // =======================================================

          var idslct = charIDToTypeID( "slct" );

              var desc44 = new ActionDescriptor();

              var idnull = charIDToTypeID( "null" );

                  var ref16 = new ActionReference();

                  var idPath = charIDToTypeID( "Path" );

                  var idWrPt = charIDToTypeID( "WrPt" );

                  ref16.putProperty( idPath, idWrPt );

              desc44.putReference( idnull, ref16 );

           

          var idMk = charIDToTypeID( "Mk  " );

              var desc48 = new ActionDescriptor();

              var idnull = charIDToTypeID( "null" );

                  var ref18 = new ActionReference();

                  var idPath = charIDToTypeID( "Path" );

                  ref18.putClass( idPath );

              desc48.putReference( idnull, ref18 );

              var idFrom = charIDToTypeID( "From" );

                  var ref19 = new ActionReference();

                  var idPath = charIDToTypeID( "Path" );

                  var idWrPt = charIDToTypeID( "WrPt" );

                  ref19.putProperty( idPath, idWrPt );

              desc48.putReference( idFrom, ref19 );

              var idNm = charIDToTypeID( "Nm  " );

              desc48.putString( idNm, name);

          executeAction( idMk, desc48, DialogModes.NO );

          }

          • 2. Re: Saving The Work Via Scripting
            Vfxvenkat98 Level 1

            Thank You Very much JJMack,

                 "But i want my pen tool paths to be saved automatically and renamed with any names when the path closes.

                 If it is Possible Please send me the full code.So i can use it. Because i am new to Scripting."

            • 3. Re: Saving The Work Via Scripting
              JJMack Most Valuable Participant

              You may be able to dream up something for your work flow.  The thing is the pen tool can be used on any path and paths can have many closed sub paths and with the pen tool you can add more closed sub paths.  What you write may make some sense with what you are doing in your work flow.  It is not something that would useful for most if fact it may be very disruptive.

               

               

              I have not tried to add events the that you can trigger a script to run when they occur.  You may want to look into the script event manager. You seem to want a script to run any time the pen tool closes a path or sub path.

               

               

              IMO you would most likely be better off with a script that generate a unique name and renames the workpath to that name.  Assign a shortcut key to that script and use that shortcut when you want a particular workpath saved.

              • 4. Re: Saving The Work Via Scripting
                Vfxvenkat98 Level 1

                Could you please send the script to do this and tell me how to assign a shortcut key for a script.

                • 5. Re: Saving The Work Via Scripting
                  JJMack Most Valuable Participant

                  Scripts need to be designed and written I have know Idea of what your workflow is or what you want programmed for it. If you want a custom script it is your job to design and code it. Adobe Photoshop Scripting | Adobe Developer Connection