Reputation: 2876
I am using AutoHotKey software to change the use of some buttons. It helps a lot especially if you want to open programs without having to find the shortcuts and click on them.
All I want now is to save a specific text (with paragraphs) in some F keys. For example, every time I click the F5 key, I want this text to be pasted: "Hello. My name is Apolo. Bla bla bla."
So, I put this line in the AutoHotKey program:
F5::Send Hello. My name is Apolo. Bla bla bla.
My problems are:
01) It does not work when my text has paragraphs.
02) The paste procedure is really slow. (2-3 secs at least)
My questions are:
01) Is the AutoHotKey a good choice? Or is it better using another software or even scripting? And which is the best/simplest for this purpose?
02) Yes or no, I would still like to see if I can make this work with the AutoHotKey software.
Having to copy paste the same text (3 different versions) too often, takes time. So, this solution will make my life easier.
Upvotes: 0
Views: 740
Reputation: 1719
You can do this just fine with AHK. Use a continuation section (check out Method #2) section and SendInput
.
myText =
(LTrim
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Donec eleifend ultrices metus, a auctor tellus vulputate eu. Praesent sed quam vitae tortor venenatis tempor. Duis a
pretium eros. Integer egestas blandit diam at porta. Vestibulum blandit nunc in metus eleifend,
at rutrum ipsum cursus. Integer auctor, lorem congue tempor condimentum, dui lorem mollis risus, ut aliquam metus
leo nec urna. Proin id turpis nisl. Nulla dapibus, leo at euismod vestibulum, magna metus faucibus dui, at sodales orci dui vitae erat.
Sed id diam eros. Maecenas tincidunt sodales tortor, vel porta ipsum condimentum vel.
Aenean volutpat fermentum iaculis. Nunc dignissim est eget tempus venenatis. Fusce cursus,
neque nec volutpat tincidunt, mi dui iaculis magna, a consectetur velit dolor non dolor.
)
F5::SendInput, %myText%
Alternative solution using Clipboard
and pasting the text.
myText =
(LTrim
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Donec eleifend ultrices metus, a auctor tellus vulputate eu. Praesent sed quam vitae tortor venenatis tempor. Duis a
pretium eros. Integer egestas blandit diam at porta. Vestibulum blandit nunc in metus eleifend,
at rutrum ipsum cursus. Integer auctor, lorem congue tempor condimentum, dui lorem mollis risus, ut aliquam metus
leo nec urna. Proin id turpis nisl. Nulla dapibus, leo at euismod vestibulum, magna metus faucibus dui, at sodales orci dui vitae erat.
Sed id diam eros. Maecenas tincidunt sodales tortor, vel porta ipsum condimentum vel.
Aenean volutpat fermentum iaculis. Nunc dignissim est eget tempus venenatis. Fusce cursus,
neque nec volutpat tincidunt, mi dui iaculis magna, a consectetur velit dolor non dolor.
)
F5::
Clipboard := myText
SendInput, ^v
return
Upvotes: 2