Block certain words from copying

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Shanghei
Posts: 28
Joined: 04 Jan 2021, 22:42

Block certain words from copying

06 May 2021, 11:52

Hello all, I was wondering if there was way to add certrain wordst to be blocked from copying for instance,

"hello world"
I dont want the word world to be copied from that phrase is there way to add certrain words to not be copied? Thank you all very much!
User avatar
Onimuru
Posts: 107
Joined: 08 Sep 2018, 18:35
Contact:

Re: Block certain words from copying

06 May 2021, 12:09

You can do it like this:

Code: Select all

OnClipboardChange("BaitAndSwitch")

BaitAndSwitch(type) {
	if (type == 1) {  ;* Clipboard contains something that can be expressed as text.
		Static switch := "i)WORLD"  ;* "i)word1|word2|..."

		Clipboard := RegExReplace(Clipboard, switch)
	}
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Askeron52, Bing [Bot], JnLlnd, Mycroft-47, Rohwedder and 149 guests