April 03, 2017

Adding Non-English Book Names to Acc-Insert Verses Service

Update: Version 12.0.5 has fixed this issue. The tutorial now stands as an example of how to do your own custom changes of any sort to an Inserted text.


The Accordance Services allow you to pull all kinds of text out of Accordance and into your current program, without ever leaving the program you're working in. You can see an overview here. It was pointed out on the forums that when using the "Acc-Insert Verses" Service to insert scripture text into your document, that the book names are always in English even if your default language is non-English.
Since the Accordance Services are a type of Automator Workflow, you can customize them to your hearts content. A simple solution, then, is to add a step in the workflow that substitutes all English book names, with the name of your choosing. Here is an example of how to do it.

You can download the Service here, and install it.

All I've done is add a "Run AppleScript" Action that dissects a tab-delimited list of
EnglishName[tab]nonEnglishName
EnglishName[tab]nonEnglishName

EnglishName[tab]nonEnglishName
Hence, you can open up the Service in Automator and customize the list yourself, and save it.

For the Service to work, you need to make sure the "Get Text from Accordance" action has checked to "Use Citation Format", and that in Accordance:Preferences:Citation that you have not checked "Abbreviate book name".

That's all you really need to know to use the custom Service. For the curious, what I did was open the "Acc - Insert Verses" Service and duplicate it and named it with German in the title.

Then I added a new "Run Applescript" action and wrote a script that parses a tab-delimited list, making it easy to edit. The script looks for every instance of the original bookname followed by a space and a digit, replacing as directed. Here is the full text of the AppleScript:

on run {input}
set substitutionList to "Genesis Genesis
Exodus Exodus
Leviticus Levitikus
Numbers Numeri
Deuteronomy Deuteronomium
Joshua Josua
Judges Richter
Ruth Rut
1Samuel 1Samuel
2Samuel 2Samuel
1Kings 1Könige
2Kings 2Könige
1Chronicles 1Chronik
2Chronicles 2Chronik
Ezra Esra
Nehemiah Nehemia
Esther Ester
Job Hiob
Psalms Psalmen
Proverbs Sprichwörter
Ecclesiastes Kohelet
Song Hohelied
Isaiah Jesaja
Jeremiah Jeremia
Lamentations Klagelieder
Ezekiel Ezechiel
Daniel Daniel
Hosea Hosea
Joel Joël
Amos Amos
Obadiah Obadja
Jonah Jona
Micah Micha
Nahum Nahum
Habakkuk Habakuk
Zephaniah Zefanja
Haggai Haggai
Zechariah Sacharja
Malachi Maleachi
Tobit Tobit
Judith Judit
Wisdom Weisheit
Sirach Sirach
Baruch Baruch
1Maccabees 1Makkabäer
2Maccabees 2Makkabäer
1Esdras 1Esdras
Manasseh Manasseh
3Maccabees 3Makkabäer
2Esdras 2Esdras
4Maccabees 4Makkabäer
Matthew Matthäus
Mark Markus
Luke Lukas
Acts Apostelgeschichte
Romans Römer
1Corinthians 1Korinther
2Corinthians 2Korinther
Galatians Galater
Ephesians Epheser
Philippians Philipper
Colossians Kolosser
1Thessalonians 1Thessalonicher
2Thessalonians 2Thessalonicher
1Timothy 1Timotheus
2Timothy 2Timotheus
Titus Titus
Philemon Philemon
Hebrews Hebräer
James Jakobus
1Peter 1Petrus
2Peter 2Petrus
1John 1Johannes
2John 2Johannes
3John 3Johannes
John Johannes
Jude Judas
Revelation Offenbarung"
set theString to input as string
-- Create a tmp sed command file
-- s/foo\( [0-9])/bar\1/g
set tabReplace to "\\( [0-9]\\)/"
set paragraphReplace to "\\1/g
s/"
-- parse the replace string into lists
set commandString to ""
set otid to AppleScript's text item delimiters
set AppleScript's text item delimiters to tab
set commandString to text items of substitutionList
set AppleScript's text item delimiters to tabReplace
set commandString to "s/" & commandString as string
set AppleScript's text item delimiters to return
set commandString to text items of commandString
set AppleScript's text item delimiters to paragraphReplace
set commandString to (commandString as string) & "\\1/g"
set AppleScript's text item delimiters to otid
set commandFilePath to ((path to temporary items from user domain) as text) & "bibleBooks.sed"
try
set fileRef to open for access file commandFilePath with write permission
set eof of fileRef to 0
write commandString to fileRef
close access fileRef
on error
close access fileRef
end try
set posixPath to POSIX path of file commandFilePath
set scriptText to "echo " & quoted form of theString & " | sed -f " & quoted form of posixPath
set theResult to do shell script scriptText
return theResult
end run



April 01, 2017

Clergy Robe with a Handgun Pouch - Have I Now Seen Everything?

I've been looking for a clergy robe that looks better without a tie, and was very surprised to come across this, a preacher's robe with a designated pouch for carrying your gun:


When I did my SBL paper last year on the use of NT passages by Evangelical Christian national leaders when advocating for gun carry, I encountered stories of several ministers who not only went on record as carrying a gun daily, but thought it their vocation to encourage others to carry a gun.
But a preaching robe designed for carrying a gun while leading in worship on Sunday morning? Could it be that prevalent? How big could the market be for this? I guess they've sold some, since the description mentions it just came (back?) in stock today of all days.

I'm not saying that now I've seen everything… but this sure gets me closer.