PURPOSE: Paste a Horizontal Line in any Rich Text App
• Approach/Method Changes based on App
• Now supports MS Word, TextEdit, Evernote, Outlook 2011
• NEED SCRIPT for Apple Pages
INSTALL / SETUP
(1) See Setup Instructions in below Comments for each app
HOW TO USE:
(1) In any Rich Text app, position cursor on a blank line where you want the horiz. line
(2) Run this macro.
REQUIRES:
(1) Keyboard Maestro Ver 7.0.3+
(2) Yosemite (10.10.5)+
(3) Safari (only for setup)
(4) KM Macro: [KM] DELETE List of KM Variables [SUB-MACRO]
Place your cursor in the paragraph (but do not select any text) for which you want the line/rule to appear below
then select Format > Borders and Shadings
insert a “line below” the paragraph
(use the “Apply to: Paragraph” dropdown).
This line is integral to the paragraph and the separation to the text above it can be controlled in the dialog (the Options button) or dragged vertically in the document.
I’m sure you could automate this using a KM macro, and use the appropriate method based on the frontmost app.
You can add this VBA macro to your MS Word Normal template, and it will be available to ALL documents. You can assign a Word shortcut key to it, or execute the VBA macro from AppleScript, which you could embed in a KM macro.
Sub Horizontal_Line()
'
' Horizontal_Line Macro
'
'
With Selection.ParagraphFormat
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
With .Borders(wdBorderBottom)
.LineStyle = wdLineStyleSingle
.LineWidth = wdLineWidth050pt
.Color = wdColorAutomatic
End With
With .Borders
.DistanceFromTop = 1
.DistanceFromLeft = 4
.DistanceFromBottom = 3
.DistanceFromRight = 4
.Shadow = False
End With
End With
With Options
.DefaultBorderLineStyle = wdLineStyleSingle
.DefaultBorderLineWidth = wdLineWidth050pt
.DefaultBorderColor = wdColorAutomatic
End With
End Sub
I’m looking forward to trying that new version. I want it for Evernote because I use KM to append and prepend data to notes in EN, and I much prefer to have KM insert a horizontal rule than a string of hyphens between them.
I had been using Paste by Typing to include named clipboard contents and the horizontal rule. It was so simple that I could omit the horizontal rule from there, switch to EN, and send a the keyboard command, that I missed it. Thanks for pointing it out to me. I’m much happier with my EN macros now!