I am wondering how to merge these 2 scripts...they each work on their own,
but when I put them together I can't get them to work...any ideas?
Script 1 Variable Graphic Box
Sig_Pic = CreateResource (Field("STYLE") + ".pdf", "graphic", true);
if (Sig_Pic.exists)
return Sig_Pic;
else {
return new FusionProResource("Blank.pdf", "graphic");
ReportWarning ("Image for " + Field("STYLE") + "not found");
}
Script 2 onRecordStart
newfilename = FusionPro.Composition.inputFileName;
orginputfilename = newfilename;
var i;
if(newfilename == "")
{
newfilename = "C:\\Documents and Settings\\PC #4\\Desktop\\Jim
Test\\output test\\set up like bcs & tn\\temp_data_file.txt";
}
partial = newfilename.lastIndexOf("\\");
newfilename = newfilename.substring(0, partial+1) + "tempout.txt";
if (orginputfilename=="")
{
orginputfilename = "C:\\Documents and Settings\\PC
#4\\Desktop\\Jim
Test\\output test\\set up like bcs & tn\\sample_run_list.txt";
}
sf = new ExternalDataFile(orginputfilename, "\t");
var of = new File(newfilename);
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");
for (i=0;i<sf.records.length;i++)
{
startval = 1;
repeatcount = Int(sf.GetFieldValue(i, "samples"));
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 "samples":
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;
--
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
--
Don't miss The Printable Technologies 2007 User Group Conference at the Monte
Carlo Resort and Casino in Las Vegas, March 14 through March 16, 2007.
For more details or to register, go to
http://www.traveltrust.com/Forms/pt_signup_2007-3.html
--
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
--