Sign in to follow this  
Followers 0
clevername47

AutoIt-based hotkey macro system

12 posts in this topic

I've written a system similar to Macro Express using AutoIt (and some C#).

It allows you to define scripts and programs to be run when hotkeys are pressed or when windows or programs matching certain criteria become active or are created. The code that monitors windows, listens for hotkeys, and runs commands is written in AutoIt, and the interface for defining actions is written in C# (screenshot attached).

I think I've gotten it working pretty well - that's not to say that there aren't limitations but I make good use of it every day. Is there any interest in seeing something like this?

post-7176-12765452121393_thumb.png

Share this post


Link to post
Share on other sites



I've written a system similar to Macro Express using AutoIt (and some C#).

It allows you to define scripts and programs to be run when hotkeys are pressed or when windows or programs matching certain criteria become active or are created. The code that monitors windows, listens for hotkeys, and runs commands is written in AutoIt, and the interface for defining actions is written in C# (screenshot attached).

I think I've gotten it working pretty well - that's not to say that there aren't limitations but I make good use of it every day. Is there any interest in seeing something like this?

Are you going to add the code or a link or something?

Share this post


Link to post
Share on other sites

Code or link?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Here is the system. How to use and install:

Copy all files in the zip file to a folder of your choice (I use C:\auto, so user scripts go in C:\auto and the system files go in C:\auto\System.)

Edit the file System\__config.au3 and change all the paths to be correct on your system. These have to be literal strings and not @AutoItExe, etc. since they will be read by the C# editor program.

To start things off, you can either start the editor program (AutoActionsEditor.exe) and click "Restart script and apply changes" or run the script System\auto.au3. Then once it is running you should be able to hit Win+Z to bring up the actions editor or Win+X to create a new script or edit an existing script. If you use Win+X, don't type the folder name or the .au3 extension. It will open up SciTE so if you put some code in there and save your script, you can then use the actions editor to map it to a hotkey.

Some of the included scripts (google.au3, web.au3) have the path to Firefox hard-coded in them. This is because I don't want to set Firefox as my default browser at work, so you could probably improve on those. I find it very handy to be able to hit Win+G to open up a google search prompt though.

Let me know if you have any trouble.

auto.zip

Edited by clevername47

Share this post


Link to post
Share on other sites

Here is the system. How to use and install:

Copy all files in the zip file to a folder of your choice (I use C:\auto, so user scripts go in C:\auto and the system files go in C:\auto\System.)

Edit the file System\__config.au3 and change all the paths to be correct on your system. These have to be literal strings and not @AutoItExe, etc. since they will be read by the C# editor program.

To start things off, you can either start the editor program (AutoActionsEditor.exe) and click "Restart script and apply changes" or run the script System\auto.au3. Then once it is running you should be able to hit Win+Z to bring up the actions editor or Win+X to create a new script or edit an existing script. If you use Win+X, don't type the folder name or the .au3 extension. It will open up SciTE so if you put some code in there and save your script, you can then use the actions editor to map it to a hotkey.

Some of the included scripts (google.au3, web.au3) have the path to Firefox hard-coded in them. This is because I don't want to set Firefox as my default browser at work, so you could probably improve on those. I find it very handy to be able to hit Win+G to open up a google search prompt though.

Let me know if you have any trouble.

Great idea. Looking forward to trying it out. Downloaded, and setting up. Cheers

Share this post


Link to post
Share on other sites

ControlAtPos.au3

not find?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

ControlAtPos.au3 not find?

Oops, here you go. I think this is just a renamed copy of _ControlGetHandleByPos(). I'm not sure why I did that - it was a long time ago.

I've also updated the main zip file above to include this file.

ControlAtPos.au3

Edited by clevername47

Share this post


Link to post
Share on other sites

Thank you,updated!

Share this post


Link to post
Share on other sites

Thank you,updated!

The code in newedit.au3 that uses that function doesn't work very well anyway. It's supposed to get the name of the currently selected command when you run newedit.au3 while the editor program is active. I'll try to rewrite it sometime but I am going to be out of town for about the next week.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Wanted to report back on this wonderful project: I had no trouble getting this to work, even though I'm a newbie here and just learning to code. The nice thing about this for a total beginner like me: it allows me to learn very small coding ideas in a useful context. For example, I can learn to use the WinMove() function to accomplish something I've been dying to implement on my desktop: a hotkey system for resizing and moving windows to fixed locations. The coding is very obvious and since I've done a specific case (my two monitors, monitor 1 is 1920X1200 and monitor 2 is in portrait position and 1200X1600) it may not be helpful to show here. But maybe the idea of adding a quick window partitioner will be useful to someone. Now I can just hit alt 1-6 to send to any of my 6 fixed 'mini-monitors.' Very nice for multi-tabling poker, editing side by side documents, or watching multiple videos at once. Next I'm going to work on adding some file management basics that I repeat a lot. I'll report back in the same vein.

Thanks again for this wonderful project. I see I'm the third person to give it 5 stars. I love it.

window movement command example.zip

Edited by EnderWiggin

Share this post


Link to post
Share on other sites

Thanks for the comments Ender. Anything you'd change about the system?

Share this post


Link to post
Share on other sites

This looks very nifty. Before I download it, has it been updated?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0