sandig199 Posted August 31 Share Posted August 31 How do I add to the OnNewOutputFile rule to include record numbers in the output? For example: JobName-Records 1-1000, JobName-Records 1001-2000, JobName-Records 2001-3000, etc I am using FP Imposer to create 4up press sheets and setting each position into stacks of 25. And setting the composer options in Fusion Pro to output into lifts of 100 records per file. This is working fine. My file names are coming over as JobName1, JobName2... no record numbers are included. I put this into my Fusion Pro document OnNewOutputFile but it does not work at all. var recordRange = CurrentRecordNumber()+ 100;//the number of lifts FusionPro.Composition.outputFileName + "_"+ "test"+recordRange; I could not find an example on the Forum, and I truly have no idea how to do this. Can you please point me the right direction? Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted August 31 Share Posted August 31 You have to assign a value to FusionPro.Composition.outputFileName with an = var iname = GetFileName(PrimaryInputFile()).replace(".csv", ""); var range = CurrentRecordNumber() + "-" + (CurrentRecordNumber() +100); FusionPro.Composition.outputFileName = iname + "_" + range + "." + FusionPro.Composition.outputFormatExtension; This assumes the input file is a .csv, otherwise change that part. Quote Link to comment Share on other sites More sharing options...
sandig199 Posted September 1 Author Share Posted September 1 THANK YOU!!! This works! Is there a way to use the PDF file name instead of the PrimaryInputFile()? Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted September 1 Share Posted September 1 I am not aware of any way to get the template PDF name. I really wish that was a thing as I could make good use of it myself. Unless someone else knows of some way to do it you pretty much have to hardcode it in. FusionPro.Composition.outputFileName = "MyTemplateName_" + range + "." + FusionPro.Composition.outputFormatExtension; Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted September 1 Share Posted September 1 5 hours ago, sandig199 said: Is there a way to use the PDF file name instead of the PrimaryInputFile()? Sure, you can use the FusionPro.templateFileName property. I would do the whole thing like this: var iname = ReplaceFileExtension(GetFileName(FusionPro.templateFileName), ""); var range = FusionPro.Composition.outputRecordNumber + "-" + (FusionPro.Composition.outputRecordNumber + 100); FusionPro.Composition.outputFileName = iname + range + "." + (FusionPro.Composition.outputFormatExtension || "pdf"); Quote Link to comment Share on other sites More sharing options...
sandig199 Posted September 1 Author Share Posted September 1 You guys are amazing. Thank you for saving my day! Quote Link to comment Share on other sites More sharing options...
MartyrSyx Posted September 7 Share Posted September 7 On 9/1/2023 at 2:22 PM, Dan Korn said: var iname = ReplaceFileExtension(GetFileName(FusionPro.templateFileName), ""); var range = FusionPro.Composition.outputRecordNumber + "-" + (FusionPro.Composition.outputRecordNumber + 100); FusionPro.Composition.outputFileName = iname + range + "." + (FusionPro.Composition.outputFormatExtension || "pdf"); Curious. When did "FusionPro.templateFileName" become available? I may have missed it in release notes and the documentation. Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted September 7 Share Posted September 7 1 hour ago, MartyrSyx said: Curious. When did "FusionPro.templateFileName" become available? I may have missed it in release notes and the documentation. Also not listed in the Building Blocks/Objects. Makes you wonder how many other goodies are hidden in there somewhere. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted September 8 Share Posted September 8 19 hours ago, ThomasLewis said: Also not listed in the Building Blocks/Objects. Makes you wonder how many other goodies are hidden in there somewhere. This was a fairly recent addition, in conjunction with another new feature where you can bring in a different DIF file as a repeatable component. 21 hours ago, MartyrSyx said: Curious. When did "FusionPro.templateFileName" become available? I may have missed it in release notes and the documentation. Sorry, that was an oversight. I'm adding it into the Building Blocks now for FP 3.1. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.