0

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?

2 Answers 2

1

All those automated stuffs are tied to the Host OS. If you want to automate or communicate between Host and VMware, you have to use different solutions such as custom web app or client-server app such as command-and-control server. I would use a script as cron job in linux. That scripts will check web server/app url in every 10 seconds. And it executes the command given by the Host OS web server.

0

Can authotkey read commands and perform actions and such inside a virtual machine?
Do I have to run autohotkey inside the VM for it to work?

AutoHotkey is only available for Windows, so you'll have to run it in Windows. If your Linux virtual machine appears as a window on your Windows desktop, then AutoHotkey might be able to successfully send keystrokes to it. You might need to try the different flavors of the Send command (SendInput, SendPlay, SendEvent).

How do I display multiple lines of text from a keyboard macro?
[...] This gives syntax errors and I have no idea what the correct way of doing that would be.

The proper way to use the parentheses is

#c::
(
Send {Raw}stuf
   to send
)
Return

There are other ways to send multiple lines of text with a hotkey.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .