What do you mean "get the file path"?
The same path you already passed in?
Selectign the source does not create any paths. When you run .mergeRecords() that creates a document, but does not save it. You can then choose to save the document wherever you like.
A document comes with an already set source File.
I need to get that File path.
1 person found this helpful
It doesn't look like that information is exposed to scripting, so you may be stuck.
Initially I was going to suggest you could export to IDML and parse the IDML file, but it looks like that information is not preserved in IDML. (It's not preserved in INDD either, though). Though inside the IDML file, the META_INF/metadata.xml file does contain a reference to my placed file:
<xmpMM:Manifest> <rdf:Bag> <rdf:li rdf:parseType="Resource"> <stMfs:linkForm>ReferenceStream</stMfs:linkForm> <stMfs:reference rdf:parseType="Resource"> <stRef:lastURL>file:///Users/username/Desktop/abc.txt</stRef:lastURL> </stMfs:reference> <xmpMM:placedXResolution>72.00</xmpMM:placedXResolution> <xmpMM:placedYResolution>72.00</xmpMM:placedYResolution> <xmpMM:placedResolutionUnit>Inches</xmpMM:placedResolutionUnit> </rdf:li> </rdf:Bag> </xmpMM:Manifest>
though I don't think you can rely upon that information. (it also shows up in <xmpMM:Ingredients/>).
But while I was doing that, I noted I also had the choice to export to "adcf" (all lowercase). Which I had never seen before. I had some text of the story with the data merge markers highlighted. That gave me a small XML file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <acf:Connection xmlns:acf="http://ns.adobe.com/AdobeConnectionFile/1.0/"> <acf:DataSource href="file:///Users/username/Desktop/abc.txt" type="csv"/> </acf:Connection>
But I can't seem to reproduce this export a second time! Very very strange! Too bad it would be perfect for you...
That looks like the only solution...
You don't have to export file to IDML to access XMP.
You have to target "http://ns.adobe.com/xap/1.0/mm/" to be able to access data.
Hope that helps.
Yeah, but I don't think the XMP metadata is very helpful.
At best it might include the path to this file, but not in a clear
way to distinguish it from other files.