I thought the mention of money might catch your interest :). But macros, especially wildcard macros, and money do go hand in hand. Consider the following two scenarios I recently experienced in the references of a project (same project, different chapters).
In the first scenario, there were, over two chapters, nearly 500 references that the authors had formatted like this:
Agarwal, S., Loh, Y. H., Mcloughlin, E. M., Huang, J., Park, I. H., Miller, J. D., Huo, H., Okuka, M., Dos Reis, R. M., Loewer, S., Ng, H. H., Keefe, D. L., Goldman, F. D., Klingelhutz, A. J., Liu, L. & Daley, G. Q. (2011) Telomere elongation in induced pluripotent stem cells from dyskeratosis congenita patients. Nature, 464, 292-6.
In the second scenario, the references were formatted like this:
Adhami F, G Liao, YM Morozov, et al: “Cerebral ischemia-hypoxia induces intravascular coagulation and autophagy.” Am J Pathol 2006; 169(2): 566-583.
What they need to look like is this:
Airley R, Loncaster J, Davidson S, et al. Glucose transporter glut-1 expression correlates with tumor hypoxia and predicts metastasis-free survival in advanced carcinoma of the cervix. Clin Cancer Res 2001;7(4):928-934.
The money question is how to I get the references from where they are to where they need to be quickly and efficiently so that I make money and not lose money? The answer lies in wildcard macros.
For most editors this is a daunting task that needs to be tackled manually. In the first scenario, the editor will manually remove each extraneous period, manually move the year to precede the volume number, and manually correct the punctuation problems in the citation. In other words, most editors will spend a good two or three minutes — if not longer — correcting each reference entry. I, on the other hand, spent less than 30 minutes cleaning up these references and verifying the journal names.
It is not that I am a brilliant macro writer — I am not. A skilled macro writer is someone like Jack Lyon, the creator of the Editorium macros that so many of us use. Instead, what I am is a smart user of the tools that will help me accomplish what needs to be done. In this case, I am a smart user of EditTools’ Wildcard Find & Replace (WFR) macro tool.
WFR has been designed to make creating and using wildcard macros easy. You do not need to know how to write the macros, the tool will do it for you; instead, you need to know how to tackle a problem, how to break it down into its component parts.
The first step is to find a pattern. Remember that macros are dumb and work on patterns. I began by analyzing the patterns in the author names: Agarwal, S., Loh, Y. H., Mcloughlin, E. M. I realized that, for example, each of the first names was represented by an initial followed by a period and a space except that the final initial was followed by both a period and a comma (e.g., Y. H.,). Thus each group was separated by a period-comma combination. I also noticed that some authors had a single initial and some had two initials (and I recalled from other reference lists that some authors had three initials).
Beginning with the single initial name, I used WFR to create the first macro. WFR lets me select from menus what I want (e.g., the Character menu gives me several options, including Exact Characters, Exclude Characters, lower case, UPPER CASE, Mixed Case) and based on my selection, WFR creates the entry for me (e.g., choosing UPPER CASE in the first field inserts an unlimited [A-Z]@ into the field, which WFR turns into ([A-Z]@), the correct form for a wildcard). I do not need to know how to write the entry, I need only give the correct instruction. Thus, the first thing I wanted the macro to find was the surname, which is mixed case. So from the menu of options, I chose Mixed Case and unlimited (unlimited because some surnames are short and others are long and I need to cover all of them) and WFR created ([A-Za-z]@) for me.
I continued to make my selections by filling in the fields in the WFR form so that in the end the fields were filled in for me like this (the @ indicates any number of the find criterion; the {1,1} indicates a minimum of 1 and a maximum of 1 of the find criterion; and in #3 and #7, preceding the { is a space):
Field # Find Replace
1 [A-Za-z]@ \1
2 , \3
3 {1,1} \4
4 [A-Z]{1,1} \6
5 . \7
6 ,
7 {1,1}
The Replace fields are where I tell the macro what to replace the find with. Again, this can be achieved by making selections from a menu. The \4, for example, indicates that what I want is found in field #4. So the Replace information tells the macro that I want the found criteria replaced with Surname (#1), a space (#3), the initial (#4), a comma (#6), and a space (#7). WFR creates a wildcard find string that looks like this:
([A-Za-z]@)(,)( {1,1})([A-Z]{1,1})(.)(,)( {1,1})
and a replace string that looks like this:
\1\3\4\6\7
and when the macro is run, every author name that looks like
Agarwal, S.,
becomes
Agarwal S,
Clearly, this one macro is not enough to clean up all the variations. In fact, for the first scenario it took 11 macros just for the name cleanup. But this is another feature of WFR. After I create a macro, I can save it, with a lengthy description, in a file with similar macros so I can use the macro again without having to create it again. But to have to run 11 macros individually is time-consuming, so WFR will let me create a script that will run all 11 macros in whatever order I want them to run.
A script is easy to create — you just double-click on the macros you want to add to a script and then save them. The script can be added to or subtracted from at any time.
Ultimately, I created another set of four macros to deal with the author names in the second scenario. All of these macros — those for scenario 1 and those for scenario 2 — can be modified to deal with different patterns as the need arises. I will not have to keep reinventing the macros.
Another feature of WFR is that the macros are editable. If you discover that you should have included or omitted something, you do not need to recreate the entire macro; just choose to edit it.
And WFR lets you test the macro to make sure it works as you expect. (One note of caution when working with wildcard macros: It is best to turn tracking off. With tracking on, wildcard macros often produce bizarre results. Run the same macro with tracking off and everything works fine.)
It took me about 30 minutes to write all of the macros for both scenarios. Once I wrote them, however, when I came to the next chapter that needed the cleanup, the cleanup was done in less than a minute. Compare a less-than-a-minute cleanup time to the time it would take to do the cleanup manually. The wildcard macros make me money by making my work easy, quick, and efficient.
The beauty of EditTools’ Wildcard Find & Replace macro is that you do not need to be a macro guru to create these macros. You simply need to break the tasks down into steps and use WFR to create the macros for you. One important point that is worth repeating: Macros are dumb. They will do what you tell them to do even if they shouldn’t. It is still your responsibility as an editor to check the items. Macros do make mistakes.
If you haven’t tried WFR, you should. It is an easy way to delve into the world of wildcard macros. And unlike using the wildcard feature of Word’s Find & Replace, WFR lets you save the macros for future use and gives you a way to run several wildcard macros sequentially without having to create them.