Originally Posted by Bretperry
Do you mind if I adapt it to make a script that fixes "stuck" unused colors in InDesign (you save as .idml, edit the graphics file and re-open)?
Just out of curiosity, what will you do to the script? For stuck colors I simply export a .idml and re-open it. Then I can delete the stuck colors in InDesign. I'm not sure why a script would be needed.
But feel free to edit the script. There's already a credit comment at the top. Just add a new comment saying you made xxx edits.