1
votes

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?

2

2 Answers

1
votes

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
}
0
votes

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