2 Replies Latest reply on Mar 26, 2015 7:29 PM by barbarae

    simulating named points


      Hi, I have some polygons (which I draw manually) that have some points that serve specific functional purposes in my scripts--eg a rotation point, a location for other points to move to, etc.  I have been finding them by running through all the polygon's pathPoints to find the highest point, the point that is highest among the leftmost set of points, etc.  it would be much preferable if I could name these points when I created the polygons, and then just retrieve them by name in the scripts.  But the pathPoint object doesn't have a name property.


      I've thought of creating a polygon of a single point that lies overtop of the point I want to name, and naming the polygon.  The problem there is making sure the polygon always moves with its point. If I group them together, apparently I can't do pathfinder operations on the group.  Similarly, I can make a javascript associative array that maps between a name and the coordinates, but it won't automatically be updated when the point moves.


      Has anyone found an elegant hack to simulate named points in indesign scripts?


      Thanks in advance!



        • 1. Re: simulating named points
          Peter Kahrel Adobe Community Professional & MVP

          No, path points are neglected beasts. I've not found a way to get an easy handle on them.

          A problem I came across is that if you select one, app.selection[0] doesn't return the point (but the polygon, I think--not sure now).

          And the person responsible for the naming of the script properties did a bad job: leftDirection and rightDirection are silly because it dependes which way you're looking. Why they didn't use the more standard and unambiguous incoming and outgoing is beyond me. End of rant.



          • 2. Re: simulating named points
            barbarae Level 1

            Yes, I noticed that nasty behavior of app.selection[0].  It's as if there's no such thing as the direct selection tool....grrr.


            I agree about leftDirection and rightDirection. I haven't done much with them yet, so I don't have horror stories with them yet.