Well, this one is really awesome! I was playing with finding positions of selected text, baseline and stuff, and I came to great idea! What if I want to draw polygon around selected text? Can it be done through scripting?! Well, I tried, and I think I was successful! It’s little bit complicated, but I learned a lot! So, let’s get started!
If we want to extract clipping path from InDesign GUI we simply go to Object -> Clipping Path -> Covert Clipping Path to Frame, but how to do it through scripting? Another thing is that we can’t convert multiple selected images with clipping path to frames through GUI, but you can do it through script. I will cover just converting one selected frame, but we can loop through selection and do same to every image.