CreativePro Forum
Join our community of graphic designers, publishers, and production artists from around the world. Our members-only forum is a great place to discuss challenges and find solutions!
- You must be logged in to reply to this topic.Login
Using different colors for the same styles in chapters of a book
- This topic has 11 replies, 7 voices, and was last updated 5 years, 11 months ago by
Civi Bernath.
-
AuthorPosts
-
-
January 9, 2013 at 10:41 pm #63914
Sergey Kashchavtsev
MemberHi.
I'm making a 160-page catalog consisting of 12 chapters. Each chapter has the same master pages, styles, object styles and so on. They are all the same for all chapters. The only difference that each chapter has its own key color used through the chapter. As there are about 10 styles (and they are linked with each other through “next style” option), i do not want to create the copy of all of them and relink them for each chapter just to change color. So i did a book with a chapter template with a color named “Chapter Key Color”, wich is used in all styles, and colors for each chapter – “Chapter 1 color”, “Chapter 2 color”, never used in the template. Then I:
1) created documents for each chapter from this template,
2) deleted the “Chapter Key Color” and replaced it with “chapter # color”.
Everything looks fine, but every time i sync the book, InDesign restores the “Chapter Key Color” and its bindings to styles, so after each sync I have to repeat step 2 for each document. It happens even when “Swatches” are turned off in Sync options. In fact, when i turn any style syncing option, it brings me the “Chapter Key Color” back to each synced document.
Any ideas for more elegant solution?
-
January 10, 2013 at 7:36 am #63916
David Blatner
KeymasterThis is a fascinating question and got me thinking. There are no great solutions, but here's one that might work for you:
creativepro.com/changing-the-color-of-headings-based-on-section
-
January 10, 2013 at 10:32 am #63918
Sergey Kashchavtsev
MemberHi David! Thanks for your answer. That's a nice solution, but it doesn't work for me, as there are not only text styles, but also some non-GREPpable object styles.
It would be great if there is any possibility to make a color variable (like text ones) with the condition like “if chapter number/section prefix = X, then KEY COLOR = A”, but I've never heard of something like that in Indesign.
So I stay with my model of manual color replacement in each chapter, as for the moment it's the quickiest one. Hope we can find more solutions :)
-
March 27, 2014 at 7:57 pm #67775
Kirsten Duncan
MemberHi Serg, David
We’ve been trying to do this also exactly as Serg describes and with the same result.
David, your link has broken – could you repost please?
Serg, did you figure out how to get it to work including object styles? We are using chapter colour for headings, objects, tables etc across large documents so really need to solve this.
cheers
Kirsten -
April 1, 2014 at 10:20 am #67819
Matt Mayerchak
ParticipantIf each chapter is a separate InDesign file, can you just use the same Swatch name for all of them, but change the CMYK values for each chapter?
I.e. the swatch would say Chapter Key Color (or whatever name you like) but in Chapter 1 it would be a blue, in Chapter 2 a Red, etc.
Having different definitions for the same swatch name is something I would usually advise AGAINST from a production POV, but if used deliberately it might achieve the result you want.
Is that what you already tried? Or, perhaps I’m missing the point of what you are trying to do.
-
April 1, 2014 at 7:19 pm #67827
Kirsten Duncan
MemberHi Matt
Yes, that is what we are doing – every document in the book has the swatch called “chapter key colour” (or whatever) and this is used for paragraph, character, table, cell and object styles. Then we change the values for that swatch in each individual document so that each document has it’s own chapter colour. This works fine until we need to synchronise the styles across the book, eg we might need to change the spacing on a heading style or maybe move something on a master page or something else. We ensure that “swatches” is NOT ticked in the list of things to synch, then we synchronise and InDesign updates across the book but also synchronises the swatches which we have specifically unticked, resetting the chapter key colour swatch to whatever it is in the reference document (we usually use magenta for anything that needs to be updated). As Serg says above, we then have to go back to every document and redefine the values for the chapter swatch.
Are we missing something or is this a bug in the program? Happy to report it through the adobe bug site but just wondered whether we were missing some other setting somewhere or if there is a work-around to achieve the same outcome.
cheers
Kirsten -
April 3, 2014 at 4:52 pm #67860
Kirsten Duncan
MemberActually, I’ve just realised that we’re doing it slightly differently to Serg. We are changing the values for the swatch called “chapter key colour” whereas Serg is swapping the swatch in his cascade of paragraph styles. But either way, we seem to have the same problem of InDesign synchronising options that we have unticked, thereby resetting our manual changes in each document back to the source document setting.
-
April 13, 2015 at 2:37 pm #74606
Alexandre Dauchez
MemberHi all,
I had the same question and achieved it thanks to a script, but It will work only on Mac since I wrote it in AppleScript (I don’t know Javascript, sorry…).First, create a swatch whose name would be consistent across all documents in the book and relevant like “Chapter_color”. This swatch will be applied to anything related to the chapter, like titles, cell’s fill colors, etc.
It’s essential to give it a name.
If you sync it normally, the values of the swatch will be overwritten to match the values of the source file in the book.So the workaround is not to sync the book with InDesign directly, but let the script do it instead.
The script “saves” the values of each document’s chapter color in a duplicated swatch, then re-create the swatch with these values.
I didn’t find anything else to achieve it.Here is the script :
————————————————————————————————
[code]
set AppleScript’s text item delimiters to ""set theChapterColorName to "COULEUR-CHAPITRE"
set theValidatedChapterColorName to theChapterColorName & "-OK"tell application id "com.adobe.InDesign"
activate
try
set myBook to active book
on error
display dialog "Aucun livre n’est ouvert." with icon 0
return
end tryset myBook_Files to object reference of every book content of active book
set theSourceINDD to style source document of myBook
set theSourceINDD_file to (full name of theSourceINDD) as string –path
set myBook_list to {}
repeat with myBook_File in myBook_Files
set myBook_File_path to (full name of myBook_File) as string
if myBook_File_path is not theSourceINDD_file then
set myBook_list’s end to myBook_File_path
end if
end repeatrepeat with myBook_File in myBook_list –open all files except the style source document
open file myBook_File
tell document 1
set theChapterSwatch to item 1 of (every swatch whose name is theChapterColorName)
set theChapterSwatch_properties to properties of theChapterSwatch
set newProperties to {name:theValidatedChapterColorName} & theChapterSwatch_properties
set theReplacedColor to make new color with properties newPropertiesend tell
end repeatsynchronize myBook
repeat with myBook_File in myBook_list –open all files except the style source document
open file myBook_File
tell document 1
set theChapterSwatch to item 1 of (every swatch whose name is theValidatedChapterColorName)
set theBadSwatch to item 1 of (every swatch whose name is theChapterColorName)
theChapterSwatch merge with theBadSwatch
set name of theChapterSwatch to theChapterColorName
end tell
end repeatend tell
[/code]————————————————————————————————
Of course it’s better if you know a bit of AppleScript…
-
April 13, 2015 at 2:44 pm #74607
Alexandre Dauchez
MemberArr, sorry, I’m not used with this forum…
Here is the code :set theChapterColorName to "CHAPTER_COLOR" --or any name you'd prefer set theValidatedChapterColorName to theChapterColorName & "-OK" tell application id "com.adobe.InDesign" activate try set myBook to active book on error display dialog "Please open an InDesign book first !" with icon 0 return end try set myBook_Files to object reference of every book content of active book set theSourceINDD to style source document of myBook set theSourceINDD_file to (full name of theSourceINDD) as string --path set myBook_list to {} repeat with myBook_File in myBook_Files set myBook_File_path to (full name of myBook_File) as string if myBook_File_path is not theSourceINDD_file then set myBook_list's end to myBook_File_path end if end repeat repeat with myBook_File in myBook_list --open all files except the style source document open file myBook_File tell document 1 set theChapterSwatch to item 1 of (every swatch whose name is theChapterColorName) set theChapterSwatch_properties to properties of theChapterSwatch set newProperties to {name:theValidatedChapterColorName} & theChapterSwatch_properties set theReplacedColor to make new color with properties newProperties end tell end repeat synchronize myBook repeat with myBook_File in myBook_list --open all files except the style source document open file myBook_File tell document 1 set theChapterSwatch to item 1 of (every swatch whose name is theValidatedChapterColorName) set theBadSwatch to item 1 of (every swatch whose name is theChapterColorName) theChapterSwatch merge with theBadSwatch set name of theChapterSwatch to theChapterColorName end tell end repeat end tell
-
May 21, 2017 at 9:48 am #94798
Civi Bernath
ParticipantI posted this very question a couple of weeks ago. Since I didn’t receive any feedback, I searched again and found this thread. I also made one universal swatch name across all chapters. Since we’re all unticking the swatches before synchronizing, and the swatches still synchronize, isn’t this something Adobe should be addressing?
In the meantime, I’d love to try the script. I never created or modified a script (just use the wonderful samples that are included in the program). For us uninitiated, can someone please instruct how make a script, using Alexandre’s code?
-
May 22, 2017 at 11:19 am #94802
Michel Allio for FRIdNGE
ParticipantOne exception! — For Free! ;-)
Just modify the script depending of the book contents [color values/files number, each color values spec.]
The global color name is: “ChapterColor”.
Open the “book”, sync. it and finally launch this script:
var myBook = app.activeBook,
myBookContents = myBook.bookContents,
D = myBookContents.length,
//————————————————————————-
myColorValues = [
//—– DEFINE EACH CHAPTER COLOR [C,M,Y,B]
//—– For memory, between *: the doc name (“Blue”, “Magenta” …]
//—– In the book right order:
/*Blue*/ [50,0,0,0], // The 1rst file of the book
/*Magenta*/ [0,50,0,0], // The 2nd file of the book
/*Yellow*/ [0,0,80,0], // The 3rd file of the book
/*Green*/ [80,0,80,0], // The 4th file of the book
// …………………………………………………………………………………………………………
/*Red*/ [0,80,80,0]]; // The last file of the book
//————————————————————————-for (var d = 0; d < D; d++) {
var myFile = myBookContents[d].fullName.toString(),
myDoc = app.open(File(myFile)),
myColor = myDoc.colors.itemByName(“ChapterColor”);
myColor.colorValue = myColorValues[d];
myDoc.close(SaveOptions.YES);
}The script just modifies the values of the “ChapterColor” color in each doc and after having done it, saves and closes the file and continues with the next one!
(^/)
-
May 20, 2019 at 9:05 am #116608
Civi Bernath
ParticipantI see this post is old, but I hope I can still get an answer.
Every time I need to update the catalog in question I’m frustrated anew.
And I now have a second book with color coded chapters which needs to be updated annually. I’ll need to manually load style sheets there too, as I’m about to modify some of the style sheets.
I have the chapter color named identically in each chapter, but I can’t sync my style sheets across the book simply because the swatches sync as well, whether or not I have the swatches checked off.Michel, how would it help to use your script if I’m instructed to first sync the book? Once I sync the book, the swatches all become identical.
-
-
AuthorPosts
- The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
