Archive for July, 2008

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 31, 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).

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 like Basic, Java, C, PHP, etc.

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 for a casual-user, AutoHotkey is probably easier to start and to work 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, type canned answers, etc.

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 with 120 keys that can be used out-of-the-box 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