tags:

views:

15

answers:

1

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?

A: 

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
}
David