Link Layouts with Resource LinkSets (AHK Script)

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

Posts 384
PJ | Forum Activity | Posted: Sun, Jun 28 2020 4:47 AM

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

Page 1 of 1 (1 items) | RSS