How to copy Bible highlighting for one module to another?

Share your favorite tips, workarounds and shortcuts for theWord
csterg
Site Admin
Posts: 8627
Joined: Tue Aug 29, 2006 3:09 pm
Location: Corfu, Greece
Contact:

How to copy Bible highlighting for one module to another?

Post by csterg »

This information applies to TheWord ver.3 beta

Highlighting of Bible text is mostly unique in the sense that if the same formatting is applied to another text, it will mostly be misaligned. This is because the highlighting is calculated with the offset from the beginning of each verse. But there are cases that something like that can be useful (e.g. 2 modules with the same language). To do this, you will need to issue some sql commands to the database file that holds this information.

There are several ways to do so; the easiest (for windows) would be to get the sqliteExplorer program (http://www.singular.gr/sqlite/) or any other that can edit sqlite files (even the command line sqlite.exe utilllity is enough -get it here: http://www.sqlite.org/sqlite-3_5_2.zip and the documentation here: http://www.sqlite.org/sqlite.html).

The file to be alteredis the c:\Program Files\<user>\Application Data\The Word\Personal Data\my.bhls.twm. Make a copy before altering it.
In the program's folder (default c:\Program Files\The Word) there is also a link 'Pesonal Data' that gets you there.
Open this file with sqliteExplorer (or with the command line utillity)
The commands need to be executed are the following:

Code: Select all

create table tmp as
  select a.* from highlight a, highlight_master b where b.volumeid = a.volumeid and b.descr='oldmodule';

update tmp set volumeid=(select volumeid from highlight_master where descr='newmodule');

insert into highlight(volumeid, typ, vi, pos1, pos2, value)
  select volumeid, typ, vi, pos1, pos2, value from tmp;

drop table tmp;

vacuum;
For sqliteExplorer, just copy the above code and press 'Execute'.

Before executing do the following:
1. Replace oldmodule (second line of the code, at the end) with the filename of the module that contains the highlighting information. For example, if it is the KJV module that has this info, locate the actual file named kjv.ont. The name then should be kjv (capital letters do matter: please use exact name as it is used in the filename but without the .ont extension)
2. Replace newmodule with the module that you want to apply the highlighting to (same as 1). BE CAREFUL: before doing so, make sure that you have applied at least one formatting command to the module (e.g. from TW, go to this module and just make any word bold, that is enough).

Hope this is clear enough,
Costas