How do I edit (character) styles quicker?

For paragraph styles:

  1. click a paragraph with the style
  2. Alt+P

(●’◡’●)
For character styles:

  1. select characters with the style
  2. F11
  3. select character styles
  4. right click the stlye
  5. Modify

???

???
Alt+P is not an assigned Writer shortcut. Then it is an OS one. You didn’t mention your OS, nor LO version.
I assume this shortcut points to Format>Paragraph which is not a request to modify a paragraph style. It will add direct formatting over the paragraph style.

The only way to modify styles (any category) is to right-click on the name in the side style pane and Modify.

In principle, style customisation is a rare operation if your style set is well designed. And once you’re satisfied with it, record it in a personal template and base your future documents on this template.

No, then it is an assigned LibreOffice shortcut :wink:

2 Likes

I just tested it:
I can assign the “Character (properties)” to a hotkey, but I can not assign the “Character (style)”: there is not such option in the Customize feature of my LO 7.5.7.

1 Like

Why should modifying a (character) style be “quicker”? No technical problems in implementing a command calling the character style properties dialog for any given style; but why?

This idea contradicts the basic ideology of working with styles. There should be no need in frequent modifications to styles in a sensible workflow. And for infrequent modifications - the current means are adequate.

First, let’s me define some terms.

Things like color, font, font-size, etc. are known as “attributes”. “Styles” apply multiple attributes at one time.

To apply a character style, do the following:

Have the Character Styles deck open in the Sidebar. Select the characters in the document that you want to style. Double-click on the style in the Sidebar that you want to apply.

If you want to apply attributes not offered by any of the default character styles listed, you can modify a default character style’s attributes. Better yet, create your own character style in the Character Style deck of the Sidebar giving it the attributes you want to use. This is especially useful if you apply the same attributes often. If you begin the name of your new character style with an underscore (_My Character Style), your style will appear at the top of the list and be easier to find.

3 Likes

Yes, but this is a wrong approach because it masks certain interesting properties of styles.

When you have a consistent collection of styles, these are organised in “families”. As an example, take all paragraph styles names Heading n. They are all grouped under a common ancestor Heading. When you request Hierarchical view of the style side pane, styles are shown in a tree-like manner where each branch can be expanded or shrinked to leave only those of interest.

There is another view which is closer to your need, Applied. It is of prime interest in existing documents where it is unlikely you’ll use new styles. In new documents, it needs some “warmup” until your preferred styles are used in text. Then the list has settled to its definitive state (but styles are listed alphabetically, not in logical family as in the hierarchical view).

The view to choose depends in the end on your workflow. With semantic styling, it is preferable not to try to trick Writer with fancy names as this will conflict the goal of describing the applied significance.

Here is a solution by usage the macros (the StarBasic, the API and the Dispacther)

EditStyle.odt (25.9 KB)

REM  *****  BASIC  *****

option Explicit



Sub EditCharStyle
	
 dim oDoc as object
 dim oFrame as object
 dim oDispatcher as object
 dim oCurrSel as object
 dim oOneSel as object
 dim oStyles As Object 
 dim oOneStyle As Object
 dim iSelCount as integer
 dim iFamily as integer
 dim i as integer
 dim sStyleName as string
 dim sDisplayName as string
 dim args2(1) as new com.sun.star.beans.PropertyValue

	oDoc = ThisComponent
	oStyles = oDoc.StyleFamilies.getByName("CharacterStyles")
	oFrame = oDoc.CurrentController.Frame
	oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
	oCurrSel = oDoc.getCurrentSelection()
	iSelCount = oCurrSel.Count
	If iSelCount > 1 then 
		MsgBox("Please create one selection only.")
		exit sub
	end if
		
	oOneSel = oCurrSel.getByIndex(0)
	sStyleName = oOneSel.CharStyleName 'get the name of the applied Chareacter style
	If sStyleName = "" then
		MsgBox("The selected text: " & Chr(13) & "' " & oOneSel.String & " '" & Chr(13) & " has not (a single/any) character style")
		exit sub
	end if
	iFamily = 1
	oOneStyle = oStyles.getByName(sStyleName)
	sDisplayName = oOneStyle.DisplayName
	args2(0).Name = "Param"
	args2(0).Value = sDisplayName
	args2(1).Name = "Family"
	args2(1).Value = iFamily
	oDispatcher.executeDispatch(oFrame, ".uno:EditStyle", "", 0, args2())

end sub
'____________________________________________________________________________