Jump to content

composition file name with backslash


Recommended Posts

Trying to compose to different directory and unfortunately we have discovered that the client has backslashes in their naming convention ("BK09901-16/IN139652") when i try to use the following output i keep getting sub folders in the directory due to the backslashes. How can i normalize the backslashes in the field?


asset = "BK09901-16/IN139652";
FusionPro.Composition.outputFileFullPathName = dir + asset+  " " + metal+ " " + "BRO" + ".pdf";

Link to comment
Share on other sites

As far as I know, you can not name a file with a forward slash. I tried several things but to no avail. Are you composing on your Windows machine or your Mac machine? You can change your file names to include a "/" on the mac but the OS reverts back to it's old ways of using the ":" separator.


Would it be possible for you to do something like this:

FusionPro.Composition.outputFileFullPathName = dir + asset.replace("/","-") +  " " + metal+ " " + "BRO" + ".pdf";


Where in this scenario, you're replacing their forward slash with a dash.

Link to comment
Share on other sites

Thanks step. After 2 hours of trying to figure it out, i gave up and did something similar to your suggestion. The issue that i did not mention is that i have a database that i have to reference to the file name. Since that was the case the referencing java script basically reversed replaced "/" with "#" since the file name has the "#" in it and the database has the "/".


metalDB = new ExternalDataFileEx("Metals.txt", "\t");
metal = metalDB.GetFieldValue("Metal", 1);
asset = Field("Account").replace(/\//gi, "#");

FusionPro.Composition.outputFileName = asset + " " + metal+ " " + "BRO" + ".pdf";

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...