Paste contents in footnote in InDesign using AppleScript code

Hai all,
i am trying to insert footnote and its contents for a particular xml element in “Adobe Indesign cs2” thru apple script. But i’m facing some problem. I’m able to select the xml element and its contents and i can insert footnote for that element and i can cut that contents but i couldn’t paste this contents in footnote. I have tried with the following code:

tell application "Adobe InDesign CS2"
	tell active document
		set theRoot to (item 1 of XML elements)  
	end tell
end tell
myLoopLoop(theRoot)

property myLoLoV : {}
property myHoHoV : {}
on myLoopLoop(myElement)
	
	tell application "Adobe InDesign CS2"
		tell active document
			set moreElement to every XML element of myElement
			repeat with x from 1 to (count of moreElement)
				set em1 to item x of moreElement
				select em1
				if (name of markup tag of em1 is "informalexample") then
					set em2 to em1
					select text of em2
					tell insertion point 1 of em1
						set myfootnote to make footnote
					end tell
					
					
					tell application "Adobe InDesign CS2"
						set myselection to selection
						cut (selection of active document)
					end tell
					tell application "Adobe InDesign CS2"
						tell insertion point 1 of myfootnote
							paste into myfootnote
							set text of em2 to myfootnote
						end tell
					end tell
					
					end if
				tell me to myLoopLoop(item x of moreElement)
			end repeat
		end tell
	end tell
end myLoopLoop

Can anyone help me out to sort this problem?

Thanks

jacintha

Moving to OS X…