开发者

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 t开发者_开发技巧o 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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜