Moving text from Document 1 to Document 2 (InDesign)

hey there,

the problem i’m having is that i want to switch from document 1 to document 2
where document 1 is my active document. I want to copy those items which i made in document 1 and paste them into page 3 of document 2 but it doesn’t seem to work.

-------- start my script ---------

tell application “InDesign 2.0.1”

tell document MasterColofon_BSname

– this would be document 1
tell page 1
set the contents of line 5 of text frame 4 to Line5
set the contents of line 6 of text frame 4 to Line6
set the contents of line 7 of text frame 4 to Line7
set the contents of line 8 of text frame 4 to Line8
set the contents of line 9 of text frame 4 to Line9
set the contents of line 1 of text frame 2 to Date1
set the contents of line 1 of text frame 1 to ColorLine1
set the contents of line 2 of text frame 1 to ColorLine2

	end tell
end tell

tell page 1 of document 1
	set myRectangle to rectangle 1
	set myTextFrame1 to text frame 1
	set myTextFrame2 to text frame 2
	set myTextFrame3 to text frame 3
	set myTextFrame4 to text frame 4
	set myGroup to make group with data {myRectangle, myTextFrame1, myTextFrame2, myTextFrame3, myTextFrame4}
end tell
select myGroup
copy

tell document varTemplateFileName

– this would be page 3 of document 2
activate
set active spread of window 1 to parent of page 3 --of document 2
set myTextFrame to make text frame with properties {geometric bounds:{“6p”, “6p”, “18p”, “18p”}, contents:“This was page 1”}
paste --myGroup

end tell

end tell
-------- end my script ----------

any good ideas?

Use:
set active document to document 2


Shane Stanley

thanks this works

just a little remark which confused me
once you script

set active document to document 2

document 2 becomes the active document so actualy document 1

and than you need to script again

set active document to document 2

because document 1 hase become document 2

kr