How to find out which paragraph of the document an image is in?
I have found all images in the file:
var images = app.activeDocument.stories[0].allGraphics;
Now I want to cycle through them and do some stuff including possibly moving them to the next or previous paragraph. I know the parent of an image is a Rectangle and the parent of the Rectangle is a character. Right now I have:
for (i=0; i<number_of_images; i++)
{
image = images.parent;
myPar=image.parent.paragraphs[0];
}
This gives me the actual paragraph the image is in, but I need to know the paragraphs index within the document (or story). How can I get that?