automation X

Example Toolbar Scripts


Home
automating X Home

Macros
Word Processors Macros

Scripts
Toolbar Scripts

Web Links
Series X Weblinks

FAQ
Frequently Asked Questions

Links
Other Useful Resources

About
About automating  X


  Thanks to Bill from Scripture Site who put together these scripts which were posted on logos.automation.

/* ********************************************************************
* Name: openToday
* Author: Jacob Carpenter
* Date: December 4, 2001
* Description: Opens devotional to Today
********************************************************************* */

var objDate = new Date(); // today's date, since we didn't specify
anything
Application.ExecuteCommand(
"keylink|ref=dayofyear."
+ ( objDate.getMonth() + 1 ) + "."
+ objDate.getDate()
)

/* ******************************************************************* */


/* ********************************************************************
* Name: openTodayAMPM
* Author: Jacob Carpenter (modified by Bill Bougie')
* Date: December 8, 2001
* Description: Opens devotional to the morning or evening reading
********************************************************************* */

var today = new Date();

// note: getHours values are between 0 (midnight) and 23 (11 p.m.)

if (today.getHours() <= 11)
hour = 1;
else
hour =2;

Application.ExecuteCommand("keylink|ref=dayofyear."
+ (today.getMonth() + 1 ) + "."
+ today.getDate() + "."
+ hour)

/* ******************************************************************* */


/* ********************************************************************
* Name: openThreeBibles
* Author: Mark
* Date: November 25, 2001
* Description: Opens 3 Bibles in a workspace.
********************************************************************* */

Application.ExecuteCommand( "jump|res=LLS:NKJV|target=left" );
var objWindow = Application.Windows.Item( "left" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState = Application.Constants.dlsWindowStateNormal;
objWindow.Left =0;
objWindow.Top = 0;
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight);
}
Application.ExecuteCommand( "jump|res=LLS:KJV|target=center" );
var objWindow = Application.Windows.Item( "center" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState = Application.Constants.dlsWindowStateNormal;
objWindow.Left = Math.floor(nUsableWidth / 3);
objWindow.Top = 0;
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight);
}
Application.ExecuteCommand( "jump|res=LLS:NIV|target=right" );
var objWindow = Application.Windows.Item( "right" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState = Application.Constants.dlsWindowStateNormal;
objWindow.Left = Math.floor(nUsableWidth * 2 / 3);
objWindow.Top = 0;
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight);
}

/* ******************************************************************* */


/* ********************************************************************
* Name: openThreeLinkedBibles
* Author: Mark (modified by Bill)
* Date: November 25, 2001
* Description: Opens 3 linked Bibles in a workspace.
********************************************************************* */

Application.ExecuteCommand( "jump|res=LLS:ESV|target=left" );
var objWindow = Application.Windows.Item( "left" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState = Application.Constants.dlsWindowStateNormal;
objWindow.Left =0;
objWindow.Top = 0;
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight);
}
Application.WindowLinkSets.Item("link-set-a").Windows.Add(objWindow);

Application.ExecuteCommand( "jump|res=LLS:KJV|target=center" );
var objWindow = Application.Windows.Item( "center" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState = Application.Constants.dlsWindowStateNormal;
objWindow.Left = Math.floor(nUsableWidth / 3);
objWindow.Top = 0;
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight);
}
Application.WindowLinkSets.Item("link-set-a").Windows.Add(objWindow);

Application.ExecuteCommand( "jump|res=LLS:NIV|target=right" );
var objWindow = Application.Windows.Item( "right" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState = Application.Constants.dlsWindowStateNormal;
objWindow.Left = Math.floor(nUsableWidth * 2 / 3);
objWindow.Top = 0;
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight);
}
Application.WindowLinkSets.Item("link-set-a").Windows.Add(objWindow);

/* ****************************************************************** */

/* ********************************************************************
* Name: positionWidows
* Author: Bob Prichett (modified by Bill Bougie')
* Date: December 8, 2001
* Description: Template for positioning windows
********************************************************************* */

// Open the ESV in a window in the top left of the workspace

Application.ExecuteCommand( "jump|res=LLS:ESV|target=esv-window" );

var objWindow = Application.Windows.Item( "esv-window" );

if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState = Application.Constants.dlsWindowStateNormal;
objWindow.Left = 0;
objWindow.Top = 0;
objWindow.Width = nUsableWidth - Math.floor(nUsableWidth / 2);
objWindow.Height = Math.floor(nUsableHeight / 2);
}

/* ******************************************************************* */

// Open the ESV in a window in the bottom left of the workspace

Application.ExecuteCommand( "jump|res=LLS:ESV|target=esv-window" );

var objWindow = Application.Windows.Item( "esv-window" );

if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState = Application.Constants.dlsWindowStateNormal;
objWindow.Left = 0;
objWindow.Top = Math.floor(nUsableHeight / 2);
objWindow.Width = nUsableWidth - Math.floor(nUsableWidth / 2);
objWindow.Height = Math.floor(nUsableHeight / 2);
}


/* ********************************************************************** */

// Open the ESV in a window in the upper-right

// Most existing Bibles have "LLS:<abbreviation>" as an alternate ID
// The "target" parameter sets the internal name of the window
// to be used. If a window with the target name exists it is re-used
// for the jump command, otherwise a new window is opened and
// given that name.

Application.ExecuteCommand( "jump|res=LLS:ESV|target=esv-window" );

var objWindow = Application.Windows.Item( "esv-window" );

if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState = Application.Constants.dlsWindowStateNormal;
objWindow.Left = Math.floor(nUsableWidth / 2);
objWindow.Top = 0;
objWindow.Width = nUsableWidth - Math.floor(nUsableWidth / 2);
objWindow.Height = Math.floor(nUsableHeight / 2);
}

/* ********************************************************************** */

// Open the ESV in a window in the bottom right of the workspace

Application.ExecuteCommand( "jump|res=LLS:ESV|target=esv-window" );

var objWindow = Application.Windows.Item( "esv-window" );

if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState = Application.Constants.dlsWindowStateNormal;
objWindow.Left = Math.floor(nUsableWidth / 2);
objWindow.Top = Math.floor(nUsableHeight / 2);
objWindow.Width = nUsableWidth - Math.floor(nUsableWidth / 2);
objWindow.Height = Math.floor(nUsableHeight / 2);
}

/* ********************************************************************** */

/* ********************************************************************
* Name: tileWidows
* Author: Dale Durnell
* Date: December 8, 2001
* Description: this code will evenly tile 6 windows in a workspace.
********************************************************************* */

Application.ExecuteCommand(
"jump|res=LLS:GNB|target=bottomright" );
Application.ExecuteCommand( "jump|ref=[en]bible:gen 1:1");
var objWindow = Application.Windows.Item( "bottomright" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState =
Application.Constants.dlsWindowStateNormal;
objWindow.Left = Math.floor(nUsableWidth * 2 / 3);
objWindow.Top = Math.floor(nUsableHeight / 2);
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight / 2);
}

Application.ExecuteCommand(
"jump|res=LLS:NCV|target=bottomcenter" );
Application.ExecuteCommand( "jump|ref=[en]bible:gen 1:1");
var objWindow = Application.Windows.Item( "bottomcenter" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState =
Application.Constants.dlsWindowStateNormal;
objWindow.Left = Math.floor(nUsableWidth / 3);
objWindow.Top = Math.floor(nUsableHeight / 2);
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight / 2);
}

Application.ExecuteCommand(
"jump|res=LLS:NIV|target=bottomleft" );
var objWindow = Application.Windows.Item( "bottomleft" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState =
Application.Constants.dlsWindowStateNormal;
objWindow.Left =0;
objWindow.Top = Math.floor(nUsableHeight / 2);
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight / 2);
}

Application.ExecuteCommand(
"jump|res=LLS:NAB|target=topright" );
Application.ExecuteCommand( "jump|ref=[en]bible:gen 1:1");
var objWindow = Application.Windows.Item( "topright" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState =
Application.Constants.dlsWindowStateNormal;
objWindow.Left = Math.floor(nUsableWidth * 2 / 3);
objWindow.Top = 0;
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight / 2);
}

Application.ExecuteCommand(
"jump|res=LLS:NJB|target=topcenter" );
Application.ExecuteCommand( "jump|ref=[en]bible:gen 1:1");
var objWindow = Application.Windows.Item( "topcenter" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState =
Application.Constants.dlsWindowStateNormal;
objWindow.Left = Math.floor(nUsableWidth / 3);
objWindow.Top = 0;
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight / 2);
}

Application.ExecuteCommand(
"jump|res=LLS:NRSV|target=topleft" );
Application.ExecuteCommand( "jump|ref=[en]bible:gen 1:1");
var objWindow = Application.Windows.Item( "topleft" );
if ( objWindow != null )
{
var nUsableWidth = Application.UsableWidth;
var nUsableHeight = Application.UsableHeight;
objWindow.WindowState =
Application.Constants.dlsWindowStateNormal;
objWindow.Left =0;
objWindow.Top = 0;
objWindow.Width = Math.floor(nUsableWidth / 3);
objWindow.Height = Math.floor(nUsableHeight / 2);
}

/* ********************************************************************** */


/* ********************************************************************
* Name: loadEnglish
* Author: Bob Prichett
* Date: November 16, 2001
* Description: loads English language
********************************************************************* */

Application.Options.SetLanguage("en");

Writing Scripts

Writing Scripts 

Scripts

 Scripts

Custom Toolbars

Custom Toolbars 

This site is maintained and updated by Andrew. Page Created: 23/2/2002. Page Updated: 23/2/2002 Current Date: