• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Color Inconsistency Messages in Error Console

Community Beginner ,
Apr 09, 2020 Apr 09, 2020

Copy link to clipboard

Copied

I work for company that uses FrameMaker extensively. We have a complex structured application that automatically swaps RGB values of colors when producing color or grayscale versions of .fm files. As a result, we often get hundreds of color inconsistency messages on the Error Console resulting in long file update times. It would best to disable error reporting for inconsistent colors. Is there a hidden setting for the maker.ini file to ignore color error messages. We tried setting ShowErrors=Off but that has no effect. Is there any other way to control the console error messages?

TOPICS
Error , Publishing , Structured

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 10, 2020 Apr 10, 2020

Copy link to clipboard

Copied

Hello Bmalarky

Are you working with flight ops doc comming from an aircraft maker ?

if yes i could give you my experience and my solution.

best regards

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 10, 2020 Apr 10, 2020

Copy link to clipboard

Copied

Any experience is helpful. I did manage to stumble on a lightly documented method to at least control the ouput to [user home]\AppData\Roaming\Adobe\FrameMaker...\console.txt. By changing a few lines in the maker.ini file, it won't save the errors to the file but will report errors to the console which consumes less resources. This is at least in the right direction...

 

[Preferences]

ShowErrors=Off ; --- Changed from On to Off

 

[APIClients]

; BookErrorLog=Standard, Report errors during book generation, fminit\bookerrolog.dll, all  --- Added the semicolon to comment out the line.

 

Still looking for a magic bullet to turn off error checking completely.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 14, 2020 Apr 14, 2020

Copy link to clipboard

Copied

Hello bmalarky

I will give you my experience regarding Color Inconsistency .My compagny receive FM Book from the manufacturer and then we update our book .Until recently when i made an update book process it take 1/4 hours and the book error  log was long of 130 pages of mostly color inconsistency error . i decided to take the bull by the horns and trying to undestand the problem of the color inconsistency.

So i made a script that list all the colors definition of the book and open this files in excel.

by sorting this file by the color name i could undestand what was the problem.

for some book I had more than 8000 lines of colors and more than 200 colors by files.

if you have like me some TOC (table of content ) files or LEP (list of effective page) or highlight files or table files,  you will see that the 200 color defintions are useless for this kind of files that only need black color.

So first i removed from this files all the useless color with a script found on this forum(second script here).

 after i run the script again and sort the excel files by the color name(column 2).

you will see why you have your inconsistency color .So either you remove the color if in not use in the file either you enter the same value as the most have.for me only few color in the first file made problems.

so after half a day my book error log  was clean and the true error like unresolved cross reference are now on the first page .

here the scipt that list all the color in a excel files:

 

var RepSauvegarde="C:\\00_LogFile";
var NomFichier="Liste_des couleurs";
var NbCouleurTotales=1  ; 
var LogFileName= CreateLogFileName(RepSauvegarde,NomFichier);

Main();

function Main(){
    book=app.ActiveBook;
    comp=book.FirstComponentInBook;
    var DZG_BookName=shortFileName(book.Name);
    var NbFiles=1;
    Log2(LogFileName, "This script will list the color of this book"+DZG_BookName,"\r");
    Log2(LogFileName,"Book Color NĀ°;Color Name;File Color NĀ°;File Name;FIle nĀ°;Cyan %;Magenta %;Yellow %;Black %","\r"); //Allow to use filter in excel files
    $.writeln(" ****DEMARRAGE DE L'INVENTAIRE DES COULEURS******");// Log to console
    
    while(comp.ObjectValid()){
        // ouvre chaque fichier du book      
		FileId=DZG2_open(comp.Name);
		nextComp=comp.NextBookComponentInDFSOrder;			
         $.writeln("Traitement du fichier nĀ° " + NbFiles+ ": " +shortFileName(FileId.Name)+"\r");// Log to console                
        ListeCouleur(FileId, NbFiles); //lance procedure de recuperation des couleurs
        FileId.Close(Constants.FF_CLOSE_MODIFIED);// fermeture du fichier
        comp=nextComp;
        NbFiles +=1;
	}
    LaunchExcelApp(RepSauvegarde,LogFileName);// Lancement de la procedure pour ouvrir Excel
    $.writeln("\r"+" ******FIN DE L'INVENTAIRE DES COULEURS************");// Log to console
}


function ListeCouleur(doc,FileNbr){    
   
    var FileNameCourt=shortFileName(doc.Name);
    var NbCol=1; //Compteur de couleur par fichier
    var col = doc.FirstColorInDoc ;//getting the first color in doc

    while (col.ObjectValid() ) {
        //checking if the color object is valid   
        col = col.NextColorInDoc;
        NbCol=NbCol+1
        var chaine=NbCouleurTotales+" ; "+col.Name+" ; "+NbCol + " ; " + FileNameCourt+ ";" + FileNbr+ ";"   +col.Cyan/65536+"%;   "+col.Magenta/65536+"% ;  "+ col.Yellow/65536+"%;  "+col.Black/65536+"%   "
        Log2(LogFileName,chaine,"\r");
        NbCouleurTotales +=1
     }
 }

function CreateLogFileName(FolderLoc,FileName){
    var date=new Date();
    var dateString = date.getDate()+ "_"+(date.getMonth() + 1)  + "_" + (date.getYear()-100)+"_"+date.getHours()+"h"+date.getMinutes() ;
    
     if (! FolderLoc.exists){
        var MyPath = new Folder ( FolderLoc);
        var MyFolder = MyPath.create();
        }
     var NomFichierLog= RepSauvegarde + "\\"+FileName+ shortFileName(app.ActiveBook.Name)+dateString+".csv";
    return NomFichierLog
    }

function LaunchExcelApp( RepSauvegarde,cDZGLogFile){
    
    var bat = File ( RepSauvegarde+"\\FichierBatLancement.bat");  
    bat.open ("w");  
    bat.writeln ('start excel.exe '+'"'+ cDZGLogFile+'"');    
    bat.writeln ('quit');  
    bat.close ();  
    bat.execute (); // This is what runs the batch file (like a double-click on it in Windows Explorer).  

    }

function Log2(logFile,textLine,FinDeLigne){
	file=new File (logFile);
	file.open("a+", "TEXT", "????");
	file.write(textLine+FinDeLigne);
	file.close();
	}


function shortFileName(fName){
              shortName=fName.substring(fName.lastIndexOf("\\") + 1, fName.length);
 return shortName
    }


function DZG2_open(filename){
    // cette sub ouvre les fihcier en arriere plan
    openProp = GetOpenDefaultParams()

    i=GetPropIndex(openProp,Constants.FS_FileIsOldVersion)
    openProp[i].propVal.ival=Constants.FV_DoOK

    i=GetPropIndex(openProp,Constants.FS_FontNotFoundInCatalog)
    openProp[i].propVal.ival=Constants.FV_DoOK

    i=GetPropIndex(openProp,Constants.FS_FontNotFoundInDoc)
    openProp[i].propVal.ival=Constants.FV_DoOK

    i=GetPropIndex(openProp,Constants.FS_FileIsInUse) 
    openProp[i].propVal.ival=Constants.FV_DoCancel

    i=GetPropIndex(openProp,Constants.FS_AlertUserAboutFailure)
    openProp[i].propVal.ival=Constants.FV_DoCancel
    
    i=GetPropIndex(openProp,Constants.FS_MakeVisible)
    openProp[i].propVal.ival=false
    

    retParm = new PropVals()
    docOpen=Open(filename,openProp,retParm);
    return docOpen;
    }

and here the script to remove the useless color to run file by file

 

#target framemaker
 
  
  
  var doc = app.ActiveDoc, 
    col  = doc.FirstColorInDoc
    keepColors = ["DZG_dummyColor","Black","White","Red","Green","Blue","Cyan","Magenta","Yellow","Dark Grey","Pale Green","Forest Green","Royal Blue","Olive","Salmon","Mauve","Light Salmon","Custom Color","Background","COC",];





while(col.ObjectValid()){
    
    if (!IsInArray (keepColors, col.Name)) { 
        $.writeln(col.Name + " will be deleted");
        col2 = col.NextColorInDoc;
        col.Delete();
        col = col2;
    }
    else {
        col = col.NextColorInDoc;
    }
}

function IsInArray (array, item) { //=== Get index of item in array ===============================  
// In       array: where to find the item  
//          item:  to be found in the array  
// Out      Returns index of found element or null.   
// Comment  array.indexOf() is not supported in ExtendScript, only  string.indexOf () is defined.  
var j, arLen = array.length;  
  
  for (j = 0; j < arLen; j++) {  
    if (array [j] == item ) { return j;}  
  }  
  return null;                                    // not found in array  
} //--- end IsInArray  

hope it help you

best regards

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 16, 2020 Apr 16, 2020

Copy link to clipboard

Copied

Thank you for the great script delzanglesl81086568, lots of good analysis there. I have used a similar method to strip unused colors out of the documents I work on but on some of the files I don't maintain, the colors continued to reappear. Through trial and error, I was able to prevent logging the color inconsistency messages to the console.txt file by modifying a few lines in the maker.ini file but they are still reported to the console, just not logged to the file. I will pass on your solution to some of my coworkers so they can try to fix their inconsistent colors. Thanks again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 14, 2020 Apr 14, 2020

Copy link to clipboard

Copied

Hi bmalarky,

what FrameMaker version do you use and what is the name of these colors?

 

The best way to avoid error messages is to avoid these errors.

I wrote a script, that analyses the colors in a document, shows you where it is used (paragraph, characterstyles etc.) and which colors are unused and safe to delete. Then you can select these colors an delete them in one go.

But it's in German only. (at the moment.)

I could offer to give you a 14-day demo, so you could get rid of theses errors.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 16, 2020 Apr 16, 2020

Copy link to clipboard

Copied

LATEST

Thank you Klaus,

I've been using FM 2017 and am starting to work with FM 2019 and found the same issues. I was able to strip unused colors out using a script and got it working. I also slightly modified the maker.ini file to prevent writing errors to the console.txt file, but they still reported to the console. That also helped a bit by reducing the overhead of writing to the file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines