Moving from Logos 3 API to Logos 4 API

Page 1 of 1 (9 items)
This post has 8 Replies | 1 Follower

Posts 10
Kevin MacMillan | Forum Activity | Posted: Sat, Mar 19 2011 10:19 AM

I am not a highly experienced programmer, but several years ago, I wrote up some code in MS VBA that copied verses from Libronix 3 automatically into a MS Word document. I would type the reference plus the translation I wanted (e.g. "AMP") in the document, and the VBA code would get the Bible text and paste it into my document immediately following the reference I had typed.

Because of this, I have hung on to my Libronix 3 software. But I recently heard from Logos that with the upcoming version of IE, they are essentially abandoning version 3. I have been looking through the 4 API, and I am somewhat confused. Is there a way to create a program that will do what i have been doing with version 3?

Any help would be appreciated!

KM

Posts 8601
TCBlack | Forum Activity | Replied: Sat, Mar 19 2011 11:17 AM

Kevin,

The script sounds quite cool and I wonder if it would port to OpenOffice.org?

Kevin MacMillan:
But I recently heard from Logos that with the upcoming version of IE, they are essentially abandoning version 3.
I think there is a misunderstanding.  Logos isn't abandoning L3.  See these relevant posts:

Truth Is Still Truth Even if You Don't Believe It

Check the Wiki

Warning: Sarcasm is my love language. I may inadvertently express my love to you.

Posts 401
Timothy Ha | Forum Activity | Replied: Sun, Mar 20 2011 12:35 PM

Does your program work when Libronix is not started?  Are you working directly with COM objects?

JesusChrist.ru - Russian Christian Portal, with free Bible software; Timh.ru - blog

Posts 10
Kevin MacMillan | Forum Activity | Replied: Sun, Mar 20 2011 3:30 PM

Hi Thomas

Actually, the program is indeed quite cool, although it's not entirely without bugs. I will certainly post the code if you'd like to have a look at it. I actually got the core of it from the Logos web site many years ago, then developed it further.

Thanks also for the links re IE 9. It looks like all is well for Libronix 3. At the same time, I would like to see if I can get this macro running with Logos 4.

 

Thanks again

KM

Posts 10
Kevin MacMillan | Forum Activity | Replied: Sun, Mar 20 2011 3:31 PM

Hi Timothy

Thanks for your reply. No, the macro doesn't work if Libronix is not running. I tried to get the macro to load Libronix, but I couldn't get it to work. would you like to see the code?

KM

Posts 7909
LogosEmployee

Kevin MacMillan:

I have been looking through the 4 API, and I am somewhat confused. Is there a way to create a program that will do what i have been doing with version 3?

I assume that you've already seen the following wiki pages:

 

 

The Logos Smart Tag uses the COM API to paste verses into Word, so I think the API should be sufficient for your needs.

Here's a simple example that may be able to get you going. Create a new macro module; in the Tools > References dialog, add a reference to Logos Bible Software 4 Type Library. Paste in the following macro; whenever you run it, it should insert John 3:16 into your document.

Sub CopyBibleVerses()
    Dim launcher As LogosLauncher
    Dim app As LogosApplication
    Dim cbv As LogosCopyBibleVerses
    Dim req As LogosCopyBibleVersesRequest

    Set launcher = New LogosLauncher
    Set app = launcher.Application
    Set cbv = app.CopyBibleVerses
    Set req = cbv.CreateRequest
    req.Reference = app.DataTypes.GetDataType("bible").ParseReference("John 3:16")
    Selection.TypeText Text:=cbv.GetText(req)
End Sub

 

Posts 10
Kevin MacMillan | Forum Activity | Replied: Mon, Mar 21 2011 5:47 PM

Hi Bradley

This is great - thank you very much! Two questions:

1) Is there a way to specify a Bible version?

2) Is there a way to specify a style?

Thaknyou so much again!

Kevin

Posts 7909
LogosEmployee
Bradley Grainger (Faithlife) | Forum Activity | Replied: Tue, Mar 22 2011 11:38 AM

Kevin MacMillan:

1) Is there a way to specify a Bible version?

2) Is there a way to specify a style?

Sorry, not in the current API. As noted in the API documentation, this (simple) method just uses "the user’s preferred Bible and the last-selected style in the Copy Bible Verses panel".

Posts 10
Kevin MacMillan | Forum Activity | Replied: Tue, Mar 22 2011 1:29 PM

Hmmm. I don't suppose thre's a way to change the preferred Bible through the API?

If this doesn't work, is there another way to approach this?

Thanks again for your help - I greatly appreciate it.

Kevin

Page 1 of 1 (9 items) | RSS