Placing a .docx document in Indesign

I am trying to place a variable text document into a a named text box in my document. I have been trying variations of this:


	tell myDocument
		set bodyPath to "Pub-TLD:Welcome Sections:2015:" & wtName & ":" & wtSTAB & "_TEXT.docx"
		set theText to every item of all page items whose label is "Body"
		tell insertion point of theText
			place bodyPath without options
		end tell
	end tell

and this:


	set wtBody to (Pub-TLD:Welcome Sections:2015:" & wtName & ":" & wtSTAB & "_TEXT.txt")
	set contents of every text frame of myDocument whose label is "Body" to wtBody

with no success.

The paths and the variables of wtName & wtSTAB are correct because earlier in the scrip it places the photos from that directory fine.

Rob

Which insertion point?

I know nothing of Indesign, but theText is a list, and lists do not have an insertion point. I think.

I would ask Indesign for its insertion point - with a document open, obviously.
The reply should tell you more.
What’s in the dictionary?

What I’m getting at is that you need to specify which insertion point:

tell insertion point 1 of theText

Nope, didn’t work.

It is giving me the error: Can’t get insertion point 1 of {text frame id 9288 of spread id 7747 of document id 2 of application Adobe InDesign CC"}

Hi. The insertion point doesn’t appear particularly relevant. I’m not sure if this matters, but the code also lacks class specificity to text frames.

tell application "Adobe InDesign CS3"'s document 1
	place ("Pub-TLD:Welcome Sections:2015:" & wtName & ":" & wtSTAB & "_TEXT.docx") on  (text frames whose label is "Body")--or possibly: (text frames whose label is "Body")'s item 1
end tell

Error “Pub-TLD:Welcome Section:2015:AK_Welcome_AK:AK_TEXT.docx” doesn’t understand the “Place” message.

The code I downloaded right from Adobe’s website (PlaceTextFileInFrame.applescript) that is for CC doesn’t even work.

That’s telling you you’re passing a list of text frames, not a single frame.