Introduction: I hope someone is interested in solving this little puzzle. As far as I can tell, there is no app that will do what I need, but if there is, I'm extremely interested and will gladly pay for it. I'm not especially creative, so the best I can think of is the method below, which if nothing else at least automates as much as possible. There likely are much better ways to achieve what I need, and I welcome any ideas.
Problem summary: I need to find an automated way to verify that a document's in-text citations (author's last name and year of publication) do in fact match up to the list of references (usually in the same Microsoft Word or PDF document, but sometimes in a separate file). I waste untold hours doing this mind-numbingly repetitive chore. Isn't this exactly the kind of thing that computers are for?
The long-winded version: I need to automate a workflow whereby I can do the below. I've given a more concrete example after the imagined steps.
- copy a string of text selected in a document, such as "Smith 1967" or "Howell, Taylor, and Riley 1992b" or "Smith has shown repeatedly that he has endless trouble with regular expressions (2020c)"
- extract the first word of the string (will always be a proper name) and the last word of the string (will always be a four-digit year, may or may not include a lowercase letter at the end, may or may not be surrounded with parentheses -- I don't want the parentheses or any other punctuation, just the four-digit year, and the lowercase letter if present)
- create variables from the extracted proper name and year (or year+letter)
- create a new regex populated with the variables
- copy the regex to the clipboard
- switch to another app and run a search using the populated regex
I'm happy to say that I can handle (1). (2) is where I get into trouble. Here is a more specific example of exactly what I want to happen:
- copy the selected text "Smith has shown repeatedly that he has endless trouble with regular expressions (2020c)" to clipboard
- extract "Smith" and "2020c" (presumably with regex, unless there's a more elegant method)
- save "Smith" and "2020c" as variables -- let's say Name and Year
- populate a regex that when used in a regex search will find the two variables regardless of the text between them, perhaps something like (?<=Name).*?(?=Year)
- place the populated regex on the clipboard
- switch to the second app containing the list of references (probably FoxTrot Pro, if I can get this to work, since it allows for regex searches in PDFs), paste our example of "(?<=Smith).*?(?=2020c)" or whatever regex into the search box, and run the search, hopefully finding the reference entry for Smith 2020c.
Thank so much for any thoughts on this, including better methods,
Kerry