1 Reply Latest reply on Oct 20, 2009 2:06 PM by Peter Kahrel

    CS3_VBS/JS - how to daclare needed path?


      For placing picture I use:

      Set myInd = CreateObject("InDesign.Application.CS3")
      Set myDoc = myInd.ActiveDocument
      Set mSel = myInd.Selection(1) ' selected frame


      '' now i'd like dialog opens the folder, where document is


      mPath = myDoc.FilePath ' my path with active document


      ''' how to say about mPath to javaScript?

      myJavaScriptString = "var myTextFile = File.openDialog(""Choose a graphicfile"");myTextFile.fsName;"
      Rem Run the JavaScript using DoScript.
      MyValue = myInd.DoScript(myJavaScriptString, idScriptLanguage.idJavascript)

      ''' here dialog opens last used folder, but not current doc folder


      Set myPic = mSel.Place(MyValue, True)