Cleaning Text

Convert smart quotes to straight quotes on Mac

You can do this with Note My, and here is how to find every curly quote, en dash and stray invisible character a paste brought in, and turn them back into plain ASCII.

You pasted a line of prose into a shell script, a JSON file or a config, and now it will not run. The error is unhelpful — an unexpected token, an unterminated string. The cause is invisible at a glance: the quotation marks are curly rather than straight, or a hyphen has become an en dash.

This guide covers how to find those characters in a file in Note My, how to see exactly where each one sits, and how to convert them to straight ASCII in a single reversible step.

Why curly punctuation breaks code

The tools that read your file match exact code points. A straight double quote is U+0022, a straight apostrophe U+0027. Typographic punctuation is a different set of characters entirely:

The three smart-punctuation categories and the code points they cover
CategoryCode pointsConverted to
Smart quotesU+2018 to U+201F" or '
Smart dashesU+2013 en dash, U+2014 em dash-
EllipsisU+2026...

To a shell, ' opens a quoted string and ’ is just a character in a word. To a program reading JSON, a key wrapped in “ ” is not a string at all. The characters look near-identical in most fonts, which is why this costs people an afternoon.

The reverse is also true, and worth saying: in a README, a changelog or an email draft, curly quotes and em dashes are correct and you should keep them. That is why the conversion waits for you to ask for it, on the files where you actually want it.

What you type is what stays in the file

Start from a clean baseline. Note My never inserts smart punctuation. Automatic quote substitution, dash substitution, spelling correction and link and data detection are switched off in every mode, Plain Text prose mode included. Prose mode adds the system spell and grammar underlines, but those only underline words; they never change what you typed.

Paste is always plain text, which strips formatting and preserves the characters exactly as they were. So the curly characters arrived with the text — from a document, a web page, a chat window or an AI assistant's reply.

Find the ones already in your file

The review sheet is the tool for this. It covers the whole document or just the block you have selected, lists every curly quote, en dash, em dash and ellipsis with its exact line and column, and puts the whole list in front of you before it changes a thing. It all happens on your Mac — no account, no upload, nothing leaving the machine.

Two companion tools sit alongside it, each pointed at a different kind of character. Show Invisibles draws the whitespace — spaces, tabs and line endings, the marks you cannot otherwise see. A curly quote is a printing character that is already on screen in front of you, so the review sheet is the one that hunts it down.

The hidden-characters pill in the status bar is pointed tighter still. It covers the characters that are wrong wherever they turn up: zero-width characters, bidi controls, control characters and their relatives — the ones nobody types on purpose. A curly quote sits outside that set, because it is correct in a sentence and disastrous in a shell script, and only you know which of the two you are holding. So our hidden-character scanner reads Clean in green on a file full of them: it is answering its own narrow question and answering it precisely. The review sheet, where you tick the categories yourself, is the one that answers this question — and it is the better tool for it, because it lists every match with its position before anything moves.

Convert them

  1. Open the review sheet

    From the toolbar, open the Clean menu and choose Clean Invisible / Special Characters…. A sheet drops down over the document: a scope control and a preset pop-up along the top, the categories on the left, a findings table on the right.

  2. Set the scope

    The scope control offers Selection or Whole Document. Selection is safer when only one pasted block is affected — select it in the editor first, or the sheet reports "No selection in editor." Whichever you pick, the line numbers in the findings match the ones down the side of the editor, so you can jump straight to the character in question.

  3. Choose the Aggressive preset

    This is the step that matters. Aggressive is the preset that converts smart punctuation as well as listing it. Code-safe, the default, is the one that shows you where every curly quote sits and leaves the decision with you; Safe and Prose are tuned for other jobs. Switch the pop-up to Aggressive and the three punctuation categories come with it.

  4. Scan, and read the findings

    Press Scan. The left table fills in a count against each category; the right table lists every finding with Line:Col, the Code Point, the category, the Action that will be taken and a risk chip. Double-click a row to reveal that character in the editor, or select rows and press Show in Editor.

  5. Narrow it down if you want to

    Untick any category you do not want touched. Aggressive turns on everything in the list, which is more than most people mean by "fix my quotes" — leave smart quotes, smart dashes and the ellipsis ticked and clear the rest. Touching a checkbox flips the preset pop-up to Custom: you are simply no longer on a named preset.

  6. Apply

    Press Apply (N). Every ticked finding whose Action says it will be rewritten is rewritten, and the list refreshes so you can see what is left. One ⌘Z reverses the whole operation in a single step, under the entry "Clean Invisible Characters".

Warning

Under Aggressive, Apply reaches every ticked match inside the scope you set — curly quotes inside string literals and em dashes inside comments included. Set the scope to Selection when you want a narrower reach, and remember that ⌘Z takes the whole run back in one step.

How each preset treats smart punctuation

There are four presets, and each takes a different view of the three punctuation categories:

The four cleanup presets and their treatment of smart punctuation
PresetCategoriesSmart punctuation
Safe7Left exactly as typed
Code-safe (default)16Found and listed for you
Prose6Left exactly as typed
AggressiveAll 21Found and converted

Code-safe earns its place as the default by handing you the full inventory: every curly quote, en dash and ellipsis in the file, each with its line and column, each marked in the Action column as information for you to weigh. It is the preset for looking before you leap, and it is worth a pass on any file you have just pasted into. Once you have looked and decided, switch the pop-up to Aggressive and those same findings turn into a single press of Apply.

The caution is deliberate: the same three characters that ruin a shell script are correct typography in the paragraph above it. Only you know which you are holding, so our cleanup rules leave that call to you — every match is shown first, and nothing changes until you ask.

You can make Aggressive your standing default in Settings ▸ Text Cleanup ▸ Default preset. Pair that with a thought about Clean pasted text in the same pane: with both switched on, every paste would arrive with its punctuation already flattened, strings and comments included. Out of the box neither is set that way, so the findings are always yours to read first.

Two other routes to the same result

The review sheet is the careful route: you see everything before you commit. The two below trade some of that for speed.

A reusable removal rule

If this is a recurring job, put it in a rule. Open Clean ▸ Edit Removal Rules… for the window titled Residual Removal Rules. Eleven built-in rules cover zero-width characters, non-breaking spaces, soft hyphens, word joiners, separators and RTF residue. They stay exactly as they shipped, so they behave the same way on every Mac you use: switch one off when a document does not want it, or duplicate one and use the copy as the starting point for a rule of your own.

Press Add and write your own. A rule is a name, an ICU regular expression, a replacement template — an empty replacement deletes the match — and a few options. Three rules cover the job: a character class of the curly double quotes replaced with ", one for the single quotes, and one for the dashes. The Analyze panel gives per-rule match counts against the document or selection first, and an invalid expression turns the pattern cell red with the error as its tooltip.

Then Clean ▸ Clean Now applies every enabled rule across the document in one pass, and one ⌘Z takes the whole run back. This is the quick route, so lean on Analyze for your counts first and let it tell you what each rule will catch. Rules export and import as JSON, so a set you have tuned can move to another Mac.

Find and Replace

For a one-off, our find and replace is the shortest path. Paste the curly character into the find field and type a straight one into the replace field. Scope is This File or All Tabs; the options are Case Sensitive, Whole Word and Regular Expression, and with the last of those on, one character class handles every quote variant in a single pass. Use All Tabs when the same block went into several open files.

Note

The magnifying-glass button in the toolbar opens that pop-over, with the scope and options ready to set. ⌘F opens the system find bar, which is a separate control.

Take it across several files

One bad paste rarely lands in one place. The same block goes into the script, into the config it reads and into the note you were drafting alongside them. Two features carry the work across the set.

Find the affected files first. Search ▸ Find in Folder… (⇧⌘F) walks a directory tree and reports every match it finds. It only ever reads, so you can point it at an entire project without a second thought about what it might change on the way. Paste a curly quote straight into the search field and you get back a list of exactly which files are carrying them, ready to open.

Then work across your open tabs. Open the files the search turned up and Replace in All Files, in the find pop-over, covers every one of those tabs in a single press — useful when the same pasted block went into four files and you would rather not visit each one. For a rule-based sweep, run Clean ▸ Clean Now on a tab and the whole enabled rule set goes through that document at once. Because rules export and import as JSON, a set you have tuned once is a single file away from every other Mac you sit down at.

Tidy the AI residue while you are there. Clean AI Copy/Paste Markers is the companion command for text that came out of an AI assistant. It is deliberately conservative: it clears the artefacts that cannot change your visible rendering, wording, tone, punctuation, indentation or emoji structure, and anything that would need a human judgement is counted and reported for you to look at rather than acted on. Run it for the invisible residue, then run the review sheet under Aggressive for the punctuation, and the pasted text comes out both clean and unchanged in meaning.

Troubleshooting

Apply is greyed out and beeps when I click it

Switch the preset pop-up to Aggressive and press Scan again — that is the preset that converts as well as lists, and Apply lights up as soon as there is something to change. Under Code-safe the punctuation findings carry an information marker in the Action column, which is the app keeping its side of the bargain: it shows you every one, and it waits for you to say so.

The status-bar pill says Clean but the file is full of curly quotes

Correct, and expected. The pill flags characters that are wrong wherever they appear, and a curly quote is not one of those. Use the review sheet instead: it covers every category you tick, the three punctuation ones included.

The scan found nothing, but my script still fails

Check the other suspects on the same list. A non-breaking space (U+00A0) between two arguments, or a zero-width space inside an identifier, will break a script silently, and Code-safe covers both. Line endings are a different matter. The CRLF category is reported only where a document mixes CRLF and LF, and only Aggressive includes it; in a shell script it carries the danger chip, so it stands out in the findings and you know to act on it. For a file that is CRLF from top to bottom, the status bar's line-ending pill gives you the one-word answer, and File ▸ Line Endings ▸ Convert to LF settles the whole file from one menu.

It converted quotes inside a string literal I wanted left alone

Press ⌘Z and the whole Apply comes back in one step, string literals and all. Then select just the block you meant to change, set the scope to Selection, and run it again. Scope is how you aim the review sheet: under Aggressive it converts every ticked match inside the scope you hand it, so a tight selection makes it a precise instrument, and a stray conversion is always one keystroke from being undone.

What happens to emoji and accented letters

Emoji are protected. Emoji families, skin-tone sequences and flags come through Aggressive intact. Accented letters are treated finding by finding rather than by a blanket rule. Look-alike letters from other alphabets and combining marks are listed for you to read rather than changed, and Apply passes straight over them. Non-NFC clusters — an accent written the long way round, as a plain letter followed by a separate mark — work differently: each of those findings carries the composed form of that exact letter as its proposed fix, accent for accent, so ticking the category tidies the spelling without touching anything else. Aggressive arms it along with the rest, so if you came here purely for the punctuation, clear that one and the run goes ahead without it. The Action column tells you, finding by finding, exactly what would happen to that character, so read down it before you apply anything to text with accents in it.

Frequently asked questions

Does Note My ever turn my straight quotes into curly ones?

What you type is what stays in the file. Quote substitution, dash substitution, automatic spelling correction and link and data detection are switched off in every mode, prose mode included, so a straight apostrophe you typed at nine in the morning is still a straight apostrophe when you save at six. It never reformats your text behind your back.

Why does an em dash become a single hyphen?

Because the smart-dashes category converts both U+2013 and U+2014 to a single -. Where the text was a command-line flag that wanted --, our find and replace puts the second hyphen back across the whole file in one press: search for the flag as it now reads, replace it with the double-hyphen form, and set the scope to All Tabs if the same block went into several files.

How do I see exactly where each curly quote sits?

The review sheet lists every one with its line and column, and marks it in the editor with an underline beneath the character itself, so you can read it in context before deciding. Double-click a row to jump straight to it. Show Invisibles is the companion toggle for whitespace — spaces, tabs and line endings.

How do I handle the same bad paste in several files?

Use Find in Folder to see which files across a directory tree are carrying the characters — it is non-destructive by design, so searching a project can never alter it. Open the files it turns up, then Replace in All Files covers every open tab in one press. For a rule-based sweep, run Clean Now on each tab in turn.

Where do I find the hidden-character commands?

Find Next Hidden Character and Find Previous Hidden Character live in the Clean pull-down menu in the toolbar, alongside the review sheet and the rule editor, so the whole cleanup kit sits behind one button. Go to Next is also a row in the status-bar pill's pop-over, which is the quickest way to walk a file character by character.

Does any of this send my file anywhere?

No. Nothing is uploaded, there is no account, and your files never leave the machine. Every scan and every replacement happens on your Mac.