Brice Stacey home

Automate Deleting SSNs using Macro Express where Pptrnupdt Doesn't Work

Several months ago I purged most of the social security numbers from Healey Library's patron database using Voyager's patron update (Pptrnupdt), but there were several thousand patrons remaining without institution ids. Pptrnupdt only matches patrons by social security number or by Institution ID. Therefore Pptrnupdt would not work gracefully to finish off the project. If anyone from Ex Libris is reading this, please include a Patron ID index type, thanks.

To finally clear our the remaining SSNs, I used Macro Express. In a nutshell, it can automate tasks by performing keystrokes, mouse movement and clicks, logic using UI elements such as window title and contents, and process text files line by line among many other things. I totally recommend it. It also comes with a 30 day trial, so you can do a couple large batch projects before having to pay.

Voyager has a keyboard shortcut for just about everything and even when there is not one, some combination of keystrokes will get you wherever you need to be. Thus, I present a script that processes barcodes from barcodes.txt on my desktop, looks up the patron, edits the patron, removes the SSN field, saves the patron, and moves on to the next. You can copy paste this into the Direct Editor.


Once pasted into the Direct Editor, you can select the Scripting Editor to get a more user-friendly view of your script. There, you can add, remove, disable, or modify commands. Here is what this script would look like in the Scripting Editor and I've annotated it for better understanding.

The script expects you to start with the Patron window open. You can easily get there by clicking the Patron button and pressing ESC to get out of the Patron Search dialog box. It doesn't matter that a particular might be open. As you'll see when the script loops, that's precisely its state.

Other Scripts

Here are some other macros I used to clean out some others lying about:

Delete SSNs using SSN search index.


Delete SSNs using Institution ID search index.


Delete SSNs using First Name and Last Name search index. This one is most complicated as I had to parse the first 20 characters (first name) of each line into a variable and the next 30 characters (last name) into another. Both variables were also trimmed to eliminate whitespace.

<SPKEY:0050><BTFBEG:001:000001:000000:C:\Documents and Settings\brice\Desktop\names.txt><TMVAR2:10:02:01:001:020:><TMVAR2:01:02:00:000:000:><TMVAR2:10:03:01:021:030:><TMVAR2:01:03:00:000:000:><TEXTTYPE:<ALTD><ALTU>p<ENTER>><TEXTTYPE:<ALTD>e<ALTU>><TEXTTYPE:<ALTD>l<ALTU>%T3%><TEXTTYPE:<ALTD>i<ALTU>%T2%><TEXTTYPE:<ENTER>><IMSD:500><TEXTTYPE:<ENTER>><TEXTTYPE:<ALTD>p<ALTU>e><TEXTTYPE:<ALTD>s<ALTU>><TEXTTYPE:<DELETE>><TEXTTYPE:<ALTD>v<ALTU>><TEXTTYPE:<ALTD>o<ALTU>><TEXTTYPE:<ESC><ESC><ESC>><BTFEND>

If you've got any ideas for other macros, leave me a comment.