Une toute nouvelle façon de travailler

October 27th, 2008

 

Tout utilisateur d’un ordinateur, qu’il soit néophyte ou expérimenté, va un jour connaître les bienfaits des raccourcis clavier, et les adopter tout aussi rapidement. Le bon vieux copier-coller, une fois acquis avec la touche Ctrl, permet de sauver de précieuses secondes dans la vie du programmeur comme dans celle de la secrétaire.

 

Comme gestionnaire en TI, je suis un utilisateur accompli de l’ordinateur, et plus souvent qu’autrement, je lance la commande Exécuter pour lancer mes applications, mes pages Web, mes dossiers. Je me suis d’ailleurs surpris à avoir une centaine d’icônes dans ma barre des tâches, sans jamais les utiliser, ce qui n’est pas peu dire ! Quoi qu’il en soit, le désir de vitesse et d’efficacité fait partie de ma vie, tant sur le plan professionnel que dans mon utilisation personnelle de mon poste de travail.

 

Je n’avais jamais programmé de macros dans mon ordinateur, et mon clavier ordinaire ne me permet pas d’avoir des touches automatiques. Or, il ne m’était pas venu à l’idée de me créer des commandes déjà tapées pour aller plus vite. C’est alors que j’ai découvert le clavier programmable Enterpad P120 – ou du moins, que le clavier m’a découvert. Parce que ce n’est pas en ayant cherché cet outil que je suis tombé sur celui-ci, mais plutôt dans une optique d’amélioration de mon efficacité.

 

L’Enterpad est un clavier programmable un peu plus petit en surface qu’une feuille de papier format lettre. Il est peu encombrant et très portable, ce qui me permet de l’avoir à portée lors de mes déplacements; de plus, il se branche en USB, donc aucun pilote ni installation à faire pour que le clavier fonctionne.

 

Au départ, j’ai utilisé le clavier dans sa solution standard, ce qui m’a permis de programmer des séries de touches (des macros) dans les petits boutons et d’exécuter plus rapidement des tâches que je répétais souvent : saisie de mon nom, de mon adresse courriel, de mes liens favoris; copier et coller, annuler, exécuter, etc. Pour l’ensemble de ces tâches, l’Enterpad convenait à mes attentes et m’a permis d’aller beaucoup plus rapidement, sans avoir à effectuer une série de clics – j’étais donc plus efficace. Et c’était facile à comprendre : on écrit les touches, on met à jour la mémoire de l’Enterpad et le tour est joué.

 

Comme je trouvais le système très performant, j’ai consulté le site Web de la compagnie et ils m’ont dirigé vers le gratuiciel AutoHotkey, un logiciel en source libre qui permet d’exécuter du code programmé à partir d’une macro. Comme l’Enterpad est compatible avec AutoHotkey, je me suis empressé de l’installer et de configurer mon clavier pour aller encore plus loin.

 

Contrairement à la solution standard qui ne permet que l’exécution de touches – ou qui émule ma propre frappe au clavier –, l’Enterpad avec AutoHotkey me permet de lancer des commandes avec les touches. Ainsi, je peux émuler ma souris, faire des pauses, émettre des conditions, copier des fichiers et lancer des applications, tout ça en appuyant sur l’une des 120 touches de mon clavier Enterpad. Toute la documentation étant sur Internet, j’ai vite fait de me familiariser avec les différentes commandes et le langage de programmation de AutoHotkey, qui est un atout sans égal à mon clavier Enterpad.

 

Désormais, l’Enterpad est plus qu’un simple clavier, il est devenu un outil de travail, un indispensable. Je découvre constamment de nouvelles façons de l’utiliser et je recycle certaines touches dont je ne me sers plus quand j’en ai fini. C’est si simple que je me demande comment j’ai survécu sans mon Enterpad !

 

Edmond

Finding an easier way to get it done

October 27th, 2008

 

Every single computer user – beginner or savvy – will experiment someday the benefits of using keyboard shortcuts, and adopt them fast enough. The good old copy-and-paste, used with the Ctrl combination key, allows saving precious seconds in the lives of both a programmer and a secretary.

 

As an IT manager, I am of course a regular computer user. I want everything to be as fast as possible. In fact, I realize that I’d rather use the Run command to start up my programs, web pages and files than take the time to (find and) double-click the appropriate icon. That explains the 100+ icons on my desktop and in my taskbar that became useless over time. Therefore, I need speed and efficiency in both my personal and professional use of a computer.

 

I never set up a macro in my computer ever before, and my keyboard is so standard there are no macro-automating system. I never thought of building pre-typed commands to work faster. It is only then that I found out about the Enterpad P120 Programmable Keyboard – but let’s say the keyboard found me: I did not look at the product as to buy something like such, but more as a tool to improve my efficiency.

 

The Enterpad is a programmable keyboard that is smaller in surface than a letter-size paper. Light and portable, I can use it wherever I need to, even if I am not in front of my desk computer. Moreover, it is USB-compliant, meaning there is no driver, no installation to do prior to using the keyboard.

 

At the very beginning, I used the standard version of the keyboard, which suited me well at that time. With the standard version, it is possible to program a sequence of keys for each button on the keyboard, which I used for repetitive tasks, such as typing my name and e-mail address, getting to my favourite websites, copying and pasting, launching a Run prompt, and so on. I was more efficient and everything was so easy to learn: once set up, you save your macro file and upload it into the Enterpad in seconds, and it’s done!

 

As I found the system very powerful, I went on to the company’s website (www.cedeq.com) and they led me to the AutoHotkey freeware, an open-source application that can run code from a macro. As the Enterpad is compatible with AutoHotkey, I installed it and configured my Enterpad to work with it.

 

Since the standard version of the Enterpad was limited to simulating me typing on the keyboard, the Enterpad with AutoHotlkey could get me a step further. AutoHotkey runs with a programming language that is very simple to understand (it looks like a cross-over between VBA and Java). From now on, I can reproduce mouse movement and clicks, make pauses, use conditions, copy files and run programs only by clicking on one single button on the Enterpad. With all the documentation on the Internet, I could easily make my way through the language and commands from AHK, an impressive addition to my Enterpad.

 

My Enterpad is far more than a simple keyboard. It has become a precious tool that I would never be able to replace. Working with it keeps me going faster, and that makes me think of new ways of using it. It is so simple I wonder how I managed to work without the Enterpad!

 

Edmond

AutoHotKey Scripting Basics: The Run Command

October 10th, 2008

I have already used the Run command in two of my previous posts: Launching Google and Launching Calculator using AutoHotKeys.

The Run command is used to launch a program, document, URL, and even shortcuts.

Most of you must already be familiar with the Windows version of the Run Command. If you are not, try this:

Click on Start –> Run

A Run command window will now open; just type in the name of the program or complete URL of the Web site you want to open. For documents, however, you need to specify the complete path.
For e.g. C:\My Documents\Meghna.doc

Note: The Windows Operating System treats Notepad as a Program and Microsoft Word as a document. Thus, typing Microsft Word in the Run command box will give you an error and instead you need to specify the complete path for it.

AutoHotKeys allows you to have lot more fun with the Run command. You can launch multiple programs or Web sites at once, choose how they open, specify working directories, pass parameters etc. 

Let me just start off with showing you one of its simplest uses: Launching multiple programs at once.

#m::
Run Notepad
Run www.yahoo.com
Run Calculator
Run www.google.com
return

The above script will open the notepad, calculator and the home pages of both yahoo and google as soon as you press the Windows+m keys on your keyboard. Since AutoHotKeys executes scripts top-down, the programs will open in that order, so you can of course write them in order of your own preference.

The above script is an example of a multi-command line script and that is why we have put the commands beneath the hotkey definition. This improves readability and makes it easier to modify the scripts later, especially for larger scripts.

The Return command will exit the script (you will understand its real importance later). In single-line scripts, using the return command was unnecessary as exit was implied.

Let’s see another variation of the above script:

#m::
Run Notepad, , max
Run www.yahoo.com
Run Calculator
Run www.google.com, , min
return

Now when you use this script, the Notepad will open maximized on your screen, while the google browser window will be minimized.

Meghna

AutoHotKey script; Launching Calculator

September 12th, 2008

In my opinion, one of the most useful applications included with Windows is their calculator. But the one thing that always chafed was the long access path.

Think about it, in the time that it takes to go through Start–>Programs–>Accessories–> Calculator , 
you could probably do some of the calculations yourself. Of course, it gets easier with the RUN command box. Just click on Start –> Run and then type in “calculator” in the command box that opens to launch it. While this is a better option, it still wasn’t the ideal solution.

Now I just use a simple AutoHotKey Script:

^a::Run calc.exe

So, pressing ctrl+a will launch the calculator. I didn’t use ctrl+c (‘c’ for calculator) because I don’t want to overwrite my popular, defined by Windows, ctrl+c shortcut that copy selected text to the clipboard.

Meghna

Launching AutoHotKey automatically

August 15th, 2008

AutoHotKey is a really useful software, but I am sure at some point you have felt irritated about launching the scripts manually every time you re-start your system.

After all, how are you supposed to remember to run all the scripts each time you re-start your PC or even where you stored each one of them. But there is a very simple solution to this. All you really need to do is to add a shortcut to the scripts in your startup folder.

Just follow these easy steps:

1. Click the Start button, point to Programs, and in the list that pops up, look for the Startup Folder. Right-click on the Startup Folder and, then click Open. This will open the Startup Folder in a new window.

2.  Now open the location where you have the script saved. Right-click on your script file, and click on Create Shortcut in the menu that appears.

3. Drag this shortcut to the Startup Folder window. Alternatively, you can cut the shortcut, and then paste it in the startup folder. (Note: The Shortcut File has a small curled arrow on its icon.)

Now, each time you restart your PC, your scripts will launch automatically, the ones in the startup folder, that is.

Meghna

AutoText Script – Expanding abbreviations with AutoHotkey

August 12th, 2008

This is the day and age of abbreviations, thanks to IMs and SMS. While academicians worry about its adverse effects on the English language, you should be worrying about its effects on your career.

It may be acceptable to type BTW, IIRC, FYI etc. in the virtual world, but it’s not looked kindly upon in the corporate world, and I am sure all of us have some time or the other made the mistake of using these abbreviations in our official emails.

Now you can of course choose to attend the email etiquette classes conducted by your organization or be smart about it and do what I do.

A simple AutoHotKey Script will fix this problem.

::BTW::By The Way

::IIRC::If I remember correctly

::FYI::For your information

To learn how to use these scripts, click here

Whenever you type these abbreviations, they will automatically get expanded, and in every application you use. Cool, right!

And the best part, you do not need to make a different script file for each abbreviation. You can just put all the abbreviation scripts in one and keep adding to them as and when you require. Just compile and run the file after each change.

Have Fun!!

Meghna

AutoHotkey script; Launch Google

August 11th, 2008

Let’s admit it; we all spend a lot of time googling whether it be for personal reasons, professional reasons or just for fun. So this simple script is probably the most useful one you will ever come across. (It is definitely my favorite, so maybe I am biased).

#g::Run www.google.com

To know how to create a script file, click here: First AutoHotkey Script

How It Works:

The # symbol denotes the Windows key.

:: symbol means that the action defined on its right will be executed when the hotkey defined on its left is pressed.

Run command is used to launch a program, in this case, the google web page.

So, when you press the windows key and the letter ‘g’ on your keyboard simultaneously, it will launch the google web page in a new window/tab.

You can of course personalize the hotkeys according to your preferences.

Meghna

How to work faster with PuTTY

August 9th, 2008

The fact that we constantly have to type the same commands over and over again is time-consuming. Do you remember all those complicated sequences like when you want to access your log files, restart apache, open and edit your configuration files in your dedicated Web Server? How many times do you have to type “nano /var/log/apache2/access.log” without making a mistake? Wouldn’t it be a dream to have something else type all this for you?

Well, someone thought about it and it’s completely free. Mark my words, AutoHotkey is the answer. This program is what we call an automation program. With the help of “hotkeys”, it types whatever sequence you want it to type. Too good to be true? Yes, it is wonderful and yes, it’s true.

Give it a try. Just log on to their Website at http://www.autohotkey.com/ and download the small program.

Sonia

First AutoHotkey Script

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

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