PDA

View Full Version : Filenaming Script no longer works in FP8


rgreenidge
December 19th, 2012, 08:05 AM
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
December 19th, 2012, 08:15 AM
Will this work for you?


ReplaceFileExtension(GetFileName(FusionPro.Composi tion.inputFileName), FusionPro.Composition.JobOptions["OutputFormat"]);

rgreenidge
December 19th, 2012, 08:21 AM
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.

step
December 19th, 2012, 08:46 AM
Put it in the "OnNewOutput" Callback

rgreenidge
December 19th, 2012, 09:13 AM
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
December 19th, 2012, 10:20 AM
You should be able to do this in OnJobStart:
FusionPro.Composition.outputFileName =
ReplaceFileExtension(GetFileName(FusionPro.Composi tion.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
December 19th, 2012, 11:33 AM
Thanks Dan, that worked perfectly. Thanks to Step also for your input.

Richard.