Page 1 of 1

"Put Text in Quotes", seemingly not working in all contexts

Posted: Nov 2nd, ’19, 19:12
by Oblomov
I'm trying to use "Put Text in Quotes" from Library

Code: Select all

SavedClip := ClipboardAll
Clipboard =
Send ^{vk43} ;Ctrl C
ClipWait 1
Tmp:=Clipboard
Tmp = "%Tmp%"
; Remove space introduced by WORD
StringReplace, Tmp, Tmp,%A_SPACE%",", All
Clipboard =
Sleep 20
Clipboard := Tmp
Send ^{vk56} ;Ctrl V
Sleep 100
Clipboard := SavedClip
However, it doesn't seem to work within the search box of OneNote, where the quotes makes it so that OneNote performs a more focused search, something I use very frequently:

Image

Is there perhaps some way to fix this perhaps?

Re: "Put Text in Quotes", seemingly not working in all contexts

Posted: Nov 2nd, ’19, 19:30
by Tom
Try to insert another Sleep 100 after Clipboard:=Tmp.
:?:

Re: "Put Text in Quotes", seemingly not working in all contexts

Posted: Nov 2nd, ’19, 21:15
by Oblomov
Tom wrote: Nov 2nd, ’19, 19:30 Try to insert another Sleep 100 after Clipboard:=Tmp.
:?:
Didn't seem to help, unfortunately 😔

Re: "Put Text in Quotes", seemingly not working in all contexts

Posted: Nov 4th, ’19, 16:42
by Tom
How about this?

Code: Select all

send, ^c
sleep 200
Send % "" clipboard ""

Re: "Put Text in Quotes", seemingly not working in all contexts

Posted: Nov 4th, ’19, 21:35
by Oblomov
Tom wrote: Nov 4th, ’19, 16:42 How about this?

Code: Select all

send, ^c
sleep 200
Send % "" clipboard ""
As a standalone command? Doesn't seem to work either unfortunately :/

Re: "Put Text in Quotes", seemingly not working in all contexts

Posted: Nov 4th, ’19, 21:51
by Oblomov
Tom wrote: Nov 4th, ’19, 16:42 How about this?

Code: Select all

send, ^c
sleep 200
Send % "" clipboard ""
Figured it out by accident 💡

What I did was remove

Code: Select all

Sleep 100
Clipboard := SavedClip
From the original:

Code: Select all

SavedClip := ClipboardAll
Clipboard =
Send ^{vk43} ;Ctrl C
ClipWait 1
Tmp:=Clipboard
Tmp = "%Tmp%"
; Remove space introduced by WORD
StringReplace, Tmp, Tmp,%A_SPACE%",", All
Clipboard =
Sleep 20
Clipboard := Tmp
Send ^{vk56} ;Ctrl V
Sleep 100
Clipboard := SavedClip

Re: "Put Text in Quotes", seemingly not working in all contexts

Posted: Dec 14th, ’19, 20:17
by Oblomov
Hm, no longer working it seems 😔

Re: "Put Text in Quotes", seemingly not working in all contexts

Posted: Dec 14th, ’19, 20:23
by Oblomov
Oblomov wrote: Dec 14th, ’19, 20:17 Hm, no longer working it seems 😔
Alright, so finally, I managed to get it working from

https://autohotkey.com/board/topic/6688 ... cted-text/

Albeit, there, it of course doesn't work either, unless edited to be exactly the following

Code: Select all

Clipboard="%Clipboard%"
Send, ^v
Kind of boggles the mind, when something so... ah, who cares

Re: "Put Text in Quotes", seemingly not working in all contexts

Posted: Dec 24th, ’19, 14:56
by Oblomov
Michel10 wrote: Dec 24th, ’19, 07:55
Oblomov wrote: Nov 2nd, ’19, 19:12 I'm trying to use "Put Text in Quotes" from Library

Code: Select all

SavedClip := ClipboardAll
Clipboard =
Send ^{vk43} ;Ctrl C
ClipWait 1
Tmp:=Clipboard
Tmp = "%Tmp%"
; Remove space introduced by WORD
StringReplace, Tmp, Tmp,%A_SPACE%",", All
Clipboard =
Sleep 20
Clipboard := Tmp
Send ^{vk56} ;Ctrl V
Sleep 100
Clipboard := SavedClip
However, it doesn't seem to work within the search box of OneNote, where the quotes makes it so that OneNote performs a more focused search, something I use very frequently:
Image

Is there perhaps some way to fix this perhaps?
HI, I think maybe I have a way for that, if you want
Sure! Would be interested in knowing

Currently using

Code: Select all

Send, "
Clipboard= %Clipboard%
Send, ^v
Send, "
Which works better than the one in my last post, although doesn't get saved in the clipboard, which can probably be fixed with a quick ^a and ^c

Re: "Put Text in Quotes", seemingly not working in all contexts

Posted: Jan 7th, ’20, 18:40
by Oblomov
But yeah, the aforemention command is working fine most of the time, but sometimes, it definitely triggers other macros, and royally messes up my stuff. Happens 1.5/20 times, so it's not too bad, but I use it super often, so yeah