Jump to content

Create new folder


JeremyT

Recommended Posts

I am trying to get FusionPro on the Mac to create a new folder to place output PDFs in.

 

I've used a similar set up with FusionPro on a PC and FusionPro will create a new folder to output into.

 

Here is what I have in OnRecordStart

 

var BranchNumberFormatted = FormatNumber('000', Field("BR #"));


FusionPro.Composition.outputFileFullPathName = "//Volumes/PCCustomers/A/Branch Files/" + BranchNumberFormatted + "/" + outputName;

In the job I have a new branch #581. I would like FusionPro to create a folder named "581" in the "Branch Files" folder.

 

Any suggestions?

 

Thanks.

Link to comment
Share on other sites

I see several problems.

 

First, I don't see where you're actually telling FusionPro to create a new output file (i.e. "chunk" the output) for different records of data. There are two ways to do this: The older way (static chunking) is to check the "Output to multiple files" box (probably set to 1 record per file/chunk in your case) on the Output tab of the Composition Settings, then set FusionPro.Composition.outputFileFullPathName, as you're doing now, but you have to do that in the OnNewOutputFile rule instead of the OnRecordStart rule. The newer way (dynamic chunking) is to call FusionPro.Composition.OpenNewOutputFile in OnRecordStart, either unconditionally to get one output file per record, or with some condition, usually with a call to the FieldChanged function, to arbitrarily "chunk" similar records together into output files.

 

Second, you have an extra slash at the start of the path. You want to start with just "/Volumes' on Mac, not "//Volumes".

 

Third, I don't see where outputName is defined. If you want to get the nominal output file name, as specified in the Composition Settings, you can use the FusionPro.Composition.outputFileName property.

 

So, depending on which chunking method (static or dynamic) described above you want to use, I think you want to do something like this:

// In OnNewOutputFile, with the "Output to multiple files" box checked on the Output tab of the Composition Settings.
var BranchNumberFormatted = FormatNumber('000', Field("BR #"));
FusionPro.Composition.outputFileFullPathName = "/Volumes/PCCustomers/A/Branch Files/" + BranchNumberFormatted + "/" + FusionPro.Composition.outputFileName;

Or:

// In OnRecordStart.
var BranchNumberFormatted = FormatNumber('000', Field("BR #"));
FusionPro.Composition.OpenNewOutputFile("/Volumes/PCCustomers/A/Branch Files/" + BranchNumberFormatted + "/" + FusionPro.Composition.outputFileName);

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...