From my diary

I’ve spent part of this afternoon working on proofing a fresh chunk of the translation of Ibn Abi Usaibia, History of Physicians.  I’m beginning to find that I need to make global find and replaces in each chunk for the same sorts of things: Abu needs to become Abū, Air to become Alī, Ibrāhfm change to Ibrāhīm, and so on.  Unfortunately Finereader does not give me any macro facility; I have to hit Ctrl-H and go through as much of the list as I can remember.

What is needed, obviously, is a script.  Or else a macro facility, or some kind of automation.  It needs to operate by recording what I do, and then be editable.

Anyone got any suggestions?  I have tried AutoIt and AutoHotKey, and neither has the recorder facility.  AutoHotKey claims to have it, but it is not in fact installed.

Share

3 thoughts on “From my diary

  1. Hi Roger,

    I’ve been using a freeware script called AutoIt for about 5 years. It is a simple Basic-like language for Windows platforms which will do what you want including allowing key combinations to be sent to the active window (as in a macro) and/or remapping function keys and writing programs to reformat data. For repetitive tasks it can’t be beat.

    You can examine and download it here:
    http://www.autoitscript.com/site/autoit/

    It comes with an extensive help facility, and the AutoIt forum is searchable.

    Regards,
    Robert

  2. Roger,

    The macro is created differently in AutoIt than using Excel, for example. In Excel, the macro is created by recording the keystrokes while you enter them once, then stopping the macro and naming it. Then you can replay the macro and it does repeatedly what you entered once, each time you invoke it.

    In AutoIt, you programmatically put the keystrokes in a script which you can invoke repeatedly (usually by assigning it to a Function key). As an example, this script below will change all occurrences of Air to Ali, then all Ibrahfm to Ibrahim, as a batch job, with the file closed:

    $accumulator = FileRead($filei)
    $corrected_text = StringReplace($accumulator, “Air”, “Ali”)
    $corrected_text = StringReplace($corrected_text, “Ibrahfm”, “Ibrahim”)
    FileWrite($fileo, $corrected_text)

    Other frequent uses are more like the traditional macro, using the SendKeys command. Here’s an example of changing the font type and size in WordPad

    If WinActive(“WordPad”) Then
    Send(“!{o}”) ; this will hit the Alt and O for the Format Menu
    Send(“{f}”) ; this will invoke the Font submenu
    Send(“Courier New”) ;
    Send(“{TAB}”)
    Send(“Regular”)
    Send(“{TAB}”)
    Send(“11”)
    Send(“{ENTER}”)
    EndIf

Leave a Reply