Jon, I can't follow all of the changes you're making yourself, in
addition to the ones I suggested.
So, I wrote up a version that seems to work for me, with the Frodo
Travel tutorial, using FusionPro 5.1P2b in Acrobat 8 on Mac OS X
10.5.3. The rule is below. (Some lines may be wrapped in the email.)
This version uses ExternalDataFileEx, makes it easy to specify your
repeat field name and delimiter, and gives more feedback, at both
composition and validation time. It should work on Windows too,
obviously with DOS paths. (It does require you to specify full paths;
a more robust solution which allows you to simply specify a file name
and parses the original input file name, on any platform, to get the
path is definitely possible to write, but this doesn't do that.)
DISCLAIMER: While I consider this a superior solution to the posted
example in the Knowledge Base, this is still a workaround, and the
technology upon which it relies (specifically the JavaScript File
object), should be considered deprecated and unsupported, and may be
removed in a future version of FusionPro. We will continue to
investigate a way to allow "repeat record" functionality in a more
straightforward way.
Dan
=======
// OnJobStart rule to repeat records
var RepeatFieldName = "Repeat Count"; // EDIT THIS
var FieldDelimiter = ","; // EDIT THIS ("\t" for tab-delimited)
var orginputfilename = FusionPro.Composition.inputFileName;
// For composition, the original name is set,
// and the new name must be specified as an HFS path on Mac.
// EDIT THIS
var newfilename = "Macintosh
HD:Applications:Printable:FusionPro:Tutorial:FrodoTravel:tempout.txt";
if (FusionPro.inValidation)
{
// For composition, both names must be specified as POSIX paths on
Mac.
// EDIT THIS
orginputfilename = "/Applications/Printable/FusionPro/Tutorial/
FrodoTravel/frodo-InstanceData-Repeat.txt";
// EDIT THIS
newfilename = "/Applications/Printable/FusionPro/Tutorial/
FrodoTravel/tempout.txt";
}
// DO NOT EDIT BELOW THIS LINE
var sf = new ExternalDataFileEx(orginputfilename, FieldDelimiter);
if (!sf.valid)
throw("Unable to open ExternalDataFile: " + orginputfilename);
var of = new File(newfilename);
//of.remove();
if (of.open("create") == false)
throw("Could not create output file.");
of.close();
if (of.open("write") == false)
throw("Could not write output file.");
for (var i=0;i<sf.fieldCount;i++)
{
if (i)
of.write(FieldDelimiter);
of.write(sf.GetFieldValue(0, i));
}
of.write("\r\n");
var NewInputTotalRecords = 0;
for (var i = 0 ; i <= sf.recordCount; i++)
{
var startval = 1;
var repeatcount = Int(sf.GetFieldValue(i, RepeatFieldName));
for(var j = 0; j < repeatcount; j++)
{
NewInputTotalRecords++;
for(var k = 0; k < sf.fieldCount; k++)
{
if (k)
of.write(FieldDelimiter);
switch(sf.GetFieldValue(0, k))
{
case RepeatFieldName:
of.write(startval+j);
break;
default:
of.write(sf.GetFieldValue(i, k));
}
}
of.write("\r\n");
}
}
of.close();
FusionPro.Composition.inputFileName = newfilename;
var message = orginputfilename + "\n" + sf.recordCount + " records\n\n";
message += FusionPro.Composition.inputFileName + "\n" +
NewInputTotalRecords + " records";
Print(message);
return message;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
FusionPro 5.0 Now Available!
Variable text on a curve and soft drop-shadows for variable text
LIMITED TIME upgrade offer of $299 per license for current customers:
http://fusionpro.printable.com/store/upgrade
New licenses available for $599 each at:
http://fusionpro.printable.com/store/
All FusionPro 5.0 customers to receive FusionPro 5.1 with
Adobe Acrobat 8 and InDesign CS3 support when released for FREE.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
--
Users of FusionPro Desktop have unlimited free email support. Contact Printable
Support at [EMAIL PROTECTED]
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm
--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--
--
Note: All e-mail sent to or from this address will be received or otherwise
recorded by the e-mail recipients of this forum. It is subject to archival,
monitoring or review by, and/or disclosure to someone other than the recipient.
Our privacy policy is posted on www.printplanet.com
--