Please help with this function that I want

Get help with using AutoHotkey and its commands and hotkeys
Wazowski
Posts: 59
Joined: 16 Jun 2015, 21:04

Please help with this function that I want

27 Jul 2019, 07:56

Hello,

I want to do this please watch the video

for a better understanding of what I want

https://streamable.com/uth8o
swagfag
Posts: 4005
Joined: 11 Jan 2017, 17:59

Re: Please help with this function that I want

27 Jul 2019, 08:33

Code: Select all

#NoEnv
#SingleInstance Force
SendMode Input
SetBatchLines -1

^b::surroundWith("*")
^i::surroundWith("_")

surroundWith(char) {
	clipSaved := ClipboardAll
	Clipboard := ""
	Send ^x
	ClipWait 1
	Send % Format("{Text}{1:}{2:}{1:}", char, Clipboard)
	Send % "{Left}+{Left " StrLen(Clipboard) "}"
	Clipboard := clipSaved
}
Wazowski
Posts: 59
Joined: 16 Jun 2015, 21:04

Re: Please help with this function that I want

27 Jul 2019, 09:39

@swagfag Ohh :clap: Excellent

will there be a way to make more instant?
swagfag
Posts: 4005
Joined: 11 Jan 2017, 17:59

Re: Please help with this function that I want

27 Jul 2019, 10:18

there are other nonportable, application-specific ways of manipulating text without relying on keystrokes or the clipboard that might be faster
COM automation, EM_GETSEL + WM_SETTEXT

Return to “Ask For Help”

Who is online

Users browsing this forum: DMDComposer, f1ster, Gushou, kjmcneil, Lecso0522, mmmax, TAC109 and 52 guests