Showing posts with label autohotkey. Show all posts
Showing posts with label autohotkey. Show all posts

2014-02-20

Experience Publishing to Different App Platforms

Q: How do you gain experience in publishing apps to a certain platform?
A: You create 100 apps and publish them.

Q: How do you lose experience in publishing apps to a certain platform?
A: You create 100 apps and publish them. (Details below)

I don't think anybody actually asks the second question (but I just did!). Anyways, after the first few publishes, programmers/hackers get tired of the same routines. Our jobs are basically to automate things and makes things easier!

So, that's what I did and am doing. I'm starting to automate the entire process of publishing an app. There is this great tool that is a high-level scripting language called AutoHotkey. With it, I can easily open any program programatically, and send any keyboard and mouse commands that I want to the program. Basically, a macro builder for the entire end-user operating system.

About half of the process is automated now. I'm about halfway to my personal goal of 100 apps. My goal would be to make the entire process from app file to publish a one-click process. I know it's possible, and it'll be fun to build.

Once the process is all automated, I can be free to forget the process and start thinking of other abstractions to make.

;)
~ Danial Goodwin ~



2012-12-18

How to Create a Hotkey to Double Click Using AutoHotkey

Just created a hotkey to double-click so that I don't have to use the mouse! It is very much worth it and will speed up coding. There are other areas that I will be more productive in also. Just can't think of them right now.

I used an awesome program called AutoHotkey to achieve this and many other create keyboarding shortcuts/hotkeys/scripts. The following code basically says, "if ctrl is pressed twice consecutively in less than 500ms, then click two times at the caret position."


Ctrl::
    If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
MouseGetPos X,Y
Send {Click  %A_CaretX%,%A_CaretY% 2} ; Moves the cursor
MouseMove (X),(Y) ; Moves back the cursor
    }
Return



  • Instead of using "%A_CaretX%,%A_CaretY%", it is possible to hardcode an x and y value to click on.
  • If you remove the line starting with MouseMove, then the cursor will move to the position the caret is at.


Let me know if this helps. =]

Disclaimer: I have not done an extensive test on all programs to see if this works. But, I know that it works in Notepad++, Eclipse, Notepad, and MS Word 2010. While typing this, the hotkey seems to return (aka double click) the top-left corner.

~ Simply Advanced ~