Import XML in indesign using Apple Script

Hi all,
How to import XML file into indesign using apple script code. First i have created a new document in indesign and i have given the following code. but it is not working.

tell application “Adobe indesign cs2”
tell mydocument to make document
tell mydocument
import xml from “Users:documents:sample.xml”
end tell
end tell

how to solve this problem?

Hi Jacintha,

The line in your code (tell mydocument to make document) the “tell” should be “set”. See corrected code below.

CarbonQuark


tell application "Adobe indesign cs2"
   set mydocument to make document
       tell mydocument
           import xml from "Users:documents:sample.xml"
       end tell
end tell