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

FRAMEMAKER -extendscript - How to check if a color is used in the document

Community Beginner ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

Dear Forum.

The only post talking about color definition in framemaker is this post :

https://community.adobe.com/t5/FrameMaker/Script-for-removing-color-definitions/td-p/3757153

so with this information i can list all the colors in a document and how to remove them  from framemaker files.

So i need to clean some file but before removing color i would like to know if each color is used in document and then remove if not used

Have you got some code that do this check .

Thank you for your help

Best regard from France

 

TOPICS
Scripting

Views

1.4K

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 Expert ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

Caveat: I am not a scripter. However, wouldn't it be easier to set up a MIF snippet with only the colour definitions you want and then run a script that deletes all the colour definitions and then imports the colour definitions from the snippet instead of checking to see if a color you don't want is in 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
Explorer ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

This is not trivial.

 

For each color format in the doc:

  1. Find every object in the document that can use a color (all graphic objects/tables/paras, all table/para/char formats, all ruling formats, etc, etc.)
  2. Loop through each instance of each of these object types.
  3. Compare the color property against the color format you are currently checking.

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 ,
Sep 24, 2019 Sep 24, 2019

Copy link to clipboard

Copied

Thank you for your response but I'm working with more then 10 books which have each more the 200 files insides.

Some file have more then 150 color definitions.i have many graphics with elipse,polygone and more .

Not sure it is the best practice to use MIF files or to inspect each object.

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 Expert ,
Sep 24, 2019 Sep 24, 2019

Copy link to clipboard

Copied

What is the rationale behind removing the unused color definitions? I ask because, as you know, FrameMaker checks for consistent color definitions between files in a book when it regenerates the book including, if I recall correctly, whether definitions are missing from files that are present in other files. Removing the unused color definitions in some files in a book when it's present in other files is going to create error messages for you every time you regenerate, one for each color in a file and for each file, also.

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 ,
Sep 25, 2019 Sep 25, 2019

Copy link to clipboard

Copied

@ linsims

There are several reasons. Many of our customers have legacy documents that contain colors with the same name, but these colors differ in properties.
Or the documents use colors with the same properties but different names.
And they have lost the overview due to the variety of colors.

For these customers we have developed some ExtendScripts that analyze the documents and the colors, delete colors and rename colors to clean up the documents.

@ delzanglesl81086568
It is very time-consuming to examine and compare all documents. You can't do that with a few lines of code.
Otherwise I would have shown you some hints and code snippets.

 

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 Expert ,
Sep 25, 2019 Sep 25, 2019

Copy link to clipboard

Copied

That makes sense, and it sounds terribly painful.

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 ,
Sep 25, 2019 Sep 25, 2019

Copy link to clipboard

Copied

Hello forum

A word to explain my problem.

We have migrate our documentation from Fm13(2015) th FM14(2017).before with Fm13 we had a process call Ā« postprocess Ā» provide by the manufacturer of our documentation throught a pluggin in framemaker.

With FM13 this possprocess took 25 minutes now with FM14 for the same document it takes 12 hours.(one night)

When i make an updatebook i have got a book error log of 200 pages (two hundreds pages) of inconsistent error.

With the small code i found on the former extendscript subforum (see link in the first post), i could make a script that list each color of all files with CMYB values in an excel files.

This excel has mĆ¹ore than 13000 lines.

After analysis i found a files with wrong value color comparing to other files.

I have deleted this color manualy plus other minor color defect and now i donā€™t have any more book error log when i perform an update book.

The post process that took 12 hours now last 13 minutes.So i think it is a good practice to clean the files.

Now i made the cleaning on test files on C/ directory i need to do it on production files.

When you manualy delete a color the message is different if the color is used or not. So i suppose the color have a property for that

So i need code to check if a color is used in some files.

Now you have migrate the extendscript subforum to here it seems that you have forgot to send the link to expert team that were online before.

iā€™m feeling to have posted my question to the wrong place compare to the former subforum.

Where are the extendscript experts i used to read for their good advice.

It seems that Adobe has lost extendscript experience with the deletion of the former Subforum

Sorry for my english error it is not my first language.

Best regards from France

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 ,
Sep 25, 2019 Sep 25, 2019

Copy link to clipboard

Copied

LATEST

Hi delzanglesl81086568

there is definitely no property in the Color object that tells you whether the color is used or not.
As "ReedError" already wrote, you have to search all objects that have the property "color".
Furthermore, you have to distinguish the tint of colors.
I have been working with Extendscript for FrameMaker for 6 years, so some people consider me to be one of the experts. šŸ˜‰

 

Greetings from your neighbour from Germany

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