rgreenidge Posted December 19, 2012 Posted December 19, 2012 We have been using the following script below to name our files in the OnJobStart call back rule to automatically name our files with the name of the data file when we compose in FP7. When we try to use it in FP8 it generate a filename with a very long numeric value. Hoping someone has an idea for a fix or a substitute script. Any help is appreciated. Thanks, Richard inputFileExt = ".TXT" newFileExt = FusionPro.Composition.JobOptions["OutputFormat"]; newFileName = FusionPro.Composition.inputFileName; switch (newFileExt){ case "Indigo PPML": newFileExt = ToLower("." + "PPML"); break;; case "PostScript": newFileExt = ToLower("." + "ps"); break;; case "Digimaster": newFileExt = ToLower("." + "ps"); break;; case "Single-File VPS": newFileExt = ToLower("." + "vps"); break;; case "Multi-File VPS": newFileExt = ToLower("." + "vps"); break;; default: newFileExt = ToLower("." + newFileExt); break;; } for (i = 0; i<=Len(newFileName); i++){ tempChar = Right(newFileName, i); if(tempChar == ToUpper(inputFileExt)){ newFileName = Left(newFileName, Len(newFileName)-i) + newFileExt; FusionPro.Composition.outputFileName = newFileName; return; } }
step Posted December 19, 2012 Posted December 19, 2012 Will this work for you? ReplaceFileExtension(GetFileName(FusionPro.Composition.inputFileName), FusionPro.Composition.JobOptions["OutputFormat"]);
rgreenidge Posted December 19, 2012 Author Posted December 19, 2012 Hi Step, thanks for the quick reply. I tried placing the Script in the OnJobStart callback rule and nothing changed. Do I have to place it in another rule? Thanks, Richard.
rgreenidge Posted December 19, 2012 Author Posted December 19, 2012 Hi Step, still not working. I tried changing the text where the words "OutputFormat" are with ".pdf" and this did not work either. Thanks, Richard.
Dan Korn Posted December 19, 2012 Posted December 19, 2012 You should be able to do this in OnJobStart: FusionPro.Composition.outputFileName = ReplaceFileExtension(GetFileName(FusionPro.Composition.inputFileName), FusionPro.Composition.outputFormatExtension); However, there's a bug in FusionPro 8 on Mac, where if the file name is longer than 31 characters, it gets munged. We have a fix for this which will be included in the upcoming patch release. If you have an urgent need, you can contact Support about getting a Beta.
rgreenidge Posted December 19, 2012 Author Posted December 19, 2012 Thanks Dan, that worked perfectly. Thanks to Step also for your input. Richard.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.