Generate Interactive Bible Citations With Powershell

According to Jesus, God continues to speak to us through His written word (Matthew 22:31–32). This Powershell script and video demo will make it easy to create Bible citations that draw your readers into God’s word. Note that Logos Bible Software must be running in your profile when you run the script.

# Script to generate interactive html Bible citations.
# Requires Logos Bible Software to be running from your profile.
# The translation is based on your default Bible in Logos.
# Do NOT run as administrator, since Logos is installed in your user profile.
# By Jacob Halvorson 2021-03-26
# Updated 2021-04-08 to remove "8" from $logos8
# Updated 2021-05-22 to add target='_blank' into html

$verse = Read-Host "Enter a Bible reference: "

# Get Bible text and citation from Logos
$launcher = New-Object -ComObject "LogosBibleSoftware.Launcher"
$logos = $launcher.Application
$ref = $logos.DataTypes.GetDataType("bible").ParseReference($verse)
$cbv = $logos.CopyBibleVerses
$req = $cbv.CreateRequest()
$req.Reference = $ref
$citation = $ref.Render()
$text = $cbv.GetText($req)

# Generate URL for verse on
$url = '' + $citation.Replace(' ','+')

# Generate html of citation 
$html = "(<a href='"
$html += "$url' " 
$html += "target='_blank' "
$html += "title='$text"
$html += "'>$citation</a>)."

# Copy to clipboard
Set-Clipboard $html

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s