On Dec 26, 2011, at 23:11, h. wrote:
I work a lot with references. In a manuscript, a reference can be introduced basically in two ways: in the form "Last-Name, 1999" or as "Last-Name (1999)" Every time I search a reference in a manuscript I have to search it in both ways so I have to delete the comma and put parentheses to the year over and over again. Basically I work checking references so I do that hundreds (perhaps thousands) of times (obviously for different names and years).
I need a script that eliminates coma and put in parentheses the year in a selected text. Does anyone know how? ______________________________________________________________________
Hello h.,
You don't mention which version of Word. Neither do you give much context as to what you need to do with your searches, so it's not possible to see if you've boxed yourself in unnecessarily.
Word as I remember has pretty decent pattern matching, so you might be able to search for both at once:
Find: Last-Name,? \(?1999\)?
If you must use Keyboard Maestro I hope you have KMv5.x which has the ability to search/replace the clipboard.
Something like this should be a bit speedier than what you were doing.
I'm guessing that 'Last-Name' is simply a placeholder for an alphabetic string without the dash. If there are some special requirements then the regular _expression_ can be modified to suit.
You might also be able to add a 'return' keystroke to the end to automatically initiate the search.
-- Best Regards, Chris
|