I went to the knowledge base and grabbed a fresh copy of the Business Card
Repeat.zip file. Open it and modified the OnJobStart rule as such:
I'm getting similar errors that I had in my modified version. The first
error is:
OnJobStart, line 31: Error: File operation open failed
and a similar error around 38..
I did doubled checked that the folder is chmod 777 just to be sure.
Referencing the Mozilla docs on File() I changed it to use of.canWrite
That took care of the those file errors.
It now makes it to line 43 and kicks out this error:
OnJobStart, line 43: TypeError: sf.records[0] has no properties
sf is a reference to the original input file. This is where I began
modifying all the code to use the newer ExternalDataFileEx rather than
ExternalDataFile. This way I can use the properties of sf.recordCount.
I also modified the print commands to be Print since javascript is case
sensitive. The only other change I made was just a file name passed the
File(). The moz docs state that without the path it'll use the current
directory. This should simplify things a bit, assuming FP runs the js
in the curdir.
I'm back to square one. Any thoughts?
--------------
if (FusionPro.inValidation)
return;
newfilename = FusionPro.Composition.inputFileName;
orginputfilename = newfilename;
var i;
// The following line is only needed during validation & preview
if(newfilename == "")
{
newfilename = "tempout.txt";
}
newfilename = "tempout.txt";
// The following line is only needed during validation & preview
if (orginputfilename=="")
{
orginputfilename = "MacOSX:Users:rjmolesa:temp:Bisiness Car
Repeat:Instance.TXT";
}
sf = new ExternalDataFile(orginputfilename, "\t");
var of = new File(newfilename);
//of.remove();
if (of.canWrite == false)
{
Print("Could not write output file.");
}
//of.close();
if (of.canWrite == false)
{
Print("Could not write output 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");
//of.write("Service Advisor,Start Tag Number,Number of Tags,Service
//Advisor Picture,Service Advisor Oval Graphic\r\n");
for (i=0;i<sf.records.length;i++)
{
//startval = Int(sf.GetFieldValue(i, "NUMBERING FROM"));
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 "NUMBERING FROM":
//of.write((startval+j));
//break;
case "Repeat Count":
of.write("1");
break;
default:
of.write(sf.records[i][k]);
}
}
}
of.write("\r\n");
}
}
of.close();
FusionPro.Composition.inputFileName = newfilename;
return sf.records.length;
--
Jon Molesa
[EMAIL PROTECTED]
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
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
--