We need a script that will break the links to Character Styles but retain the formatting. We work with multiple documents that may include styles with the same name, but where someone may have edited a style to be, say a different color. There are occasions when we have to pull these multiple documents together into the same InDesign file and when we do formatting is overwritten when same name styles with different formatting exist. This issue is true of Paragraph Styles as well, but I found a script that seems to address paragraph styles, however similar syntax does not appear to be working for Character styles.
I found the script below for Character Styles but when I try to run it I receive an error: "Can't set applied character style of selection to character style "[None]" of active document." It also appears that we would need to have all the elements selected before we ran the script and I was hoping for something that would automatically select all the text for the end user. (See the Paragraph Styles script at the bottom which appears to select all text.) Could someone help me out with proper syntax? Thanks so much!
tell application "Adobe InDesign CC"
set the applied character style of the selection to ¬
the character style "[None]" of the active document
clear overrides selection overrides to clear character only
Paragraph Styes Script that appears to be working.
tell active document
set noStyle to paragraph style "[No Paragraph Style]"
tell every text frame
apply paragraph style every paragraph using noStyle without clearing overrides