I think I got it to partially work, but when I convert it to javascript it
cuts off a half of the lines...(only 68 of 138 lines) is there a limit to
how many lines can be converted?
<?xml version="1.0" encoding="ISO-8859-1" ?>
<template_rule name="Inline Graphic Rule_STRIPPED" version="1.0"
taggedtext="true" type="text">
<rulename language="en-US">Inline Graphic Rule_STRIPPED</rulename>
<Comment language="en-US">Inserts an inline graphic that is specified in the
tagged input file.</Comment>
<Description language="en-US">Choose the appropriate values.</Description>
<fieldlist>
<field type="FIELDLIST" required="true">
<fieldname>Var1</fieldname>
<prompt language="en-US">Choose the field containing the Style:</prompt>
<value></value>
</field>
<field type="PICKLIST" required="true">
<fieldname>Var2</fieldname>
<prompt language="en-US">Choose the type of Graphic:</prompt>
<value></value>
<picklist>
<item><prompt>PDF</prompt><value>.pdf</value></item>
</picklist>
</field>
<field type="SINGLELINE" required="true">
<fieldname>Var3</fieldname>
<prompt language="en-US">Enter a Search Path:</prompt>
<value></value>
</field>
<field type="SINGLELINE">
<fieldname>Var4</fieldname>
<prompt language="en-US">Enter the image name of a default
graphic_NOT_NEEDED:</prompt>
<value></value>
</field>
<field type="FIELDLIST" required="true">
<fieldname>Var5</fieldname>
<prompt language="en-US">Choose the field containing the Quantity to be
printed:</prompt>
<value></value>
</field>
<field type="SINGLELINE">
<fieldname>Var6</fieldname>
<prompt language="en-US">Enter the name of the Runlist to be
printed:</prompt>
<value></value>
</field>
</fieldlist>
<code>
//__________________________________________________________________________________
temp = '';
var_extension = '';
has_extension = '';
TempPic = '';
if (FusionPro.isMac)
Var3 = Var3 + ":";
else
Var3 = Var3 + "\\";
for (i=0; i<Field(Var1).length; i++)
{
temp = Mid(Field(Var1), Field(Var1).length-i,1);
var_extension = temp + var_extension;
if(var_extension == ".pdf")
{
has_extension = "true";
i=Field(Var1).length;
}
else
has_extension = "false";
}
if(has_extension == "true")
{
Pic = '<graphic file="' + Var3 + Field(Var1) + '">';
TempPic = CreateResource(Var3 + Field(Var1), "graphic", true);
}
else
{
if(Var2 == ".pdf")
{
Pic = '<graphic file="' + Var3 + Field(Var1) + Var2 + '">';
TempPic = CreateResource(Var3 + Field(Var1) + Var2, "graphic", true);
}
}
//
//if (TempPic.exists)
//{
// return Pic;
//}
//
//else
//{
// return '<graphic file="' + Var3 + Var4 + '">';
//}
//
//__________________________________________________________________________________
newfilename = FusionPro.Composition.inputFileName;
orginputfilename = newfilename;
var i;
// The following line is only needed during validation & preview
if(newfilename == "")
{
newfilename = Var3 + "\\" + "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 = Var3 +"\\" + Var6;
}
sf = new ExternalDataFile(Var6, "\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;
Var5 = Int(sf.GetFieldValue(i, Var5));
for(j=0;j<Var5;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 Var5:
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;
//__________________________________________________________________________________
</code>
</template_rule>
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
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
--