Remove leading asterisks on multiline paste

I frequently paste text into Dynalist that uses an informal outline style with asterisks, e.g.

* One
  * Two
  * Three
* Four
  * Five
    * Six
  * Seven

This pastes nicely into Dynalist, creating the correct outline structure. However, the leading asterisks are still there, and they are kind of redundant once the outline is in Dynalist.

Would it be possible to filter these out when the text is pasted? I’ve also seen hyphens used where the asterisks are, but the only case I’m running into frequently myself is the asterisks.

I suppose if you wanted to get really fancy this could be configurable. Or maybe do it only on multiline pastes and not single line pastes.


Dynalist is not automating deleting these asterisks partially because we don’t want to assume it’s for it’s acting as a bullet point. The reasoning is in case it isn’t, we’re manipulating user data without consent. Also it’s probably a better idea to check that all the pasted items start with asterisk before assuming it’s acting as bullet points.

As you said, an option that’s turned off by default is probably our best bet. There are also many types of bullet points that people use: -, *, , , and many more if you’re pasting from Word. We’ll need to know about and catch most of them over time.

Typical problem for AutoHotkey.

; — CTRL ALT D: remove * and paste
StringReplace, OutputText, Clipboard, * , All
VarSetCapacity(OutputText, 0) ;free memory

; ========= CLIP(BOARD) FUNCTION ==========

; Call it without any parameters to retrieve the text currently selected.
; Var := Clip() ; store selected text in %Var%
; Or with text in the first parameter to “send” that text via the clipboard and Control+V.
; The two are analogous. Clip() is generally preferable for larger amounts of text
; Clip(“Some text”)
; SendInput {Raw}Some text ; Raw because when using Clip() keyboard combinations
; like ^s (ctrl+s) will be sent literally. SendInput {Raw} also does this.

Clip(Text=“”, Reselect=“”) ; , modified February 19, 2013
Static BackUpClip, Stored, LastClip
If (A_ThisLabel = A_ThisFunc) {
If (Clipboard == LastClip)
Clipboard := BackUpClip
BackUpClip := LastClip := Stored := “”
} Else {
If !Stored {
Stored := True
BackUpClip := ClipboardAll ; ClipboardAll must be on its own line
} Else
SetTimer, %A_ThisFunc%, Off
LongCopy := A_TickCount, Clipboard := “”, LongCopy -= A_TickCount ; LongCopy gauges the amount of time it takes to empty the clipboard which can predict how long the subsequent clipwait will need
If (Text = “”) {
SendInput, ^c
ClipWait, LongCopy ? 0.6 : 0.2, True
} Else {
Clipboard := LastClip := Text
ClipWait, 10
SendInput, ^v
SetTimer, %A_ThisFunc%, -700
Sleep 20 ; Short sleep in case Clip() is followed by more keystrokes such as {Enter}
If (Text = “”)
Return LastClip := Clipboard
Else If (ReSelect = True) or (Reselect and (StrLen(Text) < 3000)) {
StringReplace, Text, Text, `r, , All
SendInput, % "{Shift Down}{Left " StrLen(Text) “}{Shift Up}”
Return Clip()