You will see that the current paragraph style is [Basic Paragraph] but it has an override.
If you click on the listing for [Basic Paragraph] your text will revert back to its default styling.
TAKE ADVANTAGE OF [BASIC PARAGRAPH]
To add text styles to your document you have the following options:
- Create styles from scratch
- Import text styles from another document
Most designers will base much of a document’s styling on a particular font family using Size, Alignment, Font Style (italic, bold, etc.) to provide styling variance. For this reason these text styles are often based on a common style or [Basic Paragraph].
If the settings for the body text in your new document is to be different than that for the Application’s [Basic Paragraph], you will want to set the Font Family, Point Size, Font Style, and Alignment for this style. Assign Font Family and basic styling properties to the [Basic Paragraph] paragraph style as needed for the document’s body text (Regular 10 pt on 12 leading, left justified or otherwise).
This could be done using the following script which allows the user to choose from a list of commonly used fonts (add more to the list as needed.)
(*List of commonly used fonts for body or default text
Assumes an open document exists*)
set fontList to {"Baskerville", "Adobe Caslon Pro", "Garamond", "Palatino", "Tahoma", "Times New Roman", "Warnock Pro"}
set userChoice to choose from list fontList with prompt "Select font family"
if userChoice is not false then
set selectedFont to item 1 of userChoice
else
display alert ("User cancelled")
return
end if
tell application "Adobe InDesign CC 2018"
set docRef to document 1
set fontRef to font (selectedFont & tab & "Regular")
tell applied paragraph style of text defaults of docRef
set applied font to fontRef
set x to applied font
set point size to 10
set leading to auto
set auto leading to 1.2
set justification to left align
end tell
end tell
CREATING PARAGRAPH STYLES
In Setting up paragraph styles you may want to name your styles based on Microsoft Word’s and/or Google Doc’s naming convention. Google Doc’s export to Microsoft Word includes the following styles by default:
- Title
- Subtitle
- Normal (body copy)
- Heading 1, Heading 2, etc. up through Heading 6
This is a fair number of styles to set up, so let’s look at some ways we can automate the process.
Using Based On
When you base a paragraph style on another, it inherits all of its styling with the exception of any properties set in the new style. Basing a paragraph style on another style eliminates a lot of having to define settings otherwise. Styles such as Normal, Body, Caption, and even most of the Heading styles can be based on [Basic Paragraph].
For this you could create your own text styling script for setting basic styling attributes for stying a standard list of styles similar to that shown below. This script is pretty self-explanatory. Notice that the list for the variable paraList is a list of lists. Each list within the list includes the name, point size, leading, style, and alignment for a style. Alignment, which is a numerical value, represents: “Left” (1), “Left Justified” (2), “Center” (3). “Right” (4), “Away Binding Side” (5). The script also sets character styles for “Bold”, “Italic”, and “Bold Italic”.
Text Styles
(*Assumes a current document exists*)
set paraList to {{"Title", 30, 30, "Normal", 1}, {"Normal", 12, 14, "Regular", 2}, {"Heading 1", 30, 30, "Regular", 3}, {"Heading 2", 24, 24, "Regular", 3}, {"Heading 3", 18, 18, "Regular", 3}, {"Heading 4", 14, 14, "Bold", 1}, {"Heading 5", 14, 14, "Italic", 3}, {"Heading 6", 10, 10, "Italic", 3}}
set charList to {"[None]", "Bold", "Italic", "Bold Italic"}
tell application "Adobe InDesign CC 2018"
set measurement unit of script preferences to points
set stylingList to {left align, left justified, center align, right justified, away from binding side}
tell document 1
set baseStyle to paragraph style 2
repeat with eachItem in paraList
set theName to item 1 of eachItem
set alignIndex to item 5 of eachItem
set myAlignment to item alignIndex of stylingList
if not (exists paragraph style theName) then
set theStyle to make paragraph style with properties {name:theName, based on:baseStyle, point size:item 2 of eachItem, leading:item 3 of eachItem, font style:item 4 of eachItem, justification:myAlignment}
if name of theStyle is "Normal" then set first line indent of theStyle to item 3 of eachItem
end if
end repeat
repeat with i from 2 to length of charList
set theName to item i of charList
if not (exists (character style theName)) then
make character style with properties {name:item i of charList, font style:item i of charList}
end if
end repeat
end tell
end tell
Notice that [Basic Paragraph] style in AppleScript is paragraph style 2 of the document; [No Paragraph Style] is paragraph style 1.