9 Replies Latest reply on May 7, 2009 2:39 AM by sudar1983_14

    Exporting to INX

    Shail672021

      Hi All,

       

      I have an indesign files in folder. I would like to export each InDesign document into inx files with same name as input document using VBscript.

       

      Can you please suggest the code or any same example for this.

       

      Thanks,
      Shail672021

        • 1. Re: Exporting to INX
          sudar1983_14 Level 2

          Hi Shail,

           

          Yaa, it is problem with export, you can give constant value

           

          Set myInDesign = CreateObject("InDesign.Application.CS3")

          myInDesign.ActiveDocument.Export 1229871136, "D:\myTestDocument.inx", False

           

          Regards,

          Sudar

          • 2. Re: Exporting to INX
            Shail672021 Level 1

            Hello Sudar,

             

            One more thing I have noticed that when i run the vb script the indesign document gets open and shows the dialog box for missing fonts and missing links and the script gets stuck at this point.

             

            I don't have much experienced with the indesign documents. however, is there any way to skip these dialog box when the script was running and the document should get exported to INX.

             

            Can you please highlight on this problem.

             

            Thanks,

            Shail

            • 3. Re: Exporting to INX
              sudar1983_14 Level 2

              Hi Shail,

               

              Can you try with the following code.

               

              Set myInDesign = CreateObject("InDesign.Application.CS3")

              myInDesign.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract

              myInDesign.ActiveDocument.Export 1229871136, "D:\myTestDocument.inx", False

               

              Regards,

              Sudar

              • 4. Re: Exporting to INX
                Shail672021 Level 1

                Hello Sudar,

                 

                I have tried with your updated code and it works fine.

                 

                I have one more query....

                 

                1)  Can it be possible to Export INX file into INDD file using VBScript?

                 

                 

                Thanks,

                Shail

                • 5. Re: Exporting to INX
                  sudar1983_14 Level 2

                  Hi Shail,

                   

                  We can't export as indd file, but we can save as indd file

                   

                  Set myInDesign = CreateObject("InDesign.Application.CS3")

                  myInDesign.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract

                  myInDesign.ActiveDocument.Save "D:\myTestDocument.indd"

                   

                  Regards,

                  sudar

                  • 6. Re: Exporting to INX
                    Shail1202

                    Hello Sudar,

                     

                    I have tried your updated code on another machine and found that it does not work for exporting indd file into inx file which shows missing fonts and missing links dialog box.

                     

                    Can u please have a look at this issue?

                     

                    Thanks,

                    Shail

                    • 7. Re: Exporting to INX
                      sudar1983_14 Level 2

                      Hi,

                       

                      myInDesign.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract;

                       

                      It will control the dialog boxes, suppose it won't do then there is no way. we have to contact with adobe engineers.

                       

                       

                      regards,

                      sudar

                      • 8. Re: Exporting to INX
                        Shail672021 Level 1

                        Hello Sudar,

                         

                        The dialogbox gets skip on one machine and on another machine it does not. Is there something wrong with the vb code below...

                         

                        Rem ExportAsINX.vbs
                        Rem An InDesign CS3 VBScript.
                        Rem Exports the active document as  .INX file.
                        Set myInDesign = CreateObject("InDesign.Application.CS3")
                        Rem User to select InDesign documents Folder.
                        Set myFileSystemObject = CreateObject("Scripting.FileSystemObject")
                        myJavaScript = "myFolder = Folder.selectDialog(""Choose a Folder""); myFolderName = myFolder.fsName;"
                        myFolderName = myInDesign.DoScript(myJavaScript, idScriptLanguage.idJavascript)
                            If myFileSystemObject.FolderExists(myFolderName) Then
                                GetFiles(myFolderName)
                            End If

                        Function GetFiles(folderPath)
                        Dim fso, fsoFolder, fsoFile
                            On Error Resume Next
                            If Err.Number <> 0 Then
                                Err.Clear
                            End If
                            Set fso = CreateObject("Scripting.FileSystemObject")
                            Set fsoFolder = fso.GetFolder(folderPath)
                            For Each fsoFile In fsoFolder.Files
                            Set myDocument = myInDesign.Open(fsoFile)
                            myDocumentName = fso.GetBaseName(fsoFile)
                            Rem Generate a file path from the folder name, the base document name
                            If NOT fso.FolderExists(myFolderName & "\" & "inx") Then
                                fso.CreateFolder(myFolderName & "\" & "inx")
                            Else
                            End If
                            myFile = myFolderName & "\" & "inx" & "\" & myDocumentName & ".inx"
                            Rem Export indd file into INX file
                            myInDesign.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract
                            Rem myInDesign.ActiveDocument.Export idExportFormat.idInDesignInterchange, myFile, False
                            myInDesign.ActiveDocument.Export 1229871136, myFile, False
                            myInDesign.ActiveDocument.Close
                            Next
                        End Function

                        • 9. Re: Exporting to INX
                          sudar1983_14 Level 2

                          Hi,

                           

                          Can you please pass constant value, it may solve you problem.

                           

                          myInDesign.ScriptPreferences.UserInteractionLevel=1699640946;

                           

                          Regards,

                          sudar