Macros and Micro Automation
Law practice technology comes in a variety of sizes. Either the lawyer adapts to the technology or adapts it to her needs. We often look at the systems that lawyers use to improve client service and productivity. This time, let’s flip the hood on law practice technology and look at some of the micro tools you can use.
Automated Tasks with Macros
Technology use is filled with those small things we do over and over, seemingly because we have no option. We log on to Windows, and as it loads, we grab a cup of coffee. We sit down and open a set of programs or go to a particular Web site. Our technology habits represent repeated tasks that we may be able to automate.
Windows users already know they can use the Task Scheduler to set up time-activated tasks. Another popular way to automate activities is to use one of the many open source macro languages. As technology has changed in the last decade or so, we have seen the rise of discrete apps to salve these small technical itches we have.
Lawyers used to be regular users of macros, though. Particularly in WordPerfect’s hey-day, it was possible to buy pre-designed macros to automate replicable parts of the lawyer’s day.
Two examples of macro tools you can use in Windows are Autohotkey and AutoIT. In each case, and with any macro scripting tool, you write a simple script to take an action. The devotees of each of these well-known tools are adamant that theirs is superior, but I found both had similar functionality.
If you don’t fancy getting that far under the hood, you can use a macro recorder instead of typing out your macro. Autohotkey requires an add-on like MacroCreator; AutoIT has a recorder built into its script editor. These work like Microsoft Word’s macro recorder. Turn on the recorder and it will record each action you take – key press and mouse click – and store it in a macro file. You can then run the macro, although you may need to tweak it.
Here’s an example. Sometimes my Firefox Web browser will stop working properly, usually because I’ve made a configuration or add-on change that breaks it. You can restart Firefox in safe mode, starting it clean so you can at least get to the Web. Rather than having to edit Firefox’s icon to add this command line – -safe-mode – each time and then removing it when the browser is fixed, I can create a macro.
In Autohotkey, this macro will run when I press my Windows key and then the letter Z. I’ve added a couple of steps to bypass a warning prompt Firefox shows. The first two lines, and the last return, are all you need.
It’s pretty much the same thing in AutoIT. Anyone who has used a developer tool to write HTML or other code will find this editor familiar. But it’s just a text file and, like AutoHotkey, you can just write the script in Notepad.
More Scripts
Windows has had a command line from the beginning. In recent iterations, it has added a more powerful command line interface (CLI) known as Windows PowerShell. In Windows 10, you can hit your Windows key and the letter X and see PowerShell on the list of apps. When you start it up, you can use it the same way you did with the old cmd. Here’s how I’d start Firefox in safe mode
Except that this isn’t cmd. The first thing I noticed was that I could use Unix commands as well as normal DOS commands. I habitually type ls to list files, as I would on Ubuntu, rather than the dir command Windows takes. Both work in PowerShell.
PowerShell is far more powerful though. It can do more from the command line and the things you do at the command line can be stored as scripts. A simple example is this one, where I can list all the files I a folder or on a computer and show the last time they were edited. At the prompt, I type:
Get-ChildItem location_or_drive_letter –r | select name, *time
Get-Childitem can be replaced with dir or ls; it’s just a way of listing files. It lists everything in that location and (with the –r) looks recursively into every folder below. The pipe sign (|) allows you to do additional actions, in this case selecting the name of the file and any attributes that include the word time. These are not the only metadata elements you can access. Additionally, there are ways to write scripts that access both the file metadata as well as the application metadata (files edited by specific authors, for example).
Since you may have a long list of files to look at, you might want to dump the entire list into a spreadsheet. Change the above command to:
Get-ChildItem n:\ -r | select name, *time | ConvertTo-Csv > your_spreadsheet_name.csv
The .csv file will be created in the same folder as your PowerShell prompt (c:\users\david, for example). Open up Microsoft Excel, open up the CSV, and you can manipulate the columns like any other worksheet.
This example might be useful when you are closing out a file and want to get information on all of the files you have, to look for duplicates. Or if you want to see if your law firm’s records retention schedule is being followed, and which files haven’t been touched in the last 3 years or last 10 years.
Voice Macros
Once you have a macro script, you can execute it with a set of key strokes or you can automate it using a scheduler. But there are voice macros as well. Windows Voice Recognition is built into all recent versions of Windows and is a reasonable way to eliminate moving your hands between the mouse and keyboard. Saying Press Windows X will open up the menu that displays PowersShell. Saying Press Windows Z will activate that AutoHotkey macro if you have created it on your own PC.
Nuance’s Dragon NaturallySpeaking has the ability to create macros. A free download from Microsoft adds a macro capability to Windows’ native speech recognition software. Returning to my example, it is easy to set up a new macro so that, when I say safe fox, voice recognition opens up Firefox in safe mode.
Lawyers use technology in many, often personal, ways. Macros and simple automation can take some of the repetitiveness out of your law practice by taking those things that only you do and allowing you to do other things. Whether you record a macro, write one, or save scripts to run at the command line, you can cut down on routine technology habits. Perhaps there’s time to go get another cup of coffee.
Comments are closed.