We are attempting to take XML data and import into Indesign to create a job ticket.
I'm doing this with scripting in 2 steps.
//JS FILE for opening template
openTemplate() {
var curFile = File ( "/c/ProductionTickets/IndesignFiles/Production Ticket.indt" );
var curDoc = app.open( curFile );
}
openTemplate();
Then I'm running the command to import the XML file. The XML file is what is traveling in the flow.
//COMMAND JS FILE
main ()
function main () {
$doc.importXML( File($infile) );
}
This is creating an error and stopping the Indesign Configurator.
I'm new to scripting and would appreciate some help.
Import XML into an Indesign Template
Re: Import XML into an Indesign Template
I think it is better to do it the other way around. Let the InDesign file come to the InDesign configurator in the flow.
Then in InDesign you use this script.
Argument 1 in the properties is: /Path to the folder/XML_to_indesign/[Job.NameProper].xml
The XML file travels through the flow from the start, then Injects the template file (Name of that file could be in the XML) and the XML is sent to a folder on disk
You get the error because InDesign is expecting an InDesign file and it can't handle the incoming XML.
Then in InDesign you use this script.
Code: Select all
var Name_Of_File = $arg1;
$doc.importXML( File(Name_Of_File) );
The XML file travels through the flow from the start, then Injects the template file (Name of that file could be in the XML) and the XML is sent to a folder on disk
You get the error because InDesign is expecting an InDesign file and it can't handle the incoming XML.
Re: Import XML into an Indesign Template
That worked!
Thank you so much.
Thank you so much.