This content has been marked as final. Show 6 replies
What you need to do is to blank the fields for point size etc.:
with (app.activeDocument.characterStyles.item ('bibref'))
appliedFont = NothingEnum.nothing;
fontStyle = NothingEnum.nothing;
pointSize = NothingEnum.nothing;
Thank you very much for your quick response. I tried your script and it did as you intended by clearing the Font, Font Style and Point Size in the character style, but unfortunately it did not correct the problem of the style becoming some default style and size (Times New Roman 10 pt) when placed into ID.
In fact, I had already set up the 'bibref' and 'Hyperlink' character styles with these fields blanked out. Also, I made Adobe aware of this bug when CS2 came out and they warned me that CS3 wouldn't fix the problem; but I didn't realize that CS3 would be worse than CS2 so that using an rtf file wouldn't fix things.
So, I am left with my initial query: is it possible to write a script to search for the character styles in question and apply the font size of the underlying paragraph style?
Thanks a lot for any help you can give.
It could be the case that there is some local formatting. After you use the script, try removing local formatting (Alt/Opt+click on the stylename in the UI). If that works, and if it's possible to remove local formatting, you can script that as well. First let's see if removing local formatting makes a difference.
No that doesn't work. Because there is no font or font size described in the character style. What does work is to clear the overrides in the underlying paragraph style, but that is not a good solution for me because in some Hyperlinks we might have italic text, which would also be overridden.
Thanks so much for your quick replies by the way. I wasn't expecting that.
I can't reproduce this. If you send me one of your troublesome files I'll take a look (click my name in this message to see my email address).
This in the end fixed Simon's problem:
charstyles = ['bibref', 'Hyperlink'];
app.findGrepPreferences = null;
for (i = 0; i < charstyles.length; i++)
function reset_charstyle (cs)
app.findGrepPreferences.appliedCharacterStyle = cs;
var f = app.activeDocument.findGrep();
for (var j = 0; j < f.length; j++)
f[j].pointSize = f[j].appliedParagraphStyle.pointSize
Simon thinks that this problem occurs on PCs but not on Macs.