Script to Map Paragraph Style Sheets
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Script to Map Paragraph Style Sheets
- This topic has 4 replies, 3 voices, and was last updated 5 years, 1 month ago by Luiz roberto Lucio correa.
-
AuthorPosts
-
-
August 17, 2018 at 11:57 am #109828Vatrice ChestnutParticipant
I have completed the InDesign layout for a study guide. It includes instructional content, practice questions and answers. From the guide file, I need to create two additional InDesign files—one for practice questions and one for an answer key.
Is there a script I can use to map the paragraph style sheets from the study guide document to the practice test document? And then a script to map the paragraph style sheets from the study guide document to the answer key document?
There might be a third option I haven’t considered so I am open to hearing it. I need to automate this process as much as possible to reduce production costs.
-
August 25, 2018 at 8:21 am #110095Anne-Marie ConcepcionKeymaster
I’m not sure what you mean, Vatrice. I know it’s been a while since you posted, but if you’re still looking for help, could you explain a bit more? Why do you need to map styles, why not just do a Save As and create your second and third files so that the styles come along? Or create your new files and choose Load All Styles from the Paragraph Styles panel menu to import them?
AM
-
August 27, 2018 at 7:13 am #110112Vatrice ChestnutParticipant
Hi Anne-Marie,
I am working on a practice test document. The template is an eBook. The original file is the print version.To start my process, I import the styles from the template into the eBook file. Then I copy and paste the text from the print version into the eBook template. After doing so, I still have to manually apply paragraph styles to the content.
I thought I might have a better outcome if I mapped the print version paragraph and character styles to the eBook template paragraph and character styles.
Thanks for your help,
-
February 22, 2019 at 11:30 am #114613
//DESCRIPTION: List paragraph styles in their style
(function() {
if (app.documents.length > 0) {
processDocument(app.documents[0]);
}
function processDocument(aDoc) {
var page = aDoc.pages[0];
var bounds = page.bounds;
var theTF = page.textFrames.add({geometricBounds: bounds});
var theStory = theTF.parentStory;
theTF.move(undefined, [bounds[1] – bounds[3], 0]);
var paraStyles = aDoc.allParagraphStyles.sort();
for (var j = 0; paraStyles.length > j; j++) {
theStory.insertionPoints[-1].contents = paraStyles[j].name;
theStory.paragraphs[-1].appliedParagraphStyle = paraStyles[j];
theStory.insertionPoints[-1].contents = “\r”;
}
}
}()) -
February 22, 2019 at 11:31 am #114614
go to a first page of document and run script.
A list apears on pasteboard.
-
-
AuthorPosts
- You must be logged in to reply to this topic.