Archive for the ‘AutoHotkey’ Category

First AutoHotkey Script

Friday, July 18th, 2008

With a little search, you’ll find a lot of script examples on the Internet but what most of them won’t tell you is how to create and use them.  

Well… lets start with the basics then.

Once you have downloaded and installed AutoHotKey, just follow the given steps:

  1. Open any folder and pull down the File Menu. Choose New -> AutoHotKey Script.  
  2. Type a name for the file, and make sure that the file extension is .ahk
  3. Now, right click on this file and choose the option Edit Script.  The file that will open now will already have some text †. To use any script, just add the script in a new blank line. 
  4. Save and Close the File.

That’s it. Simple, right??

Now to try out this script, all you need to do is double click on your .ahk file. You’ll now see a AutoHotKey icon in your system tray which means that your script has been launched.

You can test the script by using whatever hotkey you had specified in the script. To exit or edit the script again, right-click on the tray icon and choose the appropriate option.

Meghna

The text contained is generally information about your AutoHotKey software version, and some standard commands. You can remove this text completely or keep it. These commands are not required to run your script, but they do speed up your script a little.

Learning AutoHotKey - Simplifying The Idea Of Hotkeys and HotStrings

Thursday, July 17th, 2008

For a first-time user, AutoHotkey can be an intimidating experience.

While its benefits in saving time and preventing RSI are undeniable, the general first reaction from users is “Hey.. I am not a programmer.. I can’t do this… It’s too tough… What a waste of time.”

But wait.. It’s not tough. Actually, writing commands and generating scripts can be quite easy if you just understand a few basics.

Before I start explaining the “How To..” behind AutoHotkey command scripts, you need to know “Why Generating Scripts In AutoHotkey” is important.

Let’s start with explaining two important terms that are used with AutoHotKey software: HotKeys and HotStrings.

Hotkeys and Hotstrings are both used to trigger commands. The difference lies in the key sequence(s) you need to trigger those commands.

For eg: Pressing F1 will activate the Help Menu. You only press one key here, and this is what we call a HotKey. They are also referred to as Shortcut Keys.

On the other hand, a HotString is a key sequence that involves more than one character (string) to execute any commands. They are generally used to expand abbreviations.

For eg: You can define the string “btw” to expand to “by the way” as you type.

However, remember that the Ctrl+C key sequence for copying the selected objects is a HotKey and not a HotString (since it only uses one character, C).

Defining HotStrings and HotKeys can not only help you automate tasks but also lets you choose the key combinations. And this is where AutoHotKey gives you the full power to use your keyboard and mouse, just the way you like it.

You can even change pre-defined Windows Hotkeys and Strings, so if in case, you think F1 should be used to Forward your emails instead of bringing up the Help Menu, all you need to do is generate a simple script.

Of course it can get cumbersome and hard to remember when you define a string to activate a command (especially when it involves use of 3 or more keys). Then you can just use the Enterpad and voila you can now activate that command with just a single key again.

Learning how to use AutoHotkey is not only simple, but I promise you, it will also be one of the most useful thing you’ll ever learn.

Of course, we understand if you don’t quite have the time or effort required for that. In which case, the fact that it’s an open-source software comes in quite handy. You can find scripts for most tasks online. Just “google it”. :)

Meghna

Everything about the installation of AutoHotkey

Thursday, July 10th, 2008

(Updated July 2nd, 2008)

Installing AutoHotkey on Windows Operating System is very easy.—Install the software (about 2 MB) directly from the AutoHotkey Website at this address:

http://www.autohotkey.com/download/AutoHotkeyInstall.exe.

… When Windows asks if you want to save or execute, click on “execute.”  By default, AutoHotkey will automatically be installed in the “C:\Program Files\AutoHotkey\” folder that it will create.

The installation process is programmed to register files with the extension “.ahk” so to associate them with the AutoHotkey program. It means that if you doubleclick on a file with the extension “.ahk” in your File Explorer, Windows will automatically start the AutoHotkey program to execute it.

The installation process will also create a new menu item in your Windows start menu to launch AutoHotkey.

AutoHotkey will also add three menu items when you rightclick on your mouse in File Explorer.  In other words, when you rightclick on a file with the “.ahk” extension in Windows Explorer, the popup menu will have three more items: “Run Script”, “Compile Script” and “Edit Script.”  Windows Explorer will also have a new type of file in the “File->New” command.  This command will be called “AutoHotkey Script”.

The AutoHotkey installation should not do anything else into your system.  If it does, please let me know.

Note: You can easily uninstall AutoHotkey with the regular Windows “Add/Remove programs” (WinXP name) that you can reach from the Windows configuration panel.

Sonia

AutoHotkey Vs AutoIT

Wednesday, July 9th, 2008

What is AutoHotkey and AutoIT?  What is the difference between them?  These two programs are similar.  In fact, AutoHotkey has been derived from AutoIT.  AutoHotkey and AutoIT are two programming languages that could be compared with Basic, Java, C and PHP. 

I found that AutoIT is more structured than AutoHotkey and this is something that can be useful to create and modify bigger Windows applications.  But, the difference lies in the fact that AutoHotkey is probably easier to start with.  It is also more powerful than AutoIT when it comes to managing shortcuts and/or hotkeys linked to simple tasks. 

So, if you intend to create full-featured Windows applications, I would suggest AutoIT.  But, if your intention is to create several small tasks activated by hotkeys and/or shortcuts, I would suggest AutoHotkey.  Some examples would be like using one key to sign your name, to access your bank account, access Google Homepage, etc. 

If you feel up to it and you are expert enough to create full-featured Windows applications, like the creation of complex menus, graphic interfaces, icons, etc., you also have the possibility to use Basic, Java, C and, of course AutoIT. 

The wonderful thing about AutoHotkey is that you are able to create so many hotkey-to-macro tasks like the examples shown above.  But, after the creation of a few hotkeys, we usually find that remembering these hotkeys is quite complex.  The good news is that Cedeq created a keypad, the Enterpad P120, with 120 keys that can be used with AutoHotkey.  That way, you won’t have to remember what your hotkey is since you’ll only have to press on the corresponding touchkey of the Enterpad.  And, believe me, after you create a few hotkeys, you will definitely want to create more and more.  They really simplify any work we have to do.

Sonia

Prevent RSI with AutoHotkey

Sunday, June 15th, 2008

If you are anything like me, you probably spend an upward of 14 hours on your computer, and even with the best ergonomically designed hardware, you are still well on your way to having RSI.

How many times have you wished that you could get your work done by just glaring at the screen when your wrists or neck began to ache? That the pop-up windows would close on their own; that the typos would correct themselves; that the abbreviations you typed would magically turn into words/phrases especially when writing official emails (this last one is my fantasy and I suspect of quite a few corporate executives too).

But AutoHotkey can automate all these tasks and more. It allows you to remap the keyboard, use abbreviations to type in words/phrases, automatically close unwanted programs, change soundcard settings, launch programs/documents, automate signatures, schedule reminders, and even control the mouse cursor with a joystick or keyboard.

The best part: It is free, doesn’t take much memory space, and allows you to define any combination of keyboard and mouse strokes as a hotkey (you can even override Windows defaults).

If you don’t feel up to the task of remembering the various hotkeys, the Enterpad takes care of that. The Enterpad is a compact keyboard that can be configured for 120 different hotkeys and can effectively replace your regular keyboard.

Managing a large number of hotkeys!

Thursday, March 27th, 2008

It is exactly the problem we faced at the beginning with AutoHotkey. We needed 100+ “hotkey-to-macro” to open websites/ files, select accounts/ fonts/ printers, start programs, type special characters and so on.

Actually we had 4 problems:

  1. It was almost impossible to remember all of our hotkeys and even less possible to ask a part time employee to remember them. 
  2. It was frequent and very damaging to press the wrong hotkey which was activating the wrong macro. 
  3. It was time-consuming to find and modify a macro and/or replace a hotkey in our script file. 
  4. Some of the hotkeys that we were selecting for our macros were disabling useful existing hotkeys in Windows environment. 

We solved everything with a customizable keyboard like the Enterpad. The graphic overlay on the Enterpad solved the problem of remembering and pressing the wrong hotkey. Actually, the way we built our AutoHotkey script file makes modifications a lot easier. Finally, our script file uses only one hotkey (F10) followed by a three digit number (001 to 120) to trigger 120 different macros. This means that we do not disable other predefined Windows hotkeys.

Our AutoHotkey script template, the Enterpad ready-to-print overlay and a tutorial are available free at www.cedeq.com/enterpad-p120/autohotkey-english.html

Enjoy!

Auto-Hotkeys for AutoHotkey

Monday, March 24th, 2008

Are you manually doing these simple tasks over and over again?

  1. Starting webpages like “google.com”, “yahoo.com\currency”…
  2. Typing special characters like †, ‡, ™, ®, ©, é, ê, ç…
  3. Typing account or department numbers like “237UJ65”…
  4. Starting programs like “dictionary.exe”, “email.exe”, “fax.exe”…
  5. Opening specific folders like “c:\windows\user\images”…
  6. Opening files like “ToDo.txt”, “Phone.txt”, “ToBuy.txt”…
  7. Typing canned answers like “You can reach me at 800-123-4567”…
  8. Selecting menu commands like “ALT+F+S”…

Enterpad Overlay Keyboard

Several people are frequently executing these tasks without AutoHotkey simply because it is not practical to remember all the hotkeys linked to so many tasks.

Everything is different with an Overlay Keyboard like the Enterpad because you don’t have to remember any hotkeys. Pressing the right labeled key will instantly generate the hotkey which will generate your number and so on for canned answers, special characters, menu /file /program /website access, etc.