Copy link to clipboard
Copied
I am marking up and editing an old, poorly written FM document and I need to highlight numerous different kinds of problems in the document with different colors. I have absolutely no use for these non-colors taking up room in this dropdown:
Does anyone know how to delete these useless color choices?
Thanks!
Most of the time, these RGB prefixed colors are added by graphics imported into FrameMaker. So when you delete them, they may return. If you are sure that there are no colors with these names applied to native FrameMaker objects, you can use the script below to delete them. If you delete a color applied to a native FrameMaker object (for example, a paragraph), it will be replaced with Black.
To run the script below, copy and paste it into a plain text document and save it with a .jsx extension
...Copy link to clipboard
Copied
Most of the time, these RGB prefixed colors are added by graphics imported into FrameMaker. So when you delete them, they may return. If you are sure that there are no colors with these names applied to native FrameMaker objects, you can use the script below to delete them. If you delete a color applied to a native FrameMaker object (for example, a paragraph), it will be replaced with Black.
To run the script below, copy and paste it into a plain text document and save it with a .jsx extension. Then open your FrameMaker document, and choose File > Script > Run, and select the script. Alternatively, you can add it to the Script Library so you can run it from the panel (File > Script > Catalog).
#target framemaker
main ();
function main () {
var doc;
doc = app.ActiveDoc;
if (doc.ObjectValid () === 1) {
processDoc (doc);
}
}
function processDoc (doc) {
var regex, color, nextColor;
// Regular expression for colors that start with RGB.
regex = /^RGB/;
color = doc.FirstColorInDoc;
while (color.ObjectValid () === 1) {
nextColor = color.NextColorInDoc;
if (regex.test (color.Name) === true) {
color.Delete ();
}
color = nextColor;
}
}
Copy link to clipboard
Copied
Tremendous. THANK YOU!
Copy link to clipboard
Copied
If any of these fix your issue, please mark it as Correct to help others.
Copy link to clipboard
Copied
Hello Sir. I tried this script and it appears to run but the random RGB values are still in my color list. Has this been updated or maybe I missed a step or detail? Thank you!
Copy link to clipboard
Copied
In the first line of Rick's message, he mentions that if the colors are coming from an imported graphic, they'll keep coming back.
Copy link to clipboard
Copied
If the RGB clutter is due to an imported object, such as a DWG or DXF file (but probably others as well), the Color Catalog will continue to get polluted as long as those objects are there.
My impression is that this is something the import filter is doing, and can't be overriden.
When I had the problem in the past, I'd try to identify the offending object, and then re-render it to eliminate the color defs (which usually weren't being used anyway), perhaps change the color model to greyscale & re-save as EPS (I'd use SVG or PDF today).
Copy link to clipboard
Copied
See also this older discussion: Deleting Color Definitions
which may provide hints, esp. if the colors keep coming back.
Copy link to clipboard
Copied
Thank you about twenty times over!