Jump to content

Adding field to output file name


Dmiller35

Recommended Posts

Hello,

 

I use FusionPro to create a lot of variable Business Cards. A lot of times these will be multiple lots with various quantites. I'm pretty sure I've seen a post that mentioned doing exactly what I need but now I can't find it.

 

What I'd like to do is have the files output as: "Company_Bcard"_"nameoncard"_"today'sdate"_.pdf

 

So using my own info it would be, "trevetts_bcard_Dan Miller_20200208.pdf"

 

Is this possible? If so, is it possible to make this script active only when multiple output is selected? For example, we usually generate proofs before it goes to print. I'd like for the proof file to contain all records but then output to separate files when when they're ready to go to print.

Link to comment
Share on other sites

In the New Rule dialog, under Event, select OnNewOutputFile, and do this:

if (FusionPro.Composition.JobOptions["OutputSource"] != "onefile"
   && FusionPro.Composition.JobOptions["RecordsPerChunk"] == 1)
{
   FusionPro.Composition.outputFileName =
       FusionPro.Composition.MakeValidFileName(Field("Company_Bcard") + "_" +
       Field("nameoncard") + "_" + FormatDate(Today(), "yyyyMMdd") + "." +
       (FusionPro.Composition.outputFormatExtension || "pdf"));
}

Link to comment
Share on other sites

Thanks Dan.

 

I actually did get it working after I posted here but I couldn't figure out the date. I got it to show, but it would include the entire date plus a time stamp even though I was adding "yyyyMMdd". But I just tried your code and it worked perfectly. Not totally sure what I was doing wrong.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...