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
No comments:
Post a Comment