Friday, August 22, 2014

autohotkey inserting long text and using in a virtual machine

I asked this in stack overflow but I guess autohotkey isn't sufficiently coding related. So I hope asking here is OK



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 this. I haven't tested it in eclipse since I can't get it to recognize my keys in my VM.




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?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...