Import XML into Indesign to convert to PDF
Import XML into Indesign to convert to PDF
I'm trying to use a flow that will take the XML and create a document in Indesign. I have my XML file and the Indesign template. It looks like I need a script to open the Indesign file template and import the Indesign file. Can someone help me with this? I don't know scripting.
Re: Import XML into Indesign to convert to PDF
You need the following JavaScript in the InDesign configurator property Command
Then as Argument 1 you specify the name of the XML file.
The incoming jobb to InDesign is the InDesign template file and the XML is easiest picked up from a folder where Switch stored it.
Then as Argument 1 you specify the name of the XML file.
The incoming jobb to InDesign is the InDesign template file and the XML is easiest picked up from a folder where Switch stored it.
Code: Select all
var NameOfFile = $arg1;
$doc.importXML( File(NameOfFile) );
Re: Import XML into Indesign to convert to PDF
Thank you. I saw in another post you demo a simple business card flow using your csvXML tool. Can you share that flow?
Re: Import XML into Indesign to convert to PDF
Here is the document of the flow I built. I'm getting an error 'null is not an object'. Please let me know what I'm doing wrong.
Re: Import XML into Indesign to convert to PDF
Silly question... how do you get the xml info into the InDesign file? How do you create the fields?
Re: Import XML into Indesign to convert to PDF
Google XML import to InDesign.
You have to set up the template document with text fields that is tagged to receive the XML.
You have to set up the template document with text fields that is tagged to receive the XML.
Re: Import XML into Indesign to convert to PDF
I have been using this script to import xml into Indesign:
It was working fine until someone updated to Indesign 2020. Now I get this error:
"Cannot handle the request because of a modal dialog or alert is active". Can you help me make the adjustment?
Code: Select all
var NameOfFile = $arg1;
$doc.importXML( File(NameOfFile) );
"Cannot handle the request because of a modal dialog or alert is active". Can you help me make the adjustment?
Re: Import XML into Indesign to convert to PDF
It looks like there is a warning dialog open in InDesign (missing links, fonts, etc).
Open your document manually on the Switch server, you should get the same error, then fix it.
For automation, the InDesign document should open without any error or warning.
Open your document manually on the Switch server, you should get the same error, then fix it.
For automation, the InDesign document should open without any error or warning.
Laurent De Wilde, Solution Architect @ Enfocus
Re: Import XML into Indesign to convert to PDF
I opened it and there are no missing fonts or graphics.
When we first built the flow, the version of Indesign did not have an additional menu after you select the XML import. The option were check boxes at the bottom of the election window. Now there is a popup menu for the selections. That is the window we need to resolve in the script.
When we first built the flow, the version of Indesign did not have an additional menu after you select the XML import. The option were check boxes at the bottom of the election window. Now there is a popup menu for the selections. That is the window we need to resolve in the script.
Re: Import XML into Indesign to convert to PDF
When you manually import an xml in InDesign, you can disable "Show XML Import Options"
You can disable this option then save the InDesign template again.
On my side it works whether this options was checked or not, but who knows.
The first time I ran my flow (on Mac) I also got a dialog telling "osascript wants access to control Adobe InDesign 2020", just had to allow this.
You can disable this option then save the InDesign template again.
On my side it works whether this options was checked or not, but who knows.
The first time I ran my flow (on Mac) I also got a dialog telling "osascript wants access to control Adobe InDesign 2020", just had to allow this.
Laurent De Wilde, Solution Architect @ Enfocus