<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi,<br><br>I want to use Python to automate InDesign,<br>There is very little help on that subject !<br>I would like to use some of the sample scripts provided in the&nbsp; InDesign Sripting documentation,<br>So I translate them from VBScript to Python which is ok except there are some parts written in JavaScript as well :<br><br>Quote from the tutorial "Importing a graphic" :<br>""" VBScript does not have the ability to do this, so we'll use a JavaScript to get a file name.<br>We'll run the JavaScript using InDesign's DoScript feature.<br>myJavaScriptString = "var myTextFile = File.openDialog(""Choose a graphicfile"");myTextFile.fsName;"<br>Run the JavaScript using DoScript.<br>myGraphicFileName = myInDesign.DoScript(myJavaScriptString, idScriptLanguage.idJavascript) """<br><br>So my question would be :<br>- how to import a graphic into Indesign using Python Win32 ?<br>- Should I try to make the doScript command work, the following command doesn't work :<br>myGraphicFileName = myInDesign.DoScript(myJavaScriptString, language = Javascript)<br>
<br>Thanks for your help,<br><br>Regards,<br><br>Thomas<br>
<br>                                               </div></body>
</html>