Autohotkey to paste multiple email blurbs - autohotkey

I am using autohot keys to send the email blurbs (with multiple sentences) using unique text command with SendInput. However it is sending the instruction word by word and taking a lot of time to send all the text in blurb.
I want know is there any clipboard tool available in AHK where i can store multiple blurbs (each blurb contains more than 3 rows of sentences) and paste the blurbs by pressing unique text command associated to each blurb. It should work similar to the Magical - Text Expander & Autofill extension in chrome.

Related

Send TAB in authotkey after every (letter)keypress regardless of language setting

I'm trying to make filling some web-forms easier. Each form might include 100 times that tab would have to be pressed after typing a letter to be able to input the next letter to it's corresponding slot. I tried some examples, but ran in to problems when changing Windows language settings to Russian. Most of the time I will be inputting Russian letters, and if not, then just normal latin letters.
I tried following basic examples which worked for either one letter at a time or all (latin) letters at once.
#UseHook On
w::send ш{Tab}
Which outputs
ш(and one single TAB taking me to the next input)
So for some reason the characters are not correctly output from AHK.
This other example I found here and it works fine for any latin letter after a small modification:
https://autohotkey.com/board/topic/67948-detect-any-letter-key-press/
Loop 26
Hotkey, % Chr(A_Index+96),LatinLabel ;loop creating hotkeys for a-z
Return
LatinLabel:
Func(A_ThisHotkey)
Return
Func(var) {
#UseHook On
Send %var%{TAB}
}
I read that listening for all keypresses or actions would not be ideal, since this would also record mouse clicks and even movement.
So are there other alternatives googling didn't reveal to me?
Are you having problems with sending Unicode characters?
For the euro symbol I use either of:
SendInput {U+20AC}
PostMessage, 0x102, 8364, 1, Edit1, A ;WM_CHAR
The problem of ш becoming ш is due to the script file having been saved as UTF-8 without BOM. You just need to save the file as UTF-8 with BOM. AutoHotkey (as of v1.1.30.03) interprets files without a BOM as ANSI, because the default editor is Notepad, and Notepad (prior to Windows version 1903) defaults to ANSI.
The second script registers hotkeys a-z via the expression Chr(A_Index+96), which produces latin letters. Once registered, these hotkeys will activate when you press the corresponding virtual keys even if you change the keyboard layout. However, they will still send latin letters, because A_ThisHotkey is a-z.
The solution is to use the ~ hotkey modifier instead of sending the hotkey. In that case, pressing the key has whatever effect it should normally have, then the script sends Tab.
Loop 26
Hotkey % "~" Format("vk{:02x}", A_Index+64), AzKey
return
AzKey:
Send {Tab}
return
This registers hotkeys for the virtual keys vk41 - vk5A, which correspond to A - Z on layouts which contain those characters, but also work with other layouts. However, there may be some other keys which produce "letters" or other characters you want to watch for; in that case, just register additional hotkeys as needed.
Hotkey ~vkC0, AzKey
or stack the labels
vkC0::
AzKey:

AHK Sending a TXT file as typed out text

am using AHK to publish boilerplate e-mail body texts in our company. Our employees use various webmail, and other mail so managing templates is impossible. So comes AHK. We have created scripts to publish this with the details of the boilerplate within the body of the script, but it is difficult to delegate revision management when the script itself needs to be edited each time as the boilerplate text changes. Is there a way to send the contents of a Text file, i.e. "bp..pins.txt" as a keyboard input verses placing all the boilerplate text within the script?
Btw: We use Dropbox to sync scripts across users computers.
One way to do that is to simply use the command FileRead
FileSelectFile, path
::doit:: ; hotstring type "doit" to activate
FileRead, FileContent, %path%
Sendinput %FileContent%
return
Hope it helps
Do realize that SendInput has limitations. If you send enough text, it will buffer in the keyboard buffer and show up on the screen much slower than expected. It won't take more than a paragraph for the SendInput to end up being slower than a manual cut and paste.
I recommend reading the file into the clipboard and pasting it instead:
FileSelectFile, path
::doit:: ; hotstring type "doit" to activate
FileRead, FileContent, %path%
Clipboard := FileContent
SendInput ^v
return

Emacs column mode from one file to another: Register does not contain text

I am trying to copy a column from a text file to another with emacs.
I select the text with C-x, r, r, and then try to copy the same in another text with C-x,r,l + Enter. However, at the end it says: Register does not contain text. Is it because I am trying to copy from one file to another?
My crystal ball suggests that maybe you're copying from two different Emacs sessions. Registers only work within a single Emacs session.

autohotkey long text and in a virtual machine

So I'm trying to learn autohotkey scripts and the documentation is lacking at best. First, can authotkey read commands and perform actions and such inside a virtual machine? I have a windows host and a linux virtual machine running eclipse. I'd like to get a hostring (or a keyboard macro, either is fine) to put in some long (10+ lines) of text. Can that actually work in a VM or do I have to run autohotkey inside the VM for it to work?
As for implementing this, I have 2 problems. First, how do I display multiple lines of text from a keyboard macro? I know about the Send command, but I haven't figured out how that works. I have this:
:*:insert::
(
Text to
insert
goes here
and more here
)
And this works fine except in notepad++, it inserts consecutively more tabs, so it will look like
Text to
insert
goes here
and more goes here
And so in my many line macro, by the end it's several pages scrolled off the screen.
As for keyboard macro, changing the above to
#c::
Send{Raw} (
stuf
to send
)
Return
This gives syntax errors and I have no idea what the correct way of doing that would be. Should I just stick with using hotstrings?
You could try to modify the clipboard and use control + v to paste it into the proper place.
Try:
#c::
{
clipboard := "yourtext`nMultiline`nYet another line"
send, {control down}v{control up}
return
}
The first 'insert' hotstring is correct,
however, you would get the same result that you describe,
if you performed manually, the keypresses that the hotstring is sending.
To get the output you want,
you need to change these two settings:
Settings, Preferences...,
Auto-Completion,
untick: Enable auto-completion on each input
Settings, Preferences...,
MISC.,
untick: Auto-indent
the '#c' hotstring is amended below:
#c::
Send {Raw}
(
stuf
to send
)
Return

Autohotkey to select text under cursor?

Is it possible to select text under cursor using Autohotkey specifically, using a mouse and a key combination. e.g. I specifically want to just do a Ctrl-click on any word in IE/FF/Foxit Reader and a webpage with first Google search result opens up.
Thank you.
Yes it is possible...
The easiest way is to set Ctrl+LButton to double click (which selects the current word under the cursor) copy the word to the clipboard and then use google with the parameters "q=" for the search term and "btnI=I'm+Feeling+Lucky" for using the "I'm Feeling Lucky" function.
It would look like this:
^LButton::
Send, {LButton 2}^c
Run, http://www.google.com/search?&q=%clipboard%&btnI=I'm+Feeling+Lucky
return
This would work in most cases without issues, the issue comes when selecting words like:
53°C
Jhon's
test%s
and others, because double clicking them only selects the first part of the text before the symbols.
So as long as you are double clicking normal words this should work fine.