Ok this is strange. During validation the js engine creates the
necessary temp file. But during composition it errors out at line 26:
FWIW FP ver:5.1P2b
//code block
newfilename = FusionPro.Composition.inputFileName;
orginputfilename = newfilename;
var i;
// Find last backslash in file name & replace with other.
var temp = "/Users/rjmolesa/temp/BizCard-Blank/tempout.txt";
// The following line is only needed during validation & preview
if (orginputfilename=="")
{
orginputfilename =
"/Users/rjmolesa/temp/BizCard-Blank/Instance.TXT";
}
orginputfilename = "/Users/rjmolesa/temp/BizCard-Blank/Instance.TXT";
var sf = new ExternalDataFile(orginputfilename, "\t");
var of = new File(temp);
//var of = new CreateResource(temp, "plain text file", true);
//of.remove();
// tries to create the temp file if it doesn't exist
if (of.open("create") == false)
{
print("Could not write output file.");
}
of.close();
// tries to write to the temp file
if (of.open("write") == false)
{
print("Could not write output file.");
}
// writes the labels to the temp file
for (i=0;i<sf.records[0].length;i++)
{
if (i>0)
of.write("\t");
of.write(sf.records[0][i]);
}
of.write("\r\n");
// writes the data to the temp file
for (i=0;i<sf.records.length;i++)
{
startval = 1;
repeatcount = Int(sf.GetFieldValue(i, "Repeat Count"));
for(j=0;j<repeatcount;j++)
{
for(k=0;k<sf.records[0].length;k++)
{
if (sf.records[i][sf.records[0].length-1] != "undefined")
{
if (k>0)
of.write("\t");
switch(sf.records[0][k])
{
case "Repeat Count":
of.write("1");
break;
default:
of.write(sf.records[i][k]);
}
}
}
of.write("\r\n");
}
}
//of.close();
//of.remove();
var jf = new ExternalDataFile(temp, "\t");
FusionPro.Composition.inputFileName =
"/Users/rjmolesa/temp/BizCard-Blank/tempout.txt";
return jf.records.length;
//end code block
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
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
--