Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Need Script to Break Link to Character Styles

$
0
0

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!


tellapplication "Adobe InDesign CC"

  settheapplied character styleoftheselectionto¬

  thecharacter style "[None]" oftheactive document

  clear overridesselectionoverrides to clearcharacter only

endtell

 

Paragraph Styes Script that appears to be working.

tellactive document

  setnoStyletoparagraph style "[No Paragraph Style]"

  telleverytext frame

  apply paragraph styleeveryparagraphusingnoStylewithoutclearing overrides

  endtell



Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>