rgreenidge Posted December 19, 2012 Share 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; } } Quote Link to comment Share on other sites More sharing options...
step Posted December 19, 2012 Share Posted December 19, 2012 Will this work for you? ReplaceFileExtension(GetFileName(FusionPro.Composition.inputFileName), FusionPro.Composition.JobOptions["OutputFormat"]); Quote Link to comment Share on other sites More sharing options...
rgreenidge Posted December 19, 2012 Author Share 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. Quote Link to comment Share on other sites More sharing options...
step Posted December 19, 2012 Share Posted December 19, 2012 Put it in the "OnNewOutput" Callback Quote Link to comment Share on other sites More sharing options...
rgreenidge Posted December 19, 2012 Author Share 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. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 19, 2012 Share 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. Quote Link to comment Share on other sites More sharing options...
rgreenidge Posted December 19, 2012 Author Share Posted December 19, 2012 Thanks Dan, that worked perfectly. Thanks to Step also for your input. Richard. 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.