I have not been able to get this sample to work yet I am using Fusion Pro
5 on the Mac. The sample is setup for a PC and I know the path structure
is different for the Mac. I have changed the path in the script as
follows:
newfilename = FusionPro.Composition.inputFileName;
orginputfilename = newfilename;
var i;
// The following line is only needed during validation & preview
if(newfilename == "")
{
newfilename = "/Users/admin/Desktop/Jobs/Business Card
Repeat/temp_data_file.txt";
}
// Find last backslash in file name & replace with other.
partial = newfilename.lastIndexOf("\\");
newfilename = newfilename.substring(0, partial+1) + "tempout.txt";
// The following line is only needed during validation & preview
if (orginputfilename=="")
{
orginputfilename = "/Users/admin/Desktop/Jobs/Business Card
Repeat/Instance.TXT";
}
sf = new ExternalDataFile(orginputfilename, "\t");
var of = new File(newfilename);
//of.remove();
if (of.open("create") == false)
{
print("Could not write output file.");
}
of.close();
if (of.open("write") == 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;
When I save the rule I get the following message:
Expressions OK
Return value(ignored at composition time):8
The rule saves fine, but when I compose the job I get only two pages and
the following message in the log:
OnJobStart, line 50: TypeError: sf.records[0] has no properties
Job started 10:01:09 - 1219399269.
Creator: FusionPro(TM) Desktop 5.1P2b
/Users/admin/Desktop/Jobs/Business Card Repeat/BizCard-Blank.dif
Font assets file is not found. Only system fonts will be used for this
job.
Begun composing record #1
Begun composing record #2
Job ended 10:01:10 - 1219399270.
I would to figure this one out as I have a job that would benefit from it
in a big way.
Thanks,
Richard.
Transcontinental
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
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
--