Hack 44. Accelerate Skype Using Your Keyboard
Make Skype fly, by speeding up common tasks with key sequences and hotkeys. Works with: Windows version of Skype. If you're proficient with the keyboard, sometimes driving Skype in this way can be easier, and faster, than if you use the mouse. Even if you're not one of these people, this hack will nevertheless help you speed up some Skype tasks.
Skype has the ability to control a very limited amount of its functionality using global hotkeys (see Figure 4-5). You can set these by selecting Skype Tools Options… Hotkeys. Figure 4-5. Skype's global hotkeys option dialogSkype's global hotkey feature, though useful, is somewhat limited. Another option is to drive Skype's GUI using key sequences. In this case, there's almost nothing you can do with the mouse that you cannot do with a key sequence entered at the keyboard. But if you want to use this approach, your efforts will be made a lot easier if you first set up a hotkey sequence to open Skype and give it focus. Once you do that, it will be a lot easier to drive Skype's GUI via the keyboard. One method is to set a global hotkey sequence to Focus Skype (see Figure 4-5). However, this method has the annoying habit of minimizing Skype if it's already open! What we want is a foolproof way of always bringing Skype to the foreground and giving it focus wherever it may presently be lurkingbehind another window, or in the system tray, or not running at all! Fortunately, such a method exists in the form of a hotkey sequence for a shortcut to Skype.exe. Create a shortcut that points to Skype.exe as its target, and then right-click on the shortcut and choose Properties. In the shortcut properties dialog that is displayed, select the Shortcut tab, click on the text entry field opposite "Shortcut key," press the key sequence you want as your hotkey (for example, Ctrl-Shift-S), and then click OK. Now you have a hotkey sequence that will bring Skype to the foreground of your desktop and give it focusno matter where it might be hiding! On my machine, I have the hotkey sequence Ctrl-Shift-S set up so that it always opens Skype and gives it focus. You may have to choose something different if this hotkey sequence conflicts with a hotkey sequence that already exists on your machine. However, for the remainder of this hack, we'll assume that Ctrl-Shift-S works as desired; but remember, it doesn't really matter what it is, just replace Ctrl-Shift-S in this hack with whatever you have set up instead. Now we're ready to start driving Skype. Let's try some Skype keyboard acceleration:
Don't be afraid to experiment, as it often takes a little trial and error (and sometimes a notepad and pencil) to find the right key sequence for what you want to do. This method works best, of course, when key sequences are short, as they're obviously easier to remember. However, even complex key sequences can be put to good use, and I'll show how next. 4.3.1. Hacking the HackThink of the following simple script, drive_skype.vbs, as a car you're meant to drive. You don't have to be a mechanic or look under the hood to drive a car, and so it is with this script. Just download the script from the book's web site (http://www.oreilly.com/catalog/SkypeHacks/index.html) and start using it to make Skype fly!
' File: drive_skype.vbs ' Invoke like this from the run-line: ' drive_skype "^+S|%(TO)" ' where "^+S|%(TO)" is the key sequence to be sent to ' the Skype GUI (in this case ctrl+shift+S, ' followed by alt+T then alt+O) Dim objShell, objArgs, keystrokes, keys, pause Set objShell = WScript.CreateObject("WScript.Shell") Set objArgs = WScript.Arguments keystrokes = Split(objArgs(0), "|") pause = 1500 For Each keys In keystrokes objShell.SendKeys keys WScript.Sleep pause If pause>100 Then pause=100 End If next To run this script, you will need to enter something like "C:\Scripts\drive_ skype.vbs" "^+S|%(TO)" at the run line (Start Run…), or use a similar command as the target of a shortcut (with or without a hotkey sequence assigned to it). Of course, if you put C:\Scripts\.
Let's look at some examplesand the powerof this simple script:
Clearly, some of the examples given here would stretch anyone's memory capacity, but when you use them in combination with the simple script presented in this hack, as well as with shortcuts, they can be extremely useful and great timesavers. To help you explore the full power and possibilities of using drive_skype.vbs to drive Skype's GUI, here's a short crib sheet of the possible key sequences:
Now you are in a position to experiment for yourself. Using keyboard key sequences can really make Skype fly, and all it takes is a willingness to experiment, a systematic approach (having a notepad and pencil close by helps), and some imagination. Once a key sequence has been well thought out and tested, this way of using Skype can be both faster and less error prone than using the manual keyboard or the mouse! |