Home/Support/

Forums

This Question is Possibly Answered

1 "correct" answer available (10 pts)
32 Replies Last post: Jan 6, 2010 3:10 PM by David Blatner  
mpvrana User 6 posts since
May 3, 2009
Currently Being Moderated

May 7, 2009 8:41 AM

Preserve Local Formatting script and CS4

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

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
1. May 7, 2009 9:14 AM in response to: mpvrana
Re: Preserve Local Formatting script and CS4

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

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
3. May 7, 2009 2:26 PM in response to: mpvrana
Re: Preserve Local Formatting script and CS4

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 ..."

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
5. May 8, 2009 4:56 AM in response to: mpvrana
Re: Preserve Local Formatting script and CS4

http://www.jongware.com/binaries/preptext.zip is refreshed to the new version that does not forces every attribute to be set or clear.

alexgodlex User 37 posts since
May 5, 2009
Currently Being Moderated
7. Aug 5, 2009 2:23 AM in response to: mpvrana
Re: Preserve Local Formatting script and CS4

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…

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
8. Aug 5, 2009 3:38 AM in response to: alexgodlex
Re: Preserve Local Formatting script and CS4

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:

  1. The script searches for font styles named "Bold" and "Italic". If you happen to use a font where these are called "Semibold", "Black" or "65 Bold" or "Slanted", "Oblique" or "46 Light Italic" it will not find these. If you need styles applied to these attributes, do so by hand.
  2. The script searches for attributes such as "superscript", "subscript", "small capitals". If small caps are faked in the document with capitals in a smaller font, the script will not find them. If superscript or subscript are faked in the document with a smaller font size and some baseline shift, the script will not find them.
  3. Word has a lot of different underline styles; InDesign only has one. It is possible to search specifically for 'double underline', 'dotted underline', etc. but you have to do this by hand. The script picks up any and all kinds of underline as one and the same -- Underline. (See also #5 below.)
  4. The script creates new character styles as needed; these are all independent, not based-upon eachother. If you have 3 styles with 'Bold' in them and you want to change the bold font to semi-bold, you will have to do that for each separate style that contains Bold.
  5. Any formatting other than those mentioned is not preserved or changed by this script. If you suspect your document has other types of formatting you want to preserve, replace these by hand with character styles. The script is hardcoded to ignore text that already has a character style,  something you can use in your advantage (when done properly).

 

Read the ID Help or http://indesignsecrets.com/how-to-install-scripts-in-indesign.php for instructions on how to install and use scripts.

alexgodlex User 37 posts since
May 5, 2009
Currently Being Moderated
9. Aug 5, 2009 3:44 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

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 ?

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
10. Aug 5, 2009 3:52 AM in response to: alexgodlex
Re: Preserve Local Formatting script and CS4

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...

alexgodlex User 37 posts since
May 5, 2009
Currently Being Moderated
11. Aug 5, 2009 4:26 AM in response to: alexgodlex
Re: Preserve Local Formatting script and CS4

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 ?

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
12. Aug 5, 2009 4:27 AM in response to: alexgodlex
Re: Preserve Local Formatting script and CS4

That was #1 of my 5-point "Watchit" list.

alexgodlex User 37 posts since
May 5, 2009
Currently Being Moderated
13. Aug 5, 2009 4:35 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

Yes sorry…

 

So it's not possible to update the script and make it create 2 styles i guess ?

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
14. Aug 5, 2009 4:52 AM in response to: alexgodlex
Re: Preserve Local Formatting script and CS4

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.

alexgodlex User 37 posts since
May 5, 2009
Currently Being Moderated
15. Aug 5, 2009 4:56 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

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… ?

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
16. Aug 5, 2009 5:46 AM in response to: alexgodlex
Re: Preserve Local Formatting script and CS4

Yes, that's exactly what I do with "Find Font".

alexgodlex User 37 posts since
May 5, 2009
Currently Being Moderated
17. Aug 5, 2009 6:08 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

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…

alexgodlex User 37 posts since
May 5, 2009
Currently Being Moderated
18. Aug 5, 2009 6:10 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

+ all the Book Italics are used in notes here in my document, and it seems you can't search in notes…

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
19. Aug 5, 2009 6:47 AM in response to: alexgodlex
Re: Preserve Local Formatting script and CS4

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 ...

alexgodlex User 37 posts since
May 5, 2009
Currently Being Moderated
20. Aug 5, 2009 7:26 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

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.

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
21. Aug 5, 2009 7:52 AM in response to: alexgodlex
Re: Preserve Local Formatting script and CS4

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".

alexgodlex User 37 posts since
May 5, 2009
Currently Being Moderated
22. Aug 5, 2009 8:07 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

Thanks for the tip i'm gonna try that.

 

PS. Offtopic but… do you know any word count script for Indesign ?

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
23. Aug 5, 2009 8:45 AM in response to: alexgodlex
Re: Preserve Local Formatting script and CS4

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.

neuelex User 15 posts since
Aug 5, 2009
Currently Being Moderated
24. Aug 5, 2009 8:47 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

I made the search thing and it worked very well, thanks a lot for your help !

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
25. Aug 6, 2009 2:46 AM in response to: alexgodlex
Re: Preserve Local Formatting script and CS4

It only occurred to me this morning -- there is no problem at all with 'other italics'!

 

Simply first replace "Book Italic" with a custom character style, and then run the script. The script is smart enough to leave existing character styles alone.

neuelex User 15 posts since
Aug 5, 2009
Currently Being Moderated
26. Aug 6, 2009 2:58 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

Sorry but what do you mean by "replace "Book Italic" with a custom character style"

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
27. Aug 6, 2009 4:15 AM in response to: neuelex
Re: Preserve Local Formatting script and CS4
#5. Any formatting other than those mentioned is not preserved or changed by this script. If you suspect your document has other types of formatting you want to preserve, replace these by hand with character styles. The script is hardcoded to ignore text that already has a character style,  something you can use in your advantage (when done properly).

 

So, in a fresh document (that has no character styles!), you can safely apply a custom character style to the text in the "Book Italic" font.

 

  • Create a new character style for the Book Italic font -- you should not call this style "Italic", obviously!
  • Call up the Find/Change box
  • In Find Formatting, enter the name of your font and "Book Italic" as the font style
  • In Change Formatting, set the character style to the one you created.
  • Check if "Include Footnotes" is on
  • Hit "Replace All"

 

Then run my script -- it will not change existing character styles.

neuelex User 15 posts since
Aug 5, 2009
Currently Being Moderated
28. Aug 6, 2009 4:30 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

Ok i got it

 

But this is the same as doin what i've done for my document, wich is : doing that AFTER running the script…

Same results, right ?

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
29. Aug 6, 2009 6:45 AM in response to: neuelex
Re: Preserve Local Formatting script and CS4

Yes, but that's because the script did not pick up the 'book italic' in the first place ...

 

Suppose you have a document with Times Italic and Helvetica Italic, and you want both to be preserved in their own font. Then you would have to change at least one of them to another style before you run the script -- to prevent both fonts get tagged as "Italic".

 

I have to do this almost every day, so for me it's becoming 2nd nature ...

mariana pineda User 52 posts since
May 13, 2009
Currently Being Moderated
30. Dec 8, 2009 8:03 AM in response to: [Jongware]
Re: Preserve Local Formatting script and CS4

A super script. How to use it also in foonotes?

 

A good idea is to apply colours to the character styles. With this the document is very fast tested and subject to other exercises.

 

Thank you.

[Jongware] Contributor 2,716 posts since
Dec 17, 2006
Currently Being Moderated
31. Dec 8, 2009 8:46 AM in response to: mariana pineda
Re: Preserve Local Formatting script and CS4

mariana pineda wrote:


A super script. How to use it also in foonotes?

 

Super-script -- also known as "superior"!

 

It needs nothing special, it already should work just fine in footnotes, as well as in tables. The script searches the entire story. (An important note is that anchored objects contain "their own story" -- it does not work through to these as well.)

 

Ehm, the 'color' part is not entirely clear. Do you mean you want to see your italics (etc.) also in another color? When the script is finished, you can change the automatically created character styles and add some color to them.

David Blatner User 10 posts since
Dec 28, 2007
Currently Being Moderated
32. Jan 6, 2010 3:10 PM in response to: mpvrana
Re: Preserve Local Formatting script and CS4

Jongware's free script is wonderful and a great help to many people. You might also look at the Create Basic Character Styles and Create All Character Styles features in the Blatner Tools plug-in (dtptools.com/bt), along with the Create Paragraph Styles (which can create paragraph styles for you throughout an unstyled document).

More Like This

  • Retrieving data ...