8 Replies Latest reply on Oct 6, 2014 4:59 AM by c.pfaffenbichler

    Delete anchor point(s)

    Ghoulfool Level 1

      I see that the Script Listener doesn't pick this up; but is it possible to delete the currently selected anchor point (path) using Photoshop Scripting?

        • 1. Re: Delete anchor point(s)
          JJMack Most Valuable Participant

          I just created a complex  path with many overlapping ellipses then selected many of the segments in the path.  Enabled the scriptlistner and then delete the selected path segments using the delete key Scriptlistener  recorded this.  However it recorded noting when I used the direct selection tool to select the dozen segment in the path for deletion..

           

           

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

          var idDlt = charIDToTypeID( "Dlt " );

          executeAction( idDlt, undefined, DialogModes.NO );

          1 person found this helpful
          • 2. Re: Delete anchor point(s)
            Ghoulfool Level 1

            Not quite what I was after. I'm sure there's a way around it - probably by finding the currently selected point (if that's accessible via scripting)

            • 3. Re: Delete anchor point(s)
              JJMack Most Valuable Participant

              I don't know Photoshop scripting.   I know I can select many segments in a path with the direct selection tool.  Photoshop shows they are selected by turning on the display of the control points and handles  on both ends of the selected segments. I can see they are selected and I can delete the segments.  The Scriptlistner records nothing as I make and only redords the delete when I delete them.  I have no idea how to get the selected control points and selected segments.  I have seen some scripts posted here that process path in the Path palette.   Perhaps if you search for those you can see hot they processed the paths. When they get the control points perhaps the some attribute to indicated if they are actively selected.  Here is what I tried to record with the scriptlistener.  Onle two things were recorded.  The play of my path action and the delete. The selections I made were not recorded but were made.

               

              The script in this thread  Re: Transferring multiple paths  had no problem duplicating that path I create into a second document.

              Capture.jpg

              1 person found this helpful
              • 4. Re: Delete anchor point(s)
                c.pfaffenbichler Level 9

                JJMack’s first post seems to be on the point – as you claim it’s not you may have described what you are actually trying to achieve ambiguously.

                Maybe posting screenshots could help illustrate the point.

                1 person found this helpful
                • 5. Re: Delete anchor point(s)
                  Ghoulfool Level 1

                  I just wanted to know if it was possible to make a keyboard shortcut (to delete points on a path)

                  • 6. Re: Delete anchor point(s)
                    c.pfaffenbichler Level 9

                    Hitting the delete-key is not sufficient?

                    • 7. Re: Delete anchor point(s)
                      Ghoulfool Level 1

                      No. There's a difference between deleting a point (with the delete key) which breaks the path and deleting an anchor point which removes it from the path (and does it's best to interpolate where the path should go with the missing point), but keeps the path unbroken

                      • 8. Re: Delete anchor point(s)
                        c.pfaffenbichler Level 9

                        As far as I can tell the only option would be to collect the info, delete, collect the changed info, then compare the two sets of path-related information, remove the whole path and create an amended path.

                        I know of no way to identify a selected pathPoint directly.


                        The Math for amending the Bezier handles may be a bit of a challenge, though.

                        1 person found this helpful