Saturday, February 20, 2021

Creating an e-Sword Bible Module in ToolTip Tool NT

Recently I "upgraded" to an iPhone from an Android and boy has it been a learning curve. I'm going to let that be a whole other post, but for this post I needed to find a good replacement for my QuickBible Android app that I used and loved on my Android. Unfortunately QuickBible doesn't have an IOS version so I had to try to find something else. Something that allowed for custom modules and highlighting of text, something, it turns out, that was not terribly easy to find. 

At first I was hoping to find a free solution, but lacking that (more about that in the "whole other post"), I finally found e-Sword which is available for IOS, Mac & Windows and cost me only $3.99 for the IOS version. I was familiar with making QuickBible modules, but this method is quite different. I haven't found a ton of explanations aside from the pretty solid pdf that goes along with the ToolTip Tool NT program which is basically a word processor and compiler for Bible and other files used by e-Sword. However I have run into a few things that weren't addressed (at least not that I could see), or confused me in some way so I thought it might help someone else if I listed how I did it and how it hopefully ended up working for me.

Since I had a Bible module for QuickBible already in Google Sheets, I just tweaked it to work in T4 (ToolTip Tool NT [I'm just guessing here, also the previous version was called T3 for whatever reason]).


I made a column for paragraph indications if I decide I want breaks between paragraphs (seen more in paraphrase type Bibles). The next three columns are pretty self-explanatory, then the Headers column is also for section headers seen more often in paraphrase type Bibles. 

Column G is for a formula which says if there is something in the cell to the left (a header), put a squiggle so that I can Find & Replace soft carriage returns and paragraph markings in Word which will be useful just before I take it into T4 [=IF(F3>0,"~","")]. 

Column H is a formula which puts a ^ at the end of the last sentence of a paragraph in my concatenated column so that I can put in the right breaks in Word so that e-Sword will do what it's supposed to do after T4 does its thing [=IF(A4="p","^","")]. 

Column I is the actual verse text and Column J has the formula which puts all the other columns together [=CONCATENATE(B3," ",C3,D3,E3,"  ",F3,G3,I3,H3)].

Going to T4, in v2019.10.07 (the one I have), click on the Modules(3) tab at the top of the screen. 

Next, click on Module Define Variables and then on BBLX - Bible File

This will bring up a new file will all the important information at the top needed to make the whole thing work. This is described on p. 57 of the ToolTip NT-2.10.pdf so it would make sense to go read the instructions there. 

Mine basically looks like this:

#define description=Full Name of Bible
#define abbreviation=FNB
#define comments=bible information window
#define version=1
#define strong=0
#define right2left=0
#define ot=1
#define nt=1
#define font=DEFAULT
#define appropha=0
÷

description shows up when you hover over the Bible tab in the e-Sword desktop version
abbreviation is what shows up on the actual Bible tab (takes up less room)
comments is where you can put more information about the Bible/translation
For the rest except for font, 1 means yes and 0 means no. Again, for a full explanation, please see the PDF.

The ÷ at the end tells e-Sword where the Bible is starting. 

A very basic Bible (no headings, no paragraph breaks) will start like this:

#define description=Full Name of Bible
#define abbreviation=FNB
#define comments=bible information window
#define version=1
#define strong=0
#define right2left=0
#define ot=1
#define nt=1
#define font=DEFAULT
#define appropha=0
÷Genesis 1:1 In the beginning God created the heaven and the earth. 
Genesis 1:2 And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.
Genesis 1:3 And God said, Let there be light: and there was light.

all the way down to and starting a new book (they just all run together)...

Genesis 50:26 So Joseph died, being an hundred and ten years old: and they embalmed him, and he was put in a coffin in Egypt.
Exodus 1:1 Now these are the names of the children of Israel, which came into Egypt; every man and his household came with Jacob.
Exodus 1:2 Reuben, Simeon, Levi, and Judah,

 With the paragraph marks set to visible, it looks like this:

÷Genesis 1:1 In the beginning God created the heaven and the earth.
Genesis 1:2 And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.
Genesis 1:3 And God said, Let there be light: and there was light.

etc.

You don't have to put those symbols in, they are just what happen internally when you press the enter key on your keyboard. 

Soft returns are made by holding the shift key down while you press the enter key. You use these when you add headers or paragraph breaks if you want to use them. If you follow the directions below for finding and replacing special characters as in my example, you don't have to worry about them unless you need to manually insert them inside T4.

I thought that I was supposed to put a ÷ in front of every book of the Bible, but I ran into errors when I did that so just the one at the beginning of Genesis is all you need.

If you want to get fancy and have headers and paragraph breaks, you'll need to copy your concatenated text into a word processor (I use Word, but Google Docs would work). Select all concatenated cells, copy and paste as text. 


Then do a Find and Replace (ctrl+H) and search for all ^s and replace them with ^l^p which is Word wildcard speak for "soft return" "hard return" which T4 understands.


Next do a F&R for ~ and replace them with soft returns (^l)


If you want to format the way your headers look, skip down to * before coming back here. (I'm kind of typing this as I work out the kinks for myself)

Now you can select your text in chunks (maybe 1/6 or less of the Bible at a time). If you try to copy and paste the whole Bible, you'll likely get a paste error (cannot read from or write to the clipboard) from T4 so slow and steady wins the race. Hint, I discovered that if I shrunk my font down to 5px in Word, I was able to copy the whole Bible and paste into T4 without the clipboard error. 

It wouldn't hurt to try a few verses of Genesis first and then when you feel comfortable, try more. To test your Bible module (which you can save in T4 as an .rtf file for safe keeping), click on Modules (3) tab, then Bible, then Save Bible File book chap:verse. (ETA, in v. 2019.0819, click on Modules > Bible Save Bible File book chap:verse)

T4 will go through your file and make sure there aren't any errors. If it finds any (at first it did for me because I had the wrong combinations of soft and hard paragraph returns), you'll have to try to figure out what the trouble is. Oh, one of my other errors were division symbols at the beginning of every book which it did NOT like. 

If everything is as it should be, T4 will take anywhere from a few seconds for a small section to a few minutes for a whole Bible to check everything over, then pop up a window saying File Created and giving the location it saved to. At this point, you can copy the .bblx file from where it saved (probably in your Documents folder inside an e-Sword ToolTip NT folder) to the root folder (probably C:\Program Files (x86)\e-Sword or some such location). 

Next launch e-Sword desktop version and your Bible tab should be available. If you only have a few verses in to test, click on Genesis 1:1 and you should see your content. If you make any editing changes in T4, go through the Mod3/Bible/SaveBibleFirst... hoops to save it again, make sure it saves into the same folder where your e-Sword.exe file is located, and then you can go back to e-Sword desktop, click on another Bible tab, then back to your Bible tab and updated changes should show.

*If you want your headers to be bold or have a different color or be italicized, you'll have to do that in T4 unless you want to do some more with Find & Replace in Word (it can be done and here's how if you want to know).

First, make sure you don't already have any square brackets anywhere else in your Bible. Add a column before and a column after your header column. Paste this formula and adjust it to your first header cell in the cell to the left of your first header cell. My formula for F3 is =IF(G3>0,"[","") and for H3 is =IF(G3>0,"]","") 


Then you'll go back up to the directions for pasting it into Word and doing the tricks to exchange ^ and ~ for soft and hard paragraph breaks. Then do a Find and Replace that looks like this:


Make sure you check the More >> button at the bottom and then on "Use wildcards." 

In the Find what: window, paste (\[)(*)(\]) and in the Replace with: window, paste \1\2\3 (Go here for a better explanation than I can give about why it works.) Also while you are still in the Replace with: window, go to the very bottom in the Find section and click on Format. There you can set what you want the headers to look like (Font > bold, italics, size, color...). Now click on Replace All

Finally do a Find & Replace to remove the brackets by searching for [ and replacing with an empty Replace with: window (delete everything out if there is anything there). Uncheck Use Wildcards for top window, and when you click in the replace window, click the No Formatting button at the bottom. That will replace all left square brackets with nothing. Do the same thing for right square brackets. 

Now when you go to copy your text piece by piece into T4, you'll see the formatting you applied.

Adding after the fact: The formatting looked fine in the T4 window when I pasted from Word, but when I saved as .bblx and opened it in e-Sword, the headers were bold and italicized, but were black so the color didn't transfer over. The sample Bible I looked at (Lexham English Bible) has teal headers and they show up as teal in e-Sword so I'm not sure what they did differently. Ah, I just figured it out. You have to choose colors that are in the T4 color palate. I think that could be solved by selecting the color you want from T4, clicking on the Format menu, then Font and click on Other next to the text color. Copy the Red/Green/Blue values and make sure you have those same numbers in Windows in the replace section. 

My Bible is now in e-Sword and from what I can tell, I need to download the e-Sword PC to iOS User Module Conversion Utility (Apple Converter) and then transfer the IOS friendly file via iTunes to my phone. There is another way to do it using ToolTip NT, but supposedly this is the easiest way. We shall see. (Not bad, takes awhile)

I installed the program and searched in Windows for "convert" and e-Sword PC to Apple Module Converter utility popped up. The window is auto-populated with Bible as the type of file to convert so I left that alone. I browsed to where my .bblx file is located and clicked on convert. As I type, verses are flying across the converter window and a green bar is moving from left to right so it looks like it's doing what it's supposed to. After that, who knows. I'll let you know when I figure it out.


Now it says "Conversion process completed. Created: cwb.bbli
Silly me, I didn't pay attention to where it said it saved it. I'm searching for it now.

Interesting... it doesn't give you an option of where to save it and it doesn't tell you at the end where it saved it. I did a Windows Explorer search and found it in C:\Users\user_name\AppData\Local\VirtualStore\Program Files (x86)\e-Sword so you might find yours there or somewhere similar, or you might have to search for it. 

To transfer it to your phone, connect your phone to your computer, open iTunes and click on the phone icon. Click on File Sharing in the Settings section. Then find the e-Sword app and click on that. You can either drag and drop the .bbli file from Windows Explorer into the e-Sword LT Documents section or you can go up to File and click on Add File Library (Ctrl+O). I think then you should be able to launch the e-Sword app from your phone and your Bible should show up. It did for me.