Link Layouts with Resource LinkSets (AHK Script)

Pieter J.
Pieter J. Member Posts: 533
edited November 2024 in English Forum

Save the script with the name of a Layout.

Drop the script on the Toolbar as a Button.

Set LinkSets on Resources in the Layout.

When working in any Layout you can run the script to open the Layout with its name and to transfer linkset headings and/or references to the appropriate linksets in the Layout.

CODE

#SingleInstance force

StringReplace, LayoutName, A_ScriptName, .ahk,,All

LinkSets := []

App := ComObjActive("LogosBibleSoftware.Application")
App.Activate()

for Panel in App.GetOpenPanels
{
try
{
Col := Panel.GetCurrentReferencesAndHeadwords()
LogosReferenceOrHeadword := Col.Item[0]
LinkSets[Panel.LinkSet] := LogosReferenceOrHeadword
}
}

App.LoadLayout(LayoutName)

for Panel in App.GetOpenPanels
{
if Panel.Kind == "Resource" {
NavigationRequest := App.CreateNavigationRequest()
try {
NavigationRequest.Headword := LinkSets[Panel.LinkSet].Headword
NavigationRequest.HeadwordLanguage := LinkSets[Panel.LinkSet].HeadwordLanguage
NavigationRequest.Reference := LinkSets[Panel.LinkSet].Reference
} catch {}
Panel.Navigate(NavigationRequest)
}
}

4048.LayoutName.zip

Tagged: