# Is it possible to add a horizontal line to apple notes on a mac?

On MacOS I see ways to enter checklists and tables but no way to enter a horizontal line. Is this possible to do?

• Wow, the amazing thing is, that with all the answers below, the right thing would be for Apple just add the <hr/> to the Notes > Format menu, just above the Table. I would suggest it to Apple right now... – Lucifer Morningstar Sep 13 '19 at 13:34

I'd like to see this as an actual formatting option too… but it seems unlikely to come any time soon. Experimenting with various Unicode line characters (like ―) or a series of em dashes (opt + shift + dash) is not a great solution as the width of the "line" doesn't change with the width of the note window. And if you squeeze the window width narrower than your faux line, it will wrap. Ugh!

Here's the best workaround I've come up with (it ain't perfect, but it works for me!):

1. In Photoshop (or similar), make a new document of somewhere in the neighborhood of 2400 pixels wide by 6 pixels high.

2. Fill it with black.

3. Save as a .jpg (or .gif, or .png… it doesn't really matter) in a place that you'll have easy access to, like your Desktop.

4. In Notes, put the cursor on a new line where you would want the horizontal line to go.

5. Click to select the file you saved to your desktop, and copy it to your clipboard (command + c).

6. Head back to Notes and paste it in (command + v). You'll end up with something like this:

What's nice here is as you adjust the width of the window, the horizontal line image will always span the full width:

You'll notice that the height of the line also changes proportionally with the window width… so you'll have to experiment with a size that works for you. 2400 x 6 seems to work for me. Here's a link to the file that I'm using, if you want to give it a try (right-click to download):

https://i.imgur.com/bcnfe7K.jpg

BONUS PRO TIP: If you're using TextExpander (or similar) make a new snippet that inserts this line graphic so you don't have to do steps 5 and 6 (above) every time. I've got mine set to -----. Adding the horizontal line with this shortcut has become second nature.

If you do not have TextExpander (or similar) to make a new snippet that inserts this line graphic so you don't have to do steps 5 and 6 above, you can create an Automator service as shown in the image below using the following example AppleScript code:

property hLine : (path to pictures folder as string) & "hLine.jpg"

set the clipboard to (read (hLine as alias) as JPEG picture)
delay 1
tell application "System Events" to keystroke "v" using command down

• As coded, the linked "bcnfe7K.jpg" was saved in the Pictures folder within the Home folder as "hLine.jpg", so adjust it in the example AppleScript code as necessary.

Then assign it a keyboard shortcut, as in the image below, I used ⌘L as it was not assigned in Notes.

Now to insert the horizontal line in Notes, set the cursor where you want the line and press: ⌘L

Note: The example AppleScript code is just that and does not employ any error handling and is meant only to show one of many ways accomplish a task. The onus is always upon the User to add/use appropriate error handling as needed/wanted.

• I added an Automator Service to your answer, which by the way is an excellent answer. +1 – user3439894 Feb 26 '18 at 15:32
• Wish I could upvote this more than once – Zaki Aziz Feb 26 '18 at 18:25
• @Xecure True, you can only upvote once… but you can still mark it as the solution. wink – Sam Feb 26 '18 at 19:38
• @Xecure, While you can only up vote a question once, you can also choose to click the check mark thus making this the accepted answer, if you so choose. – user3439894 Feb 26 '18 at 20:22
• Bonus points go to whomever can get something like this working on iOS! – Sam Feb 27 '18 at 2:11

Hold down the hyphen key on the keyboard. When you let off, the dashes will draw in as a solid line.

• This is the correct answer – Lester May 5 '20 at 6:33
• That just uses a built-in option for using "smart quotes and dashes" to convert hyphens into em-dashes, and it will cause the wrapping of the line already described if you should narrow the window. – user180941 Apr 3 at 16:53

There is a solution to add a horizontal line by just using a keyboard shortcut that triggers Automator to type a line of underscores for you. It works well, and it would be great if the keystroke animations were removed when pressing the shortcut!

Check this brilliant answer at macrumors.com by chown33 (note that the steps below were written for OS X 10.8.4 Mountain Lion so test it accordingly):

The main phases of a solution are:

1. Make a Service in Automator that types '_' your desired number of times.
2. Assign a Keyboard Shortcut to the Service using System Preferences.
3. Test it.

Phase 1 : Make a Service in Automator

1. Launch Automator.app.
2. Choose "Service" from the "Choose a type for your document" dialog.
3. Add a "Run AppleScript" action to the workflow.
4. Paste the following AppleScript into the action: Code:

tell app "System Events" to keystroke "_______________________"


The pasted-in AppleScript should completely replace the template AppleScript that automatically appears in the "Run AppleScript" action. That means you click in the box of the action, choose Select All from the Edit menu (⌘A), then delete everything. Optional: you can increase the length of the __ string.

5. At the top of the workflow, set the popups to show: Service receives no input in any application
6. Save the Service (⌘S), and give it a name.

Phase 2 : Assign a Keyboard Shortcut in System Preferences

1. Launch System Preferences.
2. Choose the Keyboard pane, then click the Keyboard Shortcuts tab.
3. Two side-by-side lists will appear.
4. Choose Services in the left-hand list. The right-hand list will show the available Services.
5. Scroll down the list until you see the name you gave your Service. It will probably be under the General heading.
7. Click its "add shortcut" button, then press your desired key combination to assign it a keyboard shortcut (the key combination must be unique).

Phase 3 : Test it

1. Launch Mail.app.
2. Click the Mail menu, then move down to the Services hierarchical menu.
3. Does your named Service appear in the menu items?
4. Does your named Service have its assigned keyboard shortcut?
5. Create a new message (⌘N).
6. Click in the body of the new empty message.
7. Press the keyboard shortcut.
8. Is the series of _'s correctly added to the message?

I find myself often needing to write a date before the divider line. Inspired by @Muthu's answer, I made the following Applescript:

on run {input, parameters}
set _Date to short date string of (current date)
tell application "System Events"
keystroke _Date
keystroke return
keystroke "-------------------------------------------------------"
keystroke return
end tell
end run


Assigning this service a shortcut, it outputs something like:

2019-04-07
-------------------------------------------------------


You can define the line as long as you want.

Picking up on Sam's and bmike solution, I did not wanted to have a reference to a static file on disk. So I used openssl to base64 encode a 2400pxX1px image line and changed their script little bit.

set base64line to "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB
AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEB
AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB
AAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIh
MUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6
Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZ
mqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx
8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
AgECBAQDBAcFB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gAoAKACgAoAKACgAoAKAP/9k=
"

set filen to "/tmp/line" & (time of (current date)) & ".jpg"
set decoded to do shell script "openssl enc -base64 -d <<< '" & base64line & "' > " & filen
set the clipboard to (read (filen) as JPEG picture)
delay 1
tell application "System Events" to keystroke "v" using command down
do shell script "rm " & filen