Please help with this function that I want

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Wazowski
Posts: 72
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: 6222
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: 72
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: 6222
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 (v1)”

Who is online

Users browsing this forum: Billykid and 195 guests