Copy link to clipboard
Copied
Unfortunately, Dave Saunders' amazing PreserveLocalFormatting.jsx script (that changes local formatting to character styles) doesn't work under InDesign CS4. I've tried running it both as-is and in the compatibility mode (putting it in a folder marked Version 4.0 scripts), and it seems to star to run, but doesn't actually do anything. Anyone more versed in scripts know what might be the trouble?
http://indesignsecrets.com/downloads/PreserveLocalFormatting.jsx
Copy link to clipboard
Copied
Perhaps even better: my amazing preptext.jsx (http://www.jongware.com/binaries/preptext.zip).
It runs under CS4 and has a plethora of other formatting combo's that it checks. It also has a progress bar
Copy link to clipboard
Copied
Just tried it and it's quite nice! One thing I noticed, and it may just be an aesthetic thing, is that with your script, you end up with a style that has some strange attributes. For example, for an underline style it shows the attributes in the Character Style as being [None] + Regular + underline - strikethrough -caps + position: normal. But if I create the character style manually, the attributes are: [None] + underline.
Though that's a minor quibble. I'd have to see if that creates any 'interference' in practical use.
You seem to have some other scripts on your site too, but no description of what they do. Do you have a listing somewhere of your scripts?
Copy link to clipboard
Copied
ad a. You got me there. The script forcibly creates new styles with the exact attributes it should -- i.e., if not "Italic" or "Bold", well, then ... it's "Regular". It's a pain to edit these styles afterwards, and in fact the version I use (daily) doesn't do that any more. Remind me to upload that one instead.
ad b. You got me there. Small scripts can be copied-and-pasted into forum messages, but larger ones cannot be attached to messages. So if I write a larger script, I zip it (to prevent download issues), dump it on my site and post the link here.
Every now and then I visit Peter Kahrel's scripting pages and think, "When I have the time ..."
Copy link to clipboard
Copied
Would love to get your daily use script! Please post it to your site
Copy link to clipboard
Copied
http://www.jongware.com/binaries/preptext.zip is refreshed to the new version that does not forces every attribute to be set or clear.
Copy link to clipboard
Copied
Thanks so much! This is a lifesaver. Do you mind if I send the link around to other people?
Copy link to clipboard
Copied
Can you tell me what the script exactly do and how to use it ?
I suspect i need it but there it lacks some infos…
Copy link to clipboard
Copied
The script searches for text formatted with Bold, Italic, Underline, Superscript, Subscript and Small Capitals and replaces it with a character style with an appropriate name. Replacing manual formatting with a character style has significant advantages, the most important ones are that you no longer can accidently remove them (when overriding paragraph attributes), and afterwards, you can change the styles at will.
There are a few points you must keep in mind:
Read the ID Help or http://indesignsecrets.com/how-to-install-scripts-in-indesign.php for instructions on how to install and use scripts.
Copy link to clipboard
Copied
Ok Thanks, it works very well. Now let me ask a dumb question : Why i would want to do that ?
I mean if i don't so that i will loose the italics for exemple ?
Copy link to clipboard
Copied
Ever seen a paragraph style name with a '+' added to it? That's an indication the paragraph contains 'local formatting' somewhere -- a manual override of the formatting in the paragraph style. If you select some text and apply "Italic", well, that's a manual override -- the font in the paragraph style specifies "Regular".
The problem with manual overrides is that they can disappear without warning. Try this: select some text in your document and underline it -- the paragraph style name will gain a '+'. Alt+click the paragraph style ("Apply Removing Overrides") -- the underline disappears. Or: change the paragraph style, adding 'underlined' to it. Press "OK" (all paragraphs in that style will be underlined), then change the style back, removing the Underline. Your manually applied underline will be gone.
If you never had any of these problems -- or you don't think of it as a problem -- you don't really need this script...
Copy link to clipboard
Copied
I have another question : if i use 2 fonts and they don't use the same name for italics :
— italic
— book italic
It seems the script is lost with it, what can i do about it ?
Copy link to clipboard
Copied
That was #1 of my 5-point "Watchit" list.
Copy link to clipboard
Copied
Yes sorry…
So it's not possible to update the script and make it create 2 styles i guess ?
Copy link to clipboard
Copied
The main point is that the script cannot know in advance what the italic fonts are called.
I usually use 'Find Font' on new documents, and if I see quirky bold or italics, I just replace them immediately with a regular "Times New Roman Bold" and "Italic" so I'm sure the script will pick them up.
Copy link to clipboard
Copied
Maybe is should try that…
Another way to do that would be to change the name of the font 'book italic' to 'italic' but i don't know how to do that, should be possible… ?
Copy link to clipboard
Copied
Yes, that's exactly what I do with "Find Font".
Copy link to clipboard
Copied
No i mean change something in the font file that would change the name of the italics.
But i don't know where is that code and how to change that…
Copy link to clipboard
Copied
+ all the Book Italics are used in notes here in my document, and it seems you can't search in notes…
Copy link to clipboard
Copied
You lost me there. You don't change the font itself, you change the font used in your document. Then you run the script. It tags all italicized text with one unique character style for "Italics". If you don't have a regular italic in the font used, all you have to do is change the character style.
It sounds as if the text you work on has already been formatted. Running scripts that mess with texts over "almost finished" texts may have been an invitation to disaster ...
Copy link to clipboard
Copied
Let be clear.
I have a final text, with styles, in a word document.
In indesign i use one font for the main text, it have a real italic, called italic.
I use another font for footnotes, the font have italics too but its called 'book italic'.
So i run you your script, it works for the main text.
But for the footnotes i doesn't work, tried to apply an 'italic' style when the italic is called 'book italic'…
I can't fixe that seaching for italics on a specific font and change it for book italic for 1 reason :
— you can't seach in footnotes (it seems)
So i thought if i change the name 'book italic' for 'italic' in the OTF file, it would work.
Copy link to clipboard
Copied
Aha -- your footnote font differs! Yes -- sometimes I have to mix two fonts that apply different naming schedules, and in that case the script straightens things out that should stay crooked
You can make a new character style named "Book Italic" (with its style set to the correct italic font). Then do a search and replace; search for "Formatting" -> Character Style "Italic" and Paragraph Style "(your footnote paragraph style). Replace with Character Style "Book Italic".
Copy link to clipboard
Copied
Thanks for the tip i'm gonna try that.
PS. Offtopic but… do you know any word count script for Indesign ?
Copy link to clipboard
Copied
That, unfortunately, depends on your definition of a word
If you click your text cursor in a text frame, InDesign shows you the number of "Words" (and Characters, Lines and Paragraphs as well) in the Info panel.
This thread http://forums.adobe.com/message/2151036#2151036 shows an alternative way of counting.
Copy link to clipboard
Copied
I made the search thing and it worked very well, thanks a lot for your help !