February 24, 2007

Juggling Keyboard/Spotlight/Quicksilver ⌃⌥⌘ ␣ key combos

Historically, the key combo shortcut for invoking Spotlight, invoking Quicksilver, and toggling the international Unicode input keyboards are all the same, namely, Command Space (⌘ ␣). To include all three features in my workflow, here's what I've done:

Quicksilver has long used the Control key (⌃) as another standard option, and it also has a double-tap option for invoking. And then, moving the international keyboard input to utilize the Option key (⌥) everything gets cleared up. So, all I need remember is Command key for Spotlight to search the contents of files on my drive, Option key for for toggling back and forth with Greek input, and Control key for Quicksilver and all its magic. It quickly becomes muscle-memory if you use them as frequently as I do.

Here's the full summary:

⌘ ␣

Spotlight invoke

⌥⌘ ␣

Spotlight window invoke

⌥ ␣

Toggle two most recent input keyboard

⌃⌥ ␣

Cycle among input keyboards

⌃ ␣

Quicksilver invoke


Quicksilver double-tap invoke

(Truth be told, I've set the primary invoke for Quicksilver to ⌃⌘ ␣ but still always use the ⌃⌃ double-tap to invoke. This is because I've kept Word's default ⌃ ␣ as "remove character formatting", which I use a ton.)

Update: In Snow Leopard, you can ignore the "Select next keyboard" command that cycles through them, since now you can hold down the "Select Previous" key combination and get a nice HUD to move around.

February 21, 2007

Translate ASCII into Unicode Greek

Over on macosxhints.com, there is posted a perl script "which transliterates ASCII into UTF-8 non-accented Greek" as well as Arabic, with future plans for Hebrew as well. If you're typing in Greek, you should use a Greek keyboard, but this script is an example of how to implement font substitutions via perl.

February 17, 2007

Importing HTML files into Accordance

If you are a frequent user of Accordance, then you definitely need to be a frequent reader of the Accordance Blog, run by David Lang of OakTree software. He demos features thoroughly, and in a helpful manner. And I'm delighted to see that he's about to address an issue that I have failed to get them to address for years.

We all have our own list of features we'd like to have added to the software that we love, but I never use this platform as a way of loudmouthing pressure on the OakTree folks to give my wishlists a priority. They are, after all, only my priorities and not anyone else's. However, I've long thought the tagged importing of User Tools carried incredible potential for the attractiveness of their software and I was sad when they implement the html import feature by implementing it almost. A small number of html tags were supported, and worse, they never released a support document saying which html tags were supported. For years now, the best we've had is a sample html document I put together that folks keep asking for that shows how tags do and don't get converted. (You can find the Accordance Import Sample html document here; just download it and import it and have a look at the results.)

Well, David is about to make all this better now. Finally, I can hold my breath. :)

February 13, 2007

Applescript and Accordance to fill a Word table

I've had some questions about how I use something like Applescript to add full scripture texts to a table of scripture references. Instead of talking about it, I'll just show you a script to do that very thing. I've added comment lines that describe what most of the lines do. The scriptability of Microsoft Word 2004 is phenomenal.

-- This script cycles through a table of scripture references and looks up the text in Accordance, adding the full text to the end of the cells.

-- It works on the first table of the active document in Microsoft Word.

tell application "Microsoft Word"

-- work on the first table of the active Word document

set theTable to table 1 of active document

set rowCount to (count rows of theTable)

set columnCount to (count columns of theTable)

-- speed things up by not redrawing the window after each retrieval

set screen updating to false

-- repeat the functions with every cell of every row of every column

repeat with rr from 1 to rowCount

repeat with cc from 1 to columnCount

-- you can change those two lines to work on only certain rows or columns, such as:

-- repeat with cc from 3 to 5

-- will restrict it to columns 3, 4 and 5.

-- set the current working range to the next cell

set aCell to cell cc of row rr of theTable

set aRange to create range active document start (start of content of text object of aCell) end ((end of content of text object of aCell) - 1)

set theRef to content of aRange

-- empty cells have a ~, indicating move on to next cell

if theRef does not contain "~" then

-- try to get the scripture text from Accordance


-- change the module name from "GNT" to whatever you wish.

-- the result is in the custom citation format of Accordance prefs

tell application "Accordance" to set theText to «event AccdTxRf» {"GNT", theRef, true}

-- set the current range to the end of the contents of current cell

set aRange to create range active document start ((end of content of text object of aCell) - 1) end ((end of content of text object of aCell) - 1)

-- add the results to the end of the cell after a carriage return

set content of aRange to return & theText

-- redefine the range to inclue the text we just placed in the cell

set aRange to move start of range aRange by a character item count 1

set aRange to change end of range aRange by a cell extend type by selecting

-- do whatever formatting you'd like to the inserted text, otherwise, it will have the character format already present in the cell

set style of aRange to "GreekText"

-- set bold of font object of aRange to false

-- set color index of font object of aRange to black

end try

end if

end repeat

end repeat

-- ok, now update the window of the Word document

set screen updating to true

end tell