Unable to add filename to InDesign file

Post Reply
Sean IO
Newbie
Posts: 18
Joined: Mon Dec 03, 2018 7:58 pm

Unable to add filename to InDesign file

Post by Sean IO »

I have a flow which opens and InDesign file and imports XML with Javascript, which works fine. However, after the import I have code to add a text frame that inserts the filename, this does not work. I am using the same block of code that I used from two other flows that add the filename without a problem. The other two flows do not import XML.

Could my issue be that the XML import is interfering with text frame? Or that the two working InDesign files have no existing text frame and the XML import does? I am looking for other things to try. TIA. See code below

Code: Select all

$doc.importXML( File($infile) );

$doc.pages[0].textFrames.add({geometricBounds:[706.5, 18, 728.5, 576], contents:$arg1});
freddyp
Advanced member
Posts: 1022
Joined: Thu Feb 09, 2012 3:53 pm

Re: Unable to add filename to InDesign file

Post by freddyp »

Check if the resulting file has an empty text frame. If it has, it simply means that the value of $arg1 is empty. $arg1 is the value of the "Argument 1" property, not the name of the file. If you want it to be the name of the file, you have to define "Argument 1" as a single-line text with variable with the value [Job.Name].
Sean IO
Newbie
Posts: 18
Joined: Mon Dec 03, 2018 7:58 pm

Re: Unable to add filename to InDesign file

Post by Sean IO »

I am almost positive it has something to do with the XML import. I create a new document and the filename get added no problem, but when I add the XML structure back to the document it fails again.
Post Reply