PASTE Text as Sentences Divided by Line Feeds

I'm a newb, so please be kind :slight_smile: :bowing_man:

I want text that I copy to my clipboard to be pasted as full sentences separated by line feeds so it appears as every full sentence on its own line.

I figure I need to first remove any line feeds in the copied text, then search-and-replace every period-plus-empty-space (". ") with a line feed. (nb. the space after the period is so that it doesn't create line feeds for acronyms and abbreviations that contain a period).

I've created this Macro (mapped to "F6" as a hotkey) but it doesn't do anything when I run it:

STEP 1`
Search and Replace System Clipboard Using String:

Search: System Clipboard
For: String (ignoring case)
%LineFeed%

and replace with:
%Delete%

to: System Clipboard

STEP 2
Search and Replace System Clipboard Using String:

Search: System Clipboard
For: String (ignoring case)
.

and replace with:
%Delete%

to: System Clipboard

STEP 3
Paste

What am I doing wrong? Thanks!

Have you tried replacing linefeeds, in the first pass, with single spaces (rather than that %Delete% token) (to avoid running words together)?

Also (not sure about your workflow) but do you need to precede all of this with a copy action ?

It can help, before you get to the stage of pasting from an updated clipboard, to:

  • start by working with a different named variable for each stage,
  • and use a display action to inspect what is being produced.

sentenceList.kmmacros (20.4 KB)