Skip to main content
Participant
December 14, 2009
Question

Newbie: Placing images in a text - JS/ID CS4

  • December 14, 2009
  • 3 replies
  • 607 views

Hello,

I'm not very experienced with JavaScript an InDesign so please be patient. I tried my best but somehow I seem to be unable to get this script running the way I want to.

I've got a text which contains several images, or rather: the file-names are given in the text and I want to replace them with the actual pictures.

I did manage to extract the file-names and wrote the name into a "new File", using a for loop. So it looks like this:

               var _name=_story.paragraphs.contents;

               var _file = new File (_folder + "/img/" + _name +"");

               _story.paragraphs.place(_file);

This replaces the file-name with the image, however, the image now seems to be part of the text, so I can move it a little bit up and down but I cannot even move it to the left or to the right. This might be handy for placing the images exactly where they belong, yet it does disturb me. Especially since I now want to add captions beneath the images. I tried to use the same method for them but now I have two frames at the same place and I cannot move one of them.

Another problem is that some of the pictures don't fit into the type area. But I cannot move them upwards, because I added an objectStyle, containing text wrap information, but the text is only pushed away in a certain area, so InDesign forces me to place the image exactly at one position, otherwise the page will look very strange. However, I am unable to change this one "good" position.

I hope you understand what I mean.

My question now is: is there a way to untangle all those frames, to part the picture-frames from the text-frames/the story, so that they can be moved around freely on the paper?

I liked the way I placed the images, because now I can be assured that all the images are placed where they belong, but I would really like the possibility, to move pictures upwards, if the don't fit into the type area and I still have to add the captions.

Thanks for your help

This topic has been closed for replies.

3 replies

Mike Witherell
Community Expert
Community Expert
July 17, 2024

Version CS4 from 2008?

When was scripting introduced into InDesign? About 2003?

Mike Witherell
Community Expert
July 17, 2024

Hi Mike,

this thread is from December 2009.

At this time CS5 wasn't out, I think.

 

FWIW: No idea what @Kenety38656526kr9t was up to…

 

Regards,
Uwe Laubender
( Adobe Community Expert )

Participant
July 17, 2024

Get them believe

Robert at ID-Tasker
Legend
December 15, 2009

My question now is: is there a way to untangle all those frames, to part the picture-frames from the text-frames/the story, so that they can be moved around freely on the paper?

You need to convert InLine graphics to Anchored graphics - you can do this as local modification or you can apply ObjectStyle.

Property AnchoredObjectSettings As AnchoredObjectSetting
    read-only
    Member of InDesign.Rectangle
    An
chored object settings.


Property AnchoredPosition As idAnchorPosition
    Member of InDesign.AnchoredObjectSetting
    The position of the anchored object relative to the anchor.


Const idAnchored = 1097814113 (&H416F5061)
    Member of InDesign.idAnchorPosition
    Custom anchor position.

robin

www.adobescripts.co.uk