Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script for Batch Exporting XML from IDCS3 files

Explorer ,
Nov 10, 2010 Nov 10, 2010

Does anyone have a script they would share for batch exporting XML from IDCS3 files? I do not know anything about scripting so I do not know how to write one myself. I've also searched around and cannot find anything. I would appreciate any help with this anyone can offer.

Thanks,

Janine

TOPICS
Scripting
2.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 10, 2010 Nov 10, 2010

Load a file that has some XML in it, set everything you want in the XML export dialog and export that file. These are now the default export settings. Then run Shonky's script or mine.

Peter

Translate
Community Expert ,
Nov 10, 2010 Nov 10, 2010

http://www.kahrel.plus.com/indesign/batch_convert_cs3.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 10, 2010 Nov 10, 2010

Thank-you Peter! This script is great. Sorry to ask this but is there anyway to set the export preferences within the script? See screenshots.

Screen shot 2010-11-10 at 11.23.20 AM.png

Screen shot 2010-11-10 at 11.23.32 AM.png

Thanks again!

Janine

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 10, 2010 Nov 10, 2010

Or use below Code:

try {
     inFolderName= Folder.selectDialog ("Input Folder:");
     outFolderName= Folder.selectDialog ("Output Folder:");
     if ((inFolderName != null) && (outFolderName != null))
     {
          var idFileFolder = new Folder(inFolderName);
          var files = idFileFolder.getFiles("*.indd");
          for(myCounter = 0; myCounter < files.length; myCounter++)
          {
               var theDocument = app.open(File(files[myCounter]));
               with ( theDocument ) {
               myXMLFile = new File(outFolderName + "/" + name.replace(".indd","") + ".xml" );
               exportFile( ExportFormat.xml, myXMLFile );
               close(SaveOptions.no);
               }
          }
     }
}
catch (err ) {
}
alert("All files export");

Shonky

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 10, 2010 Nov 10, 2010

Thanks Shonky! Your script works great also. I have the same question to you about setting the export preferences. Anyway to add those to the script?

Thanks again,

Janine

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 10, 2010 Nov 10, 2010

Load a file that has some XML in it, set everything you want in the XML export dialog and export that file. These are now the default export settings. Then run Shonky's script or mine.

Peter

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 10, 2010 Nov 10, 2010

Thanks Peter! You made this task much, much easier.

Janine

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 26, 2013 Mar 26, 2013
LATEST

Hi Peter and Shonkyin,

I ran your scripts tonight, but both have the same trouble for me. You see I need to choose an xslt on export and even if I set that for the first xml export and then proceed with the rest, InDesign export doesn't remember that. Is there any way to add this to either of your scripts. I know this has been here a while, so maybe something like this has already been done.

All best,

Maureen

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines