How to copy without formatting with Ctrl+Alt+C in AutoHotkey

autohotkeykeyboard shortcuts

I'm trying to use AutoHotkey to define a keyboard shortcut such that if I press these three keys simultaneously: Ctrl+Alt+c, AutoHotkey would copy the selected text without formatting to the clipboard.

Does AutoHotkey support this? If so, how? Most of what I have seen in the documentation at the official website relies on keyboard shortcuts made of two keystrokes, e.g.:

LControl + LAlt:: 
; Do something

Is there a way to do this with three keys? Also, how could I copy and remove the formatting from the selected text?

Best Answer

See How to combine three keys as a hotkey with Autohotkey? for the first half of your question.

As far as stripping formatting, it looks to be possible with something like this (from this Stack Overflow question):

Send ^c
clipboard = "%clipboard%"
; Remove space introduced by WORD
StringReplace, clipboard, clipboard,%A_SPACE%",", All

There's also this AutoHotkey forum post about it.

EDIT: The following is in the AutoHotkey documentation on Clipboard, ClipboardAll, and OnClipboardChange:

clipboard = %clipboard% ; Convert any copied files, HTML, or other formatted text to plain text.

Related Question