Skip to main content
evan71922978
Known Participant
September 18, 2015
Answered

Choose the texte file calling the DataMerge Script

  • September 18, 2015
  • 1 reply
  • 391 views

I have to write a script who call the DateMerge script, I have find how to du it ( using:  app.activeDocument.dateMergeProperties.mergeRecords(); ).

But problem : the scipt call  the DataMerge script but use it with the last texte file I've use.

I would like chose the text file when I call the DataMerge script.

I hope you have understand my question, I'm not a pro in English :S

Tank you for your help

This topic has been closed for replies.
Correct answer Colin Flashman

It's in the same line. The location for the merge goes in the brackets that immediately follow the mergeRecords() e.g.

app.activeDocument.dateMergeProperties.mergeRecords(FILELOCATIONGOESHERE);

This does not have to be one file location written out in full either, it can be a variable that has been declared elsewhere e.g.

var csvFile = File.openDialog('select TXT file');

app.activeDocument.dateMergeProperties.mergeRecords(csvFile);

Colin

1 reply

Colin Flashman
Community Expert
Colin FlashmanCommunity ExpertCorrect answer
Community Expert
September 19, 2015

It's in the same line. The location for the merge goes in the brackets that immediately follow the mergeRecords() e.g.

app.activeDocument.dateMergeProperties.mergeRecords(FILELOCATIONGOESHERE);

This does not have to be one file location written out in full either, it can be a variable that has been declared elsewhere e.g.

var csvFile = File.openDialog('select TXT file');

app.activeDocument.dateMergeProperties.mergeRecords(csvFile);

Colin

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!