Introduction

When used with most popular applications, JAWS screen reading software provides you with screen information for the application you are using. The information that tells JAWS how to behave is contained within a set of "default files." These default files, created by Freedom Scientific, are provided with JAWS. Unfortunately, not all applications are the same. Therefore, information telling JAWS how to behave in these applications is contained in a set of "application-specific files."

JAWS Version History

The trajectory of JAWS development from its inception in 1989 through 2026 demonstrates a steadfast commitment to expanding accessibility across diverse computing environments and application types. Early JAWS releases (1995-2003) focused on foundational screen reading capabilities and basic scripting support, establishing the technical infrastructure for accessibility customization. However, the real transformation in accessibility occurred post-1996 with the introduction of scripting language enhancements. When scripting was first introduced in 1996, it empowered individual users and developers to bridge accessibility gaps that Freedom Scientific could not address alone. As JAWS evolved through subsequent versions, scripting capabilities grew exponentially: from basic event-driven automation (2003), to comprehensive UI Automation integration (2011+), to domain-specific web scripting (2015+), and finally to AI-enhanced page analysis and dynamic content navigation (2025-2026). These incremental scripting improvements translated directly into expanded accessibility functionality--enabling users to interact with previously inaccessible modern web applications, cloud-based software, enterprise systems, and specialized domain-specific tools without waiting for native accessibility implementation. By decoupling accessibility customization from JAWS core development cycles, the scripting language created a sustainable model where the community itself could drive accessibility innovation, significantly accelerating the pace at which blind and low-vision users gained access to mainstream technology.

Through the many options available in the JAWS application, changes and adjustments can be easily made to all of the commonly used features, such as Verbosity and Screen Echo. But despite this ability, you may find special situations that require more advanced or specific instructions so that JAWS can properly navigate and provide the correct screen information in the application.

VersionYearSupported OSNew Features
JAWS (MS-DOS)1989MS-DOSOriginal JAWS for DOS; later freeware
JAWS 11995Windows 3.1Windows release; DOS navigation concepts
JAWS 21996Windows 95Added Windows 95 support; Early scripting options
JAWS 31997Windows 95Broader Windows 95 support
JAWS 42001Windows XP, Windows 2000Transition to XP era
JAWS 42002Windows XP, Windows 2000Quick Navigation keys for IE
JAWS 52003Windows 2000, Windows XP, Windows 2003Web/document fixes; Adobe Reader/AIM JAWS scripting; Braille logic improvements
JAWS 62004Windows 95, Windows 98, Windows ME, Windows NT4, Windows 2000, Windows XPInternet License Manager (ILM); Unicode installer option
JAWS 72005Windows 2000, Windows XPFSClipboard; custom Excel summaries; Document Presentation Mode; Word quick keys
JAWS 82006Windows 2000, Windows XP, Windows 2003, ServerRealSpeak Solo voices; IE7 tabbed navigation; Startup Wizard; DAISY training
JAWS 92007Windows Vista, Windows XPOffice 2007 & Vista support; Gmail AJAX support
JAWS 102008Windows Vista, Server 2008, Windows XP, Windows 2003Auto Forms Mode; JAWS Tandem; RealSpeak Solo Direct; multi-sound-card routing
JAWS 112009Windows 7, Windows Vista, Windows XPResearch It; FSReader DAISY; UI Automation; multi-monitor support
JAWS 122010Windows 7, Vista, Windows XPBrailleIn; Virtual Ribbon; Settings Center
JAWS 132011Windows 7, Windows Vista, Windows XPConvenient OCR; Results Viewer; Quick Settings
JAWS 142012Windows 8, Windows 7Flexible Web; Windows 8 Start Screen & Store apps; new Vocalizer voices
JAWS 152013Windows 8, Windows 8.1, Windows 7Touch Cursor & gestures; Vocalizer Expressive integration
JAWS 162014Windows 7, Windows 8.1, Windows 10Command Search; OCR for PDFs
JAWS 172015Windows 10, Windows 8.1, Windows 7Smart Navigation; domain-specific web scripting; Liblouis UEB
JAWS 182016Windows 10, Windows 8.1, Windows 7Audio ducking; Mouse Echo; settings migration/export; Vocalizer Expressive 2.2
JAWS 20182017Windows 10, Windows 8.1, Windows 7Microsoft Edge support; Virtual Cursor; Navigation Quick Keys
JAWS 20192018Windows 10Faster startup; Audio Ducking; Screen Shade; Home Annual license
JAWS 20202019Windows 10Reduced double-speaking; Zoom scripts; UIA improvements
JAWS 20212020Windows 10Voice Assistant (Sharky); Picture Smart; OCR to Word
JAWS 20222021Windows 11, Windows 10Sound Splitter; settings migration; Braille Profiles
JAWS 20232022Windows 11, Windows 10Smart Glance; Notification History; ARM64 support
JAWS 20242023Windows 11, Windows 10Face in View; Split Braille; MathCAT integration
JAWS 20252024Windows 11, Windows 10, ARM64, Server 2016-2025FSCompanion; AI language detection; EPUB navigation
JAWS 20262025Windows 11, Windows 10, Server 2016+Vispero Accounts; Page Explorer (AI summaries)

JAWS Scripting Language Versions

The JAWS scripting language has undergone significant evolution since its inception in 1996, each update bringing substantial improvements to accessibility capabilities. Early versions introduced foundational scripting concepts and event-driven automation, allowing users to customize JAWS behavior for inaccessible applications. The introduction of the UIA Script API in JAWS 14 marked a pivotal advancement, enabling direct integration with Microsoft UI Automation--a modern accessibility framework that opened doors to controlling contemporary Windows applications that relied on UIA rather than legacy accessibility APIs. Subsequent versions expanded these capabilities with enhanced event handling, domain-specific scripting functions for web environments, and refined UIA properties, progressively empowering developers to build more sophisticated accessibility solutions. These advancements have democratized accessibility customization, enabling blind and low-vision users to work effectively in previously inaccessible software environments, while simultaneously reducing the burden on application developers to implement native accessibility features by providing an alternative customization pathway through scripting.

Year / VersionNew Features / Key Capabilities
JAWS 2 (1996)First inclusion of scripting support — allowed users to create custom scripts to automate JAWS interactions in inaccessible applications; introduced basic script structure and an event-driven model
JAWS 5 (2003)AccessWorld article spotlighted JAWS scripting; explained Script Manager, Keyboard Manager, variables, decision-making, and the Virtual Viewer; established scripting as a core accessibility customization tool
JAWS 14 (2012)Introduced UIA Script API, enabling direct access to Microsoft UI Automation elements; provided new functions for querying UIA trees and properties, improving support for modern Windows apps
JAWS 15 (2013)Expanded UIA Script API with additional methods for interacting with UIA controls; improved event handling and introduced more granular control over UIA elements
JAWS 17 (2015)Added Domain-Specific Scripts for web contexts — new functions (GetDocumentXML, PerformActionOnElementWithTagAndAttribute, PerformActionOnElementWithId) enabled dynamic web scripting for complex pages
JAWS 18 (2016)Updated UIA Script API with new properties (LandmarkTypeID, TextEditChangeType) and methods (AddTextEditTextChangedEventHandler); added support for UIA events and improved text-change tracking
JAWS 18 (2017) (Reference Manual)Basics of Scripting Manual: covered Keyboard Manager, Script Manager, decision logic, Virtual Viewer, and functions; provided foundational training for script developers

A script file contains a variety of scripts and functions that work together to extend JAWS functionality and customize its behavior for specific applications and use cases. You can think of scripts and functions as small computer programs--self-contained units of logic that execute in response to specific events or user actions. Each script or function contains commands that tell JAWS how to navigate through an application's interface, what information to speak or braille, and how to interpret and present complex data structures to users. The power of JAWS scripting lies in its ability to create customized accessibility solutions tailored to individual user needs and organizational requirements.

As you progress through this manual, you will learn to modify existing script files to alter JAWS behavior in specific applications, and you will also learn to write entirely new commands and functions to make previously inaccessible applications functional for blind and low-vision users. Through systematic practice with keyboard managers, script managers, and event handlers, you will discover how to create scripts that not only navigate applications more efficiently but also automate repetitive daily tasks, customize keyboard shortcuts, and optimize speech output for domain-specific workflows. The scripting language offers virtually unlimited possibilities--accessibility solutions bounded only by your imagination, creativity, and understanding of both JAWS scripting concepts and the target application's structure.

JAWS is not the only product developed by Freedom Scientific that takes advantage of the powerful scripting language. Both the MAGic screen magnification application, ZoomText, and Fusion take advantage of the power and flexibility offered by the scripting language. This shared scripting foundation means that skills you develop writing JAWS scripts will transfer directly to creating magnification and speech customizations in these related products. With the familiarity gained from writing JAWS scripts, you will be able to easily apply your knowledge and techniques when generating scripts that control magnification and speech functionality found in MAGic, ZoomText, and Fusion--making you a versatile accessibility technology developer capable of serving multiple user needs across Freedom Scientific's entire product ecosystem.

MSAA, UIA, and Scripting

JAWS scripting primarily interacts with applications through two main accessibility frameworks: Microsoft Active Accessibility (MSAA) and Microsoft UI Automation (UIA). MSAA, introduced in the mid-1990s, was the original accessibility API for Windows applications. It provides a way for assistive technologies like JAWS to access and interact with user interface elements. However, MSAA has limitations, particularly when dealing with modern applications that utilize complex UI components and dynamic content.

UIA, introduced in the mid-2000s, is the successor to MSAA and provides a more robust and flexible framework for accessing and interacting with user interface elements. UIA supports a wider range of control types, properties, and events, making it better suited for modern applications with rich, dynamic interfaces. JAWS scripting leverages both MSAA and UIA to ensure comprehensive accessibility support across a wide variety of applications, allowing scripts to interact with both legacy and contemporary software environments.

I-Accessible2 is an extension of MSAA developed to address some of its limitations, particularly in providing richer semantic information about UI elements. While JAWS scripting primarily utilizes MSAA and UIA, understanding IAccessible2 is important for script developers working with applications that implement this extended accessibility framework, as it can provide additional context and information that can be leveraged in scripts.

Accessibility API Milestones and JAWS Scripting Integration

The evolution of Windows accessibility APIs has directly shaped the capabilities available to JAWS script developers. The following timeline documents key advances in MSAA, UI Automation (UIA), and IAccessible2 that script developers leverage to access and control both internet applications and the Windows desktop environment:

YearAPI / MilestoneImpact on JAWS Scripting
1994MSAA ReleasedMicrosoft Active Accessibility (MSAA) introduced as the first Windows accessibility API — provided foundational support for assistive technologies to interact with application UI elements via the object model.
1996JAWS Scripting IntroducedJAWS 2 introduced scripting support, enabling users to leverage MSAA to customize JAWS behavior in inaccessible applications; early scripts relied on MSAA's limited but functional object hierarchy.
1998IAccessible2 Foundation Work BeginsEfforts began to address MSAA's limitations and design a more extensible accessibility standard; IAccessible2 would eventually provide richer semantic information.
2003IAccessible2 Specification PublishedLinux Foundation and GNOME Foundation released the IAccessible2 specification, offering a modern and comprehensive accessibility framework with support for complex UI patterns, relations, and document object models.
2005UIA Introduced (Internal)Microsoft began developing UI Automation (UIA) as the successor to MSAA, designed to support modern Windows applications with complex, dynamic interfaces; initially released internally for Vista development.
2006UIA Public LaunchUIA officially released with Windows Vista, providing a modern replacement for MSAA with richer control types, properties, patterns, and event support.
2011Web Accessibility Standards (ARIA) MatureW3C's ARIA specification matured, allowing web developers to enhance dynamic content accessibility; JAWS scripts began leveraging ARIA properties through browser object models.
2012UIA Script API LaunchedFreedom Scientific introduced the UIA Script API in JAWS 14, enabling direct script access to UIA elements, control patterns, and events — a major shift from MSAA-only scripting to modern UIA support.
2013UIA API ExpandedJAWS 15 expanded UIA scripting capabilities with additional methods for querying control properties, managing events, and interacting with complex UI patterns (e.g., data grids, trees).
2015Domain-Specific Web ScriptingJAWS 17 introduced domain-specific web scripting functions and improved ARIA support, allowing scripts to navigate and manipulate modern web applications with rich, JavaScript-driven interfaces.
2016UIA Event HandlingJAWS 18 enhanced UIA scripting with advanced event handling, text-change notifications, and refined UIA property access; scripts gained finer control over real-time application state monitoring.
2018--PresentJAWS Dual-Stack ScriptingJAWS scripts now routinely combine both MSAA (for legacy applications) and UIA (for modern applications), with built-in fallback mechanisms; scripts can detect and adapt to either API based on application architecture.

Do I Need a Programming Background to Write JAWS Scripts?

For those of you who ask, "Do I need a programming background to write scripts," the answer is that while a programming background is helpful, it is not necessary. In fact, many script developers working for Freedom Scientific are self-taught, and countless accessibility professionals and blind users have become proficient JAWS scripters through self-directed learning and community collaboration. The JAWS scripting language was deliberately designed to be accessible and approachable, with intuitive syntax and logical structure that makes it learnable by individuals with varying technical backgrounds. What matters most is not your prior programming experience, but rather your motivation to expand accessibility, your willingness to learn through experimentation and practice, and your commitment to understanding how JAWS interacts with applications. It is for this reason alone that we have compiled this comprehensive step-by-step manual in hopes that you will gain a solid foundation in scripting fundamentals, develop practical competency in creating and debugging scripts, and ultimately take the first steps toward becoming a successful JAWS script developer capable of solving real-world accessibility challenges.

Further Reading and Resources

More Resources for JAWS Version History

{{#cite jaws1}}

{{#cite jaws2}}

{{#cite jaws6}}

{{#cite jaws7}}

{{#cite jaws8}}

{{#cite jaws9}}

{{#cite jaws10}}

{{#cite jaws11}}

{{#cite jaws12}}

{{#cite jaws13}}

{{#cite jaws14}}

{{#cite jaws15}}

{{#cite jaws16}}

{{#cite jaws17}}

{{#cite jaws18}}

{{#cite jaws2019}}

{{#cite jaws2020}}

{{#cite jaws2021}}

{{#cite jaws2022}}

{{#cite jaws2023}}

{{#cite jaws2024}}

{{#cite jaws2025}}

{{#cite jaws2026}}

More Resources for JAWS Scripting Language History

{{#cite vispero1996}}

{{#cite afb2003}}

{{#cite fsmanual2011}}

{{#cite jaws14uia}}

{{#cite jaws15uia}}

{{#cite jaws17domain}}

{{#cite jaws18uia}}

{{#cite communityresources}}

MSAA, UIA, and Scripting History

{{#cite microsoft:MSAA-spec}}

{{#cite freedomscientific:basicsscripting}}

{{#cite linuxfoundation:IAccessible2-spec}}

{{#cite microsoft:UIA-spec}}

{{#cite w3c:WAI-ARIA}}

{{#cite jaws14uia}}

{{#cite jaws15uia}}

{{#cite jaws17domain}}

{{#cite jaws18uia}}



Definitions and Conventions

Definition of Terms

We will be using a variety of new terms in this manual to describe scripts and functions along with their uses. Terms are listed below along with their meaning. You will find more detailed information about these terms as they are introduced in this manual.

Built-in Function Built-in functions are functions created by the developers at Freedom Scientific. They are used as building blocks for your scripts and functions. Although built-in functions can be used anywhere, they cannot be modified.

Call The term "call" is used whenever a function is performed from within a script or another function.

Compile The term "compile" refers to the action of converting the scripts contained within your script file into a language that can be understood by your computer.

Constant A "constant" is a name you give to a hard-to-remember numeric value or sequence of characters. Constants are not changed during the execution of your script or function and are typically defined in a JAWS script header file. You use constants in place of hard-to-remember values in your scripts and functions.

Event Function Event functions have been created by developers at Freedom Scientific and are triggered by various Windows events. Examples of events that trigger event functions are when the system focus changes or when new text is displayed on the screen. Event functions can be modified or customized for your own use but you cannot create new event functions. You can find all the event functions in the Default.jss script file.

Function A "function" is also a series of statements that performs a given task. Functions are not activated by a keystroke. Functions are called by scripts or other functions.

Key Words "Key words" are words that are reserved for use by the scripting language. Some of the key words used in the scripting language are Script, EndScript, If, EndIf, While, and EndWhile.

Parameter A "parameter" is a piece of information that is passed to a function. The function uses the parameter to process its task.

Return A "return" is a piece of information a function sends back to a script or function from which it is called.

Script A "script" is a series of statements that performs a given task. The script is normally activated by a keystroke.

Script File A "script file" is a collection of scripts, functions, and variable declarations with the file extension of .jss for JAWS script source.

Statement A "statement" is a series of words used within your script that performs an action or group of actions. For example, the following block of code is considered to be a statement:

If A > B Then

User-defined Function User-defined functions are functions created by individual script writers. User-defined functions can be modified and you can create as many as you need. You will find many examples of user-defined functions in the default JAWS script files.

Variable A "variable" is an entity that holds a value. Unlike a constant, the value of a variable can be modified by your script or function during its execution.

Window A predefined rectangular area on the screen that can be identified by unique characteristics. Windows usually contain text, graphics, or various types of controls used by an application.

Scripting Language Key Words

Listed below are the key words used in the JAWS scripting language. These key words are reserved for use by the scripting language and cannot be used as variable names, function names or script names.

Const This key word begins a declaration section of constant values. All constant declarations follow on subsequent lines. The const key word must appear outside of any individual script or function. You can normally find constant definitions at the top of a script file or within a JAWS script header file.

EndFunction This key word terminates the definition of an individual user-defined function. Each user-defined function must be terminated with EndFunction. The Script Manager automatically places this key word into your script when you use the New Script dialog to create a user-defined function.

ElIf This key word offers a second way of creating a branch in an If statement structure. The ElIf key word is followed by a condition that JAWS evaluates. When the condition is found to be true, any statements following the ElIf are performed by JAWS.

Else This key word is an optional part of an If-Then-EndIf statement structure. The Else key word provides for a second branch in an If statement structure. When the preceding If statement is false, then any statements following this key word are performed by JAWS.

EndFor This key word terminates the For loop statement structure. Each For loop must be terminated with this key word. All statements placed between the For key word and this key word are performed by JAWS while the condition being evaluated in the For statement structure is true.

EndIf This key word marks the end of an If-Then-Else-EndIf statement structure. The EndIf key word is always required to terminate any If statement structure.

EndScript This key word terminates the definition of an individual script. JAWS automatically places this key word into your script file when you use the New Script dialog from within the Script Manager to create a script. Each script must be terminated by this key word.

EndWhile This key word terminates the While loop statement structure. Each While loop must be terminated with this key word. All statements placed between the While key word and this key word are performed by JAWS while the condition being evaluated in the While statement structure is true.

For The For key word begins the For loop statement structure. The For key word must be followed by a statement that dictates how many times the loop should execute. While the condition in the For statement structure is found to be true, the loop continues to be processed. Once the condition becomes false, the loop terminates.

Function This key word designates the beginning of a user-defined function. The key word is preceded by the return type of the function. The name of the user-defined function follows this key word along with any parameters the function requires enclosed in parentheses.

Globals This key word begins a declaration section of global variables. All global variable declarations follow on subsequent lines. The Globals key word must appear outside of any individual script or function. You can normally find global variable declarations at the top of a script file or within a JAWS script header file.

Handle This key word begins the definition of a handle variable type. The name of the variable follows this key word as in handle hMyHandle.

If This key word marks the beginning of an If-Then-Else-EndIf structure. A fully formulated statement includes: If, Then, Else, and EndIf. If statements evaluate a condition, that is part of the statement structure. When the condition being evaluated is true, then JAWS performs any statements following the If statement.

Int This key word begins the definition of an integer variable type. The name of the variable follows this key word as in int iMyInteger.

Not This key word reverses the question asked by an If statement structure. The key word is placed between the If key word and the condition being evaluated. This is also represented by an exclamation point (!)1 in the script.

Object This key word begins the definition of an object variable. The name of the variable follows the key word as in object oMyObject.

Return This key word terminates execution of the function in which it appears. When you use this key word to return a value from a function, the information to be returned must follow the return key word. Control, along with any value, is then returned to the calling script or function. Since a script cannot return values, using the return key word within in a script terminates the script at the point the key word is used.

Script This key word designates the beginning of an individual script. This key word precedes the actual name of the script. Each time you use the New Script dialog in Script Manager to create a script, this key word, along with the script name, is placed in the script file automatically.

Then This key word follows the condition being evaluated in either an If statement or and ElIf statement.

String This key word begins the definition of a string variable. The name of the variable follows the key word as in string sMyString.

Var This key word begins a declaration section of local variables. All local variable declarations follow on subsequent lines. The Var key word must appear within an individual script or function. The first line of a script or function usually contains the Var key word as local variables must be declared before they can be used.

While The While key word begins the While loop statement structure. The While key word must be followed by a conditional statement that is evaluated each time the loop is repeated. While the condition in the While statement structure is found to be true, the loop continues to be processed. Once the condition becomes false, the loop terminates.

Keywords and Non-Required Keywords

The Freedom Scientific Scripting language supports the use of many keywords. But not all are required. Below is a listing of required and non-required keywords you may use in your scripts and functions.

Required Keywords

The below list of required keywords are reserved for use by the Scripting language and cannot be used as variable names, function names, or script names. The list is broken out into areas of usage in level 3 headings and the keywords themselves in level 4 headings within the level 3 headings. Links direct you to relevant summary pages or overview pages for a more in-depth discussion of complex concepts.

  • Keywords for Functions and Scripts

  • Keywords for Control Flow

  • Keywords for Variables and Constants

  • Keywords for Compiler Directives

Keywords for Functions and Scripts

The keywords in this section are for function and script code blocks. For more details on how to utilize Return statements, parameters, and function types, see Calling Scripts and Functions.

Function and EndFunction Begins and terminates the definition of an individual function, whether it is a built-in, default, or user-defined function. Each function must begin and terminate with the keywords, Function and EndFunction

EndFunction When you use the Script Manager's "New Script" dialog to create a user-defined function, the Script Manager automatically places the keywords, Function and EndFunction into your file, separated by several blank lines for you to fill with your source code. But if you check the control in the dialog that refers to assigning a keystroke, the Script Manager automatically changes the keywords placed into your file to Script and EndScript.

You may need to precede the Function keyword by the return type of the function. The name of the function is followed by a parameter list, whether those parameters are required or optional, and parameters that must be passed to the function by reference. The parameter list is enclosed in parentheses. For example a function might be called something like:

Void Function SpeakNames(String sMyName)

Script and EndScript Begins and terminates the definition of an individual script, whether it is a default script or a user-defined script. Each script must begin and terminate with the keywords, Script and EndScript.

When you use the Script Manager's "New Script" dialog to create a user-defined script, the Script Manager automatically places the keywords, Script and EndScript, along with several blank lines into your file for you to fill in your source code. But if you uncheck the control in the dialog that refers to assigning a keystroke, the Script Manager automatically changes the keywords placed into your file to Function and EndFunction.

The keyword, "Script", must be followed by the name of the script and end with opening and closing parentheses. If using the Script manager "New Script" dialog, the Script manager automatically does this for you. Scripts can take parameters in a very specific format and manner, although most of the time they do not. For example, the following statement is valid:

Script MyTestScript ()

But the following statement is in an invalid format for declaring a script or a function with parameters:

Script MyTestScript ("hello")

Return Terminates execution of the script or function in which it appears. When used to return a particular value from within a function, add the information to be returned immediately after the Return keyword in the format the calling script or function expects. Doing so shifts control, along with any value, to the calling script or function.

Since a script cannot return values, using the Return keyword within a script terminates the script at the point the keyword is used.

For more details on how to utilize Return statements, see Return Statements.

Optional Used to declare optional function parameters in a parameter list. All parameters you declare after the keyword, Optional, are assumed to be Optional parameters. For example, the following statement shows that the first parameter of the function is required when calling the function but the second is not:

Function SpeakNames (String sMyName, Optional Int iMyAccountNumber)

ByRef Used to declare that a parameter is to be passed by reference in a function. The following example shows that the parameter is to be passed by reference when the function is called rather than a copy being passed to the function when the function is called:

Function SpeakNames (String ByRef sMyName)

It is possible to list parameters such that some are passed by reference and some are not, regardless of whether the parameters are required or optional. The following example shows that a copy of the string is passed to the function, but the account number is passed by reference when the function is called:

Function SpeakNames (String sMyName, Int ByRef iAccountNumber) 

Keywords for Control Flow

For more details on working with conditional statement structures and looping functions, see the following:

If, ElIf, Else, and EndIf Used to create one form of a conditional control-flow code statement structure. The keywords, If and EndIf, are required to begin and terminate the statement structure. But unless more than one condition is being tested, ElIf, and Else are not necessary for an If-EndIf statement structure to be processed. The keyword, Then, is optional. (See the section on Non-Required Keywords below).

The ElIf keyword is an optional part of an If-EndIf statement structure. It allows you to create a second conditional branch in an If-EndIf statement structure. As with the If condition in the first branch, when the ElIf condition evaluates to true, the screen reader performs any statements following it.

The Else keyword is an optional part of an If-EndIf statement structure. It allows you to create another conditional branch that is processed only when any preceding conditions in theIf-EndIf statement structure have evaluated to false.

A completely formulated If-EndIf statement structure looks like the following sample:

If (My condition1) Then
    ; process Statements
ElIf (My next condition) Then
    ; process statements
    ; further ElIf conditions If needed...
    ; process statements For each ElIf condition
Else
    ; process statement when all above conditions are False.
EndIf ; formally ends the If-Then statements

For, To, Descending, EndFor The keyword, For, begins the For loop statement structure, and the keyword, EndFor, terminates the block. The keyword, To, is required. But the keyword, Descending, is required only to iterate in descending order.

Following the keyword, For, in the For loop statement block, you must have a statement that dictates how many times the loop should execute. As long as the condition in the For part of the statement block evaluates to TRUE, the loop continues processing any statements placed within the loop. When the condition becomes FALSE, the loop terminates. But the loop statement block must terminate with the keyword, EndFor, in order to compile properly.

ForEach, In, EndForEach The keyword, ForEach, begins the ForEach loop statement structure, and the keyword, EndForEach terminates the statement block. The keyword, In, specifies which structure to process.

Following the keyword, ForEach, you must have a statement that dictates the structure whose items are to be processed. Any statements placed within the loop are processed for every item in the structure named in the ForEach part of the statement. The loop statement structure must terminate with the EndForEach keyword in order to compile properly.

While-EndWhile Begins and terminates the While loop statement structure. A While loop must begin and terminate with the keywords, While and EndWhile. The While keyword begins the While loop statement structure. It must be followed by a conditional statement that is evaluated each time the loop is repeated. As long as the condition in the While statement structure evaluates to true, the loop continues processing any statements placed within the loop. When the condition becomes false, the loop terminates. But the loop statement structure must terminate with the EndWhile keyword in order to compile properly.

Keywords for Variables and Constants

For more details on working with variables and constants, see the following:

  • Variables and Constants

  • Constants.

  • Non-aggregate Variables.

  • Collections

  • Array

Const Begins a declaration section of constant values. All constant declarations follow on subsequent lines, each ending with a comma except for the last one.

The Const keyword and its declarations must appear outside of any individual script or function. Constant declarations are typically located at the top of a script source file or within a screen reader script header file.

Globals Begins a declaration section of global variables. All global variable declarations follow on subsequent lines, each ending with a comma except for the last one.

The Globals keyword must appear outside of any individual script or function. Global variable declarations are typically located at the top of a script source file or within a screen reader script header file.

Var Begins a declaration section of local variables. All local variable declarations follow on subsequent lines, each ending with a comma except for the last one.

The Var keyword must appear within an individual script or function where local variables are declared. The first line of a script or function usually contains the Var keyword, followed by at least one local variable declaration since local variables must be declared before they can be used.

Handle Begins the definition of a handle variable type. The name of the variable follows: for example, Handle hwnd.

Int Begins the definition of an integer variable type. The name of the variable follows: for example, Int iMyAccountNumber.

Object Begins the definition of an object variable type. The name of the variable follows: for example, Object oMyObject.

String Begins the definition of a string variable type. The name of the variable follows: for example, String sMyName.

Variant Begins the definition of a variant variable type. The name of the variable follows: for example, Variant vMyVariant.

Var
    Handle hHandleVariable
    Int iIntVariable
    Object oObjectVariable
    String sStringVariable
    Variant vVariantvariable
Const
    True = 1
    False = 0
    On = 1
    Off = 0
Globals
    IntArray giaIdentificationsList,
    Int giChromeVersion,
    Int giChromeMinorVersion,
    Int giChromeUpdateVersion,
    String gsAppName,

Keywords for Aggregate Variable Types

The following keywords apply specifically to aggregate variable types. They include:

  • Collection

  • New

  • IntArray

  • StringArray

  • HandleArray

  • ObjectArray

  • VariantArray

Keywords for Compiler Directives

The following are keywords for compiler directives. For more details on their usage, see Compiler Directives.

  • Include

  • Use

  • Import

  • #Pragma StringComparison

  • Prototype

  • ScriptFile

  • ScriptFileVersion

Non-Required Keywords

The below list contains a few keywords that are no longer required but often make readability easier.

Then Follows the condition being evaluated in either an If statement or and ElIf statement. For example the following two statements are evaluated in the same manner:

If (MyCondition) Then
; is equivalent To
If (MyCondition)

Not Reverses the condition of a statement that evaluates conditions in an If-EndIf statement structure. The keyword is placed between the keyword that begins an evaluation statement and the condition being evaluated. The Not keyword is often replaced by the exclamation (!) operator2, which is processed in the same manner when compiled. for example, the following two statements are evaluated in the same manner:

If Not (MyCondition)
; is equivalent To
If !(MyCondition)

Let Begins the assignment of a variable to a value. The variable name followed by a single equals (=) sign followed by the value completes the statement. If the variable type is a string, the value must be enclosed in quotation marks. For example, the following two statements are evaluated in the same manner:

Let sMyWorkplace = "Freedom Scientific" ; strings require quotation marks
sMyWorkplace = "Freedom Scientific"
    ; AND
Let iMyAccountNumber = 12345 ; numbers (integers) are Not surrounded by quotation marks
iMyAccountNumber = 12345

Void Used to declare a function type as returning no value when returning to a calling script or function. A function that is declared as being of a type like Integer or String returns a value of that type to the calling script or function. If a function is not declared to be of any specific type, it is assumed to be of type Void.

1

This is often pronounced "bang" by JAWS and NVDA screenreaders

2

JAWS and NVDA pronounce this as "bang" by default



A Note on the Use of AI in JAWS Scripting

Introduction

The rapid advancement of Large Language Models (LLMs) and Artificial Intelligence (AI) has fundamentally transformed software development practices across the industry. Tools such as GitHub Copilot, ChatGPT, Claude, and various open-source alternatives have become integral to modern development workflows, with Google reporting that "the same amount of characters in the code are now completed with AI-based assistance as are manually typed by developers". This transformation has led many developers to explore AI-assisted code generation for specialized scripting languages, including JAWS Scripting Language (JSL).

However, the application of LLMs to specialized, low-resource programming languages like JAWS Scripting Language presents unique challenges that warrant careful examination. This chapter explores both the potential benefits and significant limitations of using AI for JAWS script generation, supported by current research on LLM code generation capabilities and their particular struggles with domain-specific languages.

The Promise and Reality of AI-Assisted Code Generation

Advantages of Using LLMs for Code Generation

When applied appropriately, LLMs and AI can offer several advantages in software development:

  1. Increased productivity: LLMs can automate routine code generation tasks, allowing developers to focus on higher-level aspects of projects such as architecture, design decisions, and complex problem-solving.

  2. Faster development cycles: By leveraging LLMs, developers can rapidly prototype and iterate on their ideas, potentially reducing time-to-market for new features and applications.

  3. Reduced human error: Automated code generation can minimize certain types of human errors, such as typos or basic syntax mistakes, when the model has sufficient training data and the language is well-represented.

  4. Consistent formatting: LLMs can help ensure that generated code adheres to consistent formatting and coding conventions, improving code readability and maintainability when properly configured.

  5. Learning assistance: For developers new to a language or framework, LLMs can provide examples and explanations that facilitate learning, though these must be carefully verified.

  6. Boilerplate generation: LLMs excel at generating repetitive code structures and standard implementations that follow well-established patterns.

General Disadvantages and Limitations

Despite these advantages, LLMs face significant challenges in code generation:

  1. Lack of deep understanding: LLMs struggle to grasp intricate details and nuances of specific project requirements, leading to potential inaccuracies or incomplete code that may appear correct superficially but fail under real-world conditions.

  2. Functional correctness issues: Generated code may run successfully but fail to pass all unit tests due to logic errors and misunderstandings, producing output that does not fully satisfy intended functionality or performance criteria.

  3. Complex requirement handling: LLMs often struggle with generating code for complex or highly specific scenarios that require domain expertise and manual intervention.

  4. Security vulnerabilities: AI-generated code can inadvertently introduce security vulnerabilities or expose sensitive information if proper security measures are not rigorously validated.

  5. Dynamic content challenges: LLMs may struggle to generate code that effectively handles dynamic or user-generated content, such as robust input validation or real-time data processing.

  6. Hallucination problems: LLMs frequently "hallucinate" by fabricating package names, APIs, or functions that do not exist, creating code that appears plausible but is fundamentally broken.

  7. Overconfidence: LLMs deliver outputs with unshakable confidence, even when generating incorrect or fabricated code, making it difficult for less experienced developers to identify problems.

The Challenge of Low-Resource Programming Languages

Understanding Low-Resource and Domain-Specific Languages

JAWS Scripting Language falls into the category of Low-Resource Programming Languages (LRPLs) and Domain-Specific Languages (DSLs). Research has shown that LRPLs and DSLs face unique challenges, including severe data scarcity and highly specialized syntax and semantics that are poorly represented in general-purpose datasets.

The lack of specialized datasets and benchmarks, combined with limited research focus on LRPLs and DSLs, has resulted in fewer advancements in handling these languages effectively. This creates a significant gap in LLM capabilities when developers attempt to use these tools for specialized scripting tasks.

Technical Architecture of JAWS Scripting

Before examining the specific challenges LLMs face with JAWS scripting, it is essential to understand the technical architecture and compilation model that makes JAWS scripting fundamentally different from interpreted scripting languages that LLMs encounter more frequently.

The Compiled Nature of JAWS Scripts

JAWS Scripting Language is a compiled, proprietary language, not an interpreted scripting language. This distinction has profound implications for development workflow and for LLM-generated code:

  1. Source to binary compilation: JAWS scripts are written in human-readable source files (.jss) that must be compiled into machine-readable binary files (.jsb) before execution. The compilation process is performed by either:

    • SCompile.exe - A command-line compiler located in the JAWS program directory (typically C:\Program Files\Freedom Scientific\JAWS[version]\scompile.exe)

    • The JAWS Script Manager - An integrated development environment accessed via INSERT+F2, which provides compilation, editing, and debugging capabilities

  2. Compilation syntax checking: The compiler performs strict syntax validation, rejecting any code that violates JSL grammar rules. Error messages report the specific file, line number, and column where syntax violations occur (e.g., "file notepad.jss, line 5, column 1: Unknown variable ioi").

  3. Language-specific compilation: A critical technical limitation is that scompile.exe always compiles scripts for the language of the currently-running JAWS instance. This means that generating a .jsb file in a folder for another language actually compiles the script for the running language, not the target language. Multi-language script distribution requires specialized build tools or JAWSUtil.vbs scripts.

  4. Binary protection: The compiled .jsb files serve a dual purpose - performance optimization and intellectual property protection through source code obscuration. Users cannot read .jsb files to understand script logic without access to the original .jss source files.

  5. Deployment requirements: For scripts to function, the compiled .jsb files must be placed in specific directory structures:

    • User-specific settings: C:\Users[username]\AppData\Roaming\Freedom Scientific\JAWS[version]\Settings\enu\

    • All-users settings: C:\ProgramData\Freedom Scientific\JAWS[version]\Settings\enu\

  6. Script reloading: After compilation, JAWS must reload the scripts to recognize changes. This typically requires either restarting JAWS or explicitly reloading the script file for the active application.

The Multi-File Architecture

Professional JAWS script development involves coordinating multiple file types, each serving distinct purposes:

  • .jss (JAWS Script Source): Contains the executable script code, user-defined functions, and event handlers. This is the primary file that developers write and that must be compiled.

  • .jsb (JAWS Script Binary): The compiled machine code generated from .jss files. JAWS reads only .jsb files at runtime; .jss files serve solely as source for development.

  • .jsh (JAWS Script Header): Defines global variables, constants, window names, window classes, and external function declarations. By convention, constants for window names use "wn" prefix, window classes use "wc", and global variables use "g" prefixes (gi for global integer, gs for global string, etc.).

  • .jsm (JAWS Script Messages): Contains all localizable strings, spoken messages, and on-screen text used for comparison. Messages use "msg" prefix, comparison strings use "sc" prefix. This separation enables internationalization without modifying script logic.

  • .jkm (JAWS Key Map): Defines keyboard shortcuts that trigger specific scripts. Uses a proprietary syntax for mapping key combinations to script names. Organized by keyboard layout (Desktop, Laptop, etc.).

  • .jsd (JAWS Script Documentation): Contains structured documentation for each script and function, including synopsis, description, parameters, and return values. JAWS reads this file to provide Keyboard Help (INSERT+F1) information to users.

  • .jcf (JAWS Configuration): Stores application-specific configuration settings and user preferences for how JAWS should behave with particular applications.

  • .jdf (JAWS Default): Defines default settings and behaviors that JAWS should apply when no custom scripts exist for an application.

The coordination between these files follows strict conventions detailed in Chapter [scripting-standards]{reference-type="ref" reference="scripting-standards"}. For example, a message defined in the .jsm file as msgButtonText = "Click the button" would be referenced in the .jss file using SayFormattedMessage(msgButtonText, sButtonName) where sButtonName is a string variable containing the actual button name.

The Windows Accessibility API Layer

JAWS scripts operate at the intersection of multiple Windows accessibility APIs, each with different characteristics and capabilities:

MSAA (Microsoft Active Accessibility) The legacy API introduced in Windows 95, based on the Component Object Model (COM). MSAA exposes basic information such as object name, role, location, and state through the IAccessible interface. MSAA uses a hierarchical model with parent-child relationships and supports simple child elements identified by numeric Child IDs.

IAccessible2 An extension of MSAA developed by IBM and placed under the Linux Foundation. IAccessible2 fills perceived omissions in MSAA by adding support for:

- Complex text attributes and text formatting

- Table navigation with row/column headers

- Relations between objects (e.g., labels for controls)

- Unique object identifiers that persist across sessions

- Enhanced state information beyond MSAA's basic states

IAccessible2 does not support child IDs; full accessible objects must be created for each element. JAWS scripts must use QueryService to switch between MSAA IAccessible and IAccessible2 interfaces.

UI Automation (UIA) Microsoft's modern accessibility API introduced in Windows Vista and .NET Framework 3.0. UIA marks a radical architectural departure from MSAA, using a provider/client model rather than COM-based interfaces. Key differences include:

- Separate provider-side (application) and client-side (AT) APIs

- Rich support for patterns (interfaces) that controls implement

- More detailed element property exposure

- Event model based on property changes rather than focus changes

- Out-of-process operation for improved security and stability

UIA Express (IAccessibleEx) A bridge interface that allows mapping between UI Automation elements and MSAA interfaces, enabling interoperability during the MSAA-to-UIA transition period.

JAWS provides native support for all these APIs, but scripters must understand which API is being used by target applications and choose appropriate functions accordingly. The JAWS UIA Script API, introduced in JAWS 2020, gives scripters direct access to the UI Automation infrastructure through functions like:

  • FSUIA_CreateElement() - Creates a UIA element object from a window handle

  • FSUIA_GetProperty() - Retrieves UIA property values (returns VARIANT type)

  • FSUIA_FindFirst() and FSUIA_FindAll() - Search for elements using UIA tree walker patterns

  • ComAttachEvents() - Registers event handlers for UIA property changes, structure changes, and automation events

The UIA API uses pre-defined integer constants for element types, property identifiers, pattern identifiers, and control types, all declared in the UIA.jsh header file provided with JAWS.

Specific Challenges for JAWS Scripting Language

Given this technical architecture, JAWS Scripting Language presents several unique challenges that make it particularly problematic for LLM-based code generation:

  1. Extremely limited training data: Unlike popular languages such as Python, JavaScript, or Java, JAWS scripts are rarely published in open-source repositories. The proprietary nature of many JAWS scripts and the small size of the JAWS scripting community mean that LLMs have minimal exposure to actual JSL code during training.

  2. Unique syntax and semantics: JAWS Scripting Language is a proprietary compiled language with syntax patterns that differ significantly from mainstream languages. Without substantial training examples, LLMs frequently confuse JSL with more common languages like JavaScript, Python, Visual basic, and C#.

  3. Cross-contamination with other screen reader languages: NVDA uses Python for scripting, while other assistive technologies use different languages. LLMs often generate hybrid code that borrows inappropriately from these other ecosystems, producing syntactically invalid JSL.

  4. Specialized domain knowledge: Effective JAWS scripting requires deep understanding of:

    • Windows accessibility APIs

    • Screen reader interaction patterns

    • Application-specific behaviors

    • User experience considerations for blind and low-vision users

    • JAWS-specific functions and event handlers

  5. Compilation requirements: A critical issue that LLMs consistently fail to address is that JAWS scripts must be compiled from .jss source files into .jsb binary files using either SCompile.exe or the JAWS Script Manager. LLMs rarely mention this essential step, leading users to wonder why their generated scripts do not function. The compilation process involves:

    • Running scompile.exe application.jss from the command line in the appropriate settings directory

    • Or using CTRL+S in the JAWS Script Manager to save and compile simultaneously

    • Receiving either "Compile Complete" (success) or detailed error messages with line/column information

    • Understanding that syntax errors completely prevent .jsb generation - there is no partial compilation

    • Recognizing that even successfully compiled scripts require JAWS to reload them before changes take effect

  6. File structure complexity: JAWS scripting involves multiple coordinated files:

    • .jss (JAWS script source files)

    • .jsm (JAWS script message files for localization)

    • .jsh (JAWS script header files for constants and globals)

    • .jkm (JAWS key map files)

    • .jcf (JAWS configuration files)

    • .jdf (JAWS default files)

    • .jsb (compiled script binaries)

    LLMs typically generate only .jss content and fail to properly structure the supporting files required for professional script development.

Evidence from Research

Research on code generation for low-resource languages provides empirical evidence for these challenges. On the HumanEval benchmark, Codex could solve about 28.8% of tasks on the first attempt for well-represented languages, but performance drops dramatically for languages with limited training data.

General-purpose LLMs consistently fail at scale when faced with deep interdependencies, language-specific constraints, and intricate build systems. For JAWS scripting, these challenges are compounded by the language's specialized nature and the limited feedback available to train models.

Package Hallucination: A Critical Security Concern

The Nature of Package Hallucinations

One of the most serious issues with LLM-generated code is the phenomenon of "package hallucination" or "API hallucination." Package hallucination occurs when LLMs generate code that references or recommends packages that do not exist in any public repositories.

Research has found alarming rates of hallucination:

  • 21.7% of package names recommended by open-source AI models were hallucinations, while commercial models hallucinated 5.2% of package names

  • In testing across four LLMs, between 22.5% and 64.5% of conversations generated hallucinated packages

  • Code generators referenced some 440,445 hallucinated packages, including 205,474 unique examples of totally invented package names

Security Implications

The security implications of package hallucinations are severe. An adversary can create a malicious package with the same name as a hallucinated package and inject malicious code, which unsuspecting users will download and execute.

This attack vector is similar to phishing, exploiting the trust users have in the model and relying on users not performing due diligence. For JAWS scripting, where scripts often have deep system access and can monitor user activity, the security risks of executing malicious code are particularly severe.

Persistence and Exploitability

The hallucination problem is not just pervasive but also persistent, with LLMs repeatedly recommending the same fictitious packages. This persistence makes the attack vector more viable, as malicious actors can reliably predict which hallucinated names to register.

Research shows that even when different developers ask LLMs questions about the same topic but craft questions differently, there is a likelihood the LLM would recommend the same hallucinated package in each case.

The "Vibe Coding" Phenomenon and Its Risks

Defining Vibe Coding

A troubling trend in AI-assisted development is "vibe coding"--the practice of rapidly prototyping or building entire applications by following LLM suggestions without deeply understanding or reviewing the code. The focus is on speed rather than security or verification, with developers accepting AI-generated suggestions without hesitation.

Risks for JAWS Scripting

For JAWS scripting, vibe coding poses exceptional risks:

  1. Accessibility Impact: Poorly written JAWS scripts directly affect users who are blind or have low vision, potentially making applications less accessible rather than more accessible.

  2. System Stability: Buggy scripts can cause JAWS to crash or behave unpredictably, disrupting critical assistive technology that users depend on for computer access.

  3. Privacy Concerns: JAWS scripts can access screen content, keystrokes, and other sensitive information. Malicious or poorly vetted code poses significant privacy risks.

  4. False Confidence: Users may believe LLM-generated scripts are correct because they compile and appear to run, not realizing they may contain subtle bugs or security issues.

  5. Maintenance Burden: Scripts generated without deep understanding become technical debt, difficult to maintain or debug when issues arise.

Code Quality Issues in LLM-Generated Code

Types of Hallucinations and Errors

Research has identified several categories of problems in LLM-generated code:

  1. Syntax violations: State-of-the-art models like GPT-4.1, Codex, and GPT-4o exhibit high frequencies of syntax violations, particularly in less common languages.

  2. Invalid reference errors: Generated code frequently contains invalid reference errors, calling functions or using variables that do not exist.

  3. API knowledge conflicts: LLMs demonstrate API knowledge conflicts, mixing APIs from different frameworks or versions.

  4. Definition missing: LLMs occasionally omit variable or function definitions that are required before use.

  5. Incorrect boundary conditions: Generated programs fail to verify boundary conditions properly, leading to runtime errors.

  6. Logic errors and misunderstandings: LLMs struggle to extract information from natural language and establish correct logic, particularly for algorithmic problems.

  7. Timeout issues: While LLM-generated code may be correct, algorithms are often suboptimal with high time complexity.

Recent studies on DSL code generation provide quantitative evidence. Research on DSLs with approximately 700 custom API functions found:

  • Fine-tuned models achieved lower hallucination rates but higher syntax error rates

  • RAG-based models demonstrated better syntax correctness (2 percentage points higher compilation rates)

  • Both approaches struggled with custom function names, with hallucination rates between 22.5% and 64.5% of conversations generating hallucinated packages

  • Multiple iterations were required to achieve correct syntax - in one robotics DSL study, LLMs required up to 117 rounds of refinement

For DSLs specifically, research highlights that "performance drops noticeably" compared to general-purpose languages, with hallucinations and syntax errors increasing particularly for DSLs with high numbers of custom function names.

JAWS-Specific Code Quality Concerns

For JAWS scripting, LLMs exhibit additional quality issues:

  • Generating pseudocode rather than valid JSL syntax

  • Mixing Python constructs from NVDA scripting with JSL

  • Failing to use proper JAWS function names and signatures

  • Incorrectly handling event-driven programming patterns

  • Omitting required message file (.jsm) and header file (.jsh) definitions

  • Generating scripts that violate Freedom Scientific's scripting standards

  • Creating code that compiles but produces incorrect speech output or behavior

  • Failing to properly handle cursor management and state restoration

Detailed examination of common LLM failures reveals specific patterns:

Syntax Confusion Between Screen Readers

LLMs frequently mix syntax from different screen reader scripting languages:

Python/NVDA contamination LLMs often generate code like:

``` {style="Alabaster"}
\# INCORRECT - Python/NVDA syntax, not JAWS
def AutoStartEvent():
    ui.message("Application started")
    return True
```

Correct JAWS syntax would be:

``` {style="Alabaster"}
; CORRECT - JAWS Script Language syntax
Void Function AutoStartEvent()
    SayMessage(OT_USER_BUFFER, msgAppStarted)
EndFunction
```

Lua/SuperNova contamination Occasionally LLMs mix Lua-like syntax:

``` {style="Alabaster"}
-- INCORRECT - Lua syntax, not JAWS
function sayWindowName()
    local windowName = getWindowName()
    speak(windowName)
end
```

Javascript Occasionally LLMs mix javascript-like syntax:

``` {style="Alabaster"}
// Javascript (not JAWS scripting), Often seen in web-related contexts and .js can be confused with .jss
// INCORRECT for JAWS: browser/DOM-focused example
function sayApplicationName() {
    const windowName = document.title || window.name;
    console.log(windowName); // or use a TTS API in a browser
}
```

C# Occasionally LLMs mix C-Sharp-like syntax:

``` {style="Alabaster"}
// C\# (desktop example using System.Windows.Forms; not JAWS code)
// INCORRECT for JAWS: managed WinForms example
using System;
using System.Windows.Forms;

public void SayApplicationName()
{
    string windowName = Form.ActiveForm?.Text ?? "Unknown";
    Console.WriteLine(windowName); // placeholder for speech API
}
```

VB.NET Occasionally LLMs mix Visual Basic .NET-like syntax:

``` {style="Alabaster"}
// Visual Basic .NET (not JAWS scripting)
' INCORRECT for JAWS: VB.NET example
Sub SayApplicationName()
    Dim windowName As String = If(Application.OpenForms.Count > 0, Application.OpenForms(0).Text, "Unknown")
    Console.WriteLine(windowName) ' placeholder for speech API
End Sub
```

Generic pseudocode Most commonly, LLMs generate syntactically invalid pseudocode:

``` {style="Alabaster"}
// INCORRECT - Generic pseudocode
script SayApplicationName() {
    windowName = GetWindowName();
    Speak(windowName);
}
```

Function Name and Signature Errors

LLMs frequently hallucinate function names or use incorrect parameters:

  • Non-existent functions: Generating calls like GetControlText(handle), SpeakText(string), or ReadCurrentLine() - functions that sound plausible but do not exist in the JAWS API.

  • Incorrect parameter types: Calling existing functions with wrong parameter types, such as:

    ; INCORRECT - SayString takes int for output mode, not string
    SayString("Text to speak", "user_buffer")
    
    ; CORRECT
    SayString("Text to speak", OT_USER_BUFFER)
    
  • Missing required parameters: Omitting mandatory parameters like the output type parameter in Say() functions.

  • API version conflicts: Mixing functions from different JAWS versions, calling functions not available until JAWS 17 in code supposedly targeting JAWS 13.

Event Handler Misunderstandings

LLMs demonstrate poor understanding of JAWS event-driven architecture:

  • Incorrect event signatures: Generating Function FocusChangedEvent() without the required handle hWindow parameter.

  • Missing return types: Omitting Void or proper return type declarations for event functions.

  • Failure to call default handlers: Not including FocusChangedEvent(hWindow) calls to invoke default behavior after custom processing.

  • Global variable management errors: Not updating necessary global variables like gCurrentWindow or ghLastFocus within event handlers.

  • Performance-critical event misuse: Placing computationally expensive operations in frequently-called events like KeyPressedEvent(), causing JAWS to become sluggish.

File Structure and Organization Failures

LLMs typically generate only .jss content and fail to properly structure supporting files:

  • Message definition omission: Using string literals directly in scripts instead of defining messages in .jsm files:

    ; INCORRECT - Hardcoded string, not localizable
    SayString("Click the OK button")
    
    ; CORRECT - Message from .jsm file
    SayMessage(OT_USER_BUFFER, msgClickOK)
    
  • Constant definition failures: Not defining window names, window classes, or comparison strings as constants in .jsh files.

  • Global variable declaration errors: Defining global variables in .jss files instead of .jsh files, causing scope issues.

  • Key mapping omission: Generating scripts without corresponding .jkm entries, leaving scripts impossible to trigger.

  • Documentation generation failures: Not creating proper .jsd documentation with Synopsis and Description fields required for Keyboard Help.

Cursor Management and State Restoration Bugs

LLMs generate code that violates critical cursor management principles:

; INCORRECT - Activates JAWS Cursor without saving/restoring PC Cursor
Function GetStatusBarText()
    JAWSCursorHome()
    JAWSCursorDown()
    Let sText = GetLine()
    Return sText
EndFunction

; CORRECT - Proper cursor save/restore
Function GetStatusBarText()
Var
    String sText,
    Int iSavedCursor
    
    Let iSavedCursor = SaveCursor()
    RouteJAWSToPC()
    JAWSCursorHome()
    JAWSCursorDown()
    Let sText = GetLine()
    RestoreCursor(iSavedCursor)
    
    Return sText
EndFunction

Common cursor-related errors include:

  • Not calling SaveCursor() before cursor activation

  • Not calling RestoreCursor() afterward

  • Using JAWS Cursor when Invisible Cursor would be appropriate

  • Not considering whether PC Cursor, JAWS Cursor, or UIA Scan Cursor is most appropriate

Why LLMs Struggle with JAWS Scripting

Training Data Scarcity

The efficacy of language models is constrained by both the volume and quality of available annotated data, a limitation especially pronounced in low-resource programming languages. For JAWS scripting:

  • Few JAWS scripts are available in public repositories

  • Most professional scripts are proprietary (ie., sold by Freedom Scientific, third-party developers, or free but shipped as .exe binaries that install .jsb and .jkm files without the .jss source)

  • Freedom Scientific's documentation exists but is limited compared to mainstream language resources

  • The community is small relative to general programming communities

  • Script examples in forums and documentation are often incomplete snippets rather than full implementations

Specialized Knowledge Requirements

LLMs struggle with specialized hardware or software platforms and industries with strict regulatory requirements. JAWS scripting requires understanding of:

  • Assistive technology principles and best practices

  • Screen reader user experience patterns

  • Windows accessibility API hierarchies (MSAA, UI Automation, IAccessible2)

  • Application-specific object models

  • Proper cursor management techniques

  • Event-driven programming in the JAWS context

  • Speech and braille output considerations

  • Localization and internationalization for screen readers

Each of these areas requires deep technical knowledge that extends far beyond syntax:

Assistive Technology Design Principles

Effective JAWS scripts must embody AT-specific design principles that have no analogs in general-purpose programming:

  • Non-visual information architecture: Understanding how to present information sequentially that sighted users perceive simultaneously. For example, a dashboard with multiple panels requires careful script design to announce each panel's heading and content in logical order.

  • Cognitive load management: Scripts must avoid overwhelming users with excessive speech while providing sufficient information for task completion. This balance differs fundamentally from visual UI design.

  • Progressive disclosure: JAWS scripts typically announce summary information first, with detailed information available through subsequent keystrokes (e.g., first keystroke speaks synopsis, double-press speaks description).

  • Braille vs. speech considerations: Information displayed in Braille often requires different formatting than spoken output. Speech can use inflection and pacing; Braille must rely on punctuation and structure.

Windows Accessibility API Expertise

Understanding the technical differences between accessibility APIs is essential for effective scripting:

MSAA Limitations MSAA's IAccessible interface provides only basic information: name, role, description, value, state, location. For complex applications, scripters must often work around MSAA's limitations by:

- Using the Invisible Cursor to read on-screen text when object information is insufficient

- Parsing concatenated strings that applications incorrectly expose as single values

- Implementing workarounds for controls that expose incorrect or incomplete role information

IAccessible2 Capabilities When applications support IAccessible2, scripters can access rich text attributes, table structures, and object relations. However, this requires:

  • Using QueryService to obtain IAccessible2 interfaces from MSAA IAccessible references

  • Understanding that IAccessible2 does not support child IDs - full accessible objects must exist

  • Working with unique IDs that persist for object lifetime within the current window

  • Handling relation sets to navigate from controls to their labels or vice versa

UI Automation Complexity The UIA API introduces pattern-based programming where controls implement specific patterns (Value, Selection, Grid, etc.). Scripters must:

- Create FSUIA objects and attach event handlers using ComAttachEvents()

- Understand that UIA elements are tree-structured with multiple tree views (Raw, Control, Content)

- Work with VARIANT return types that may contain strings, integers, booleans, or element references

- Implement proper element caching strategies to avoid performance issues

- Handle the asynchronous nature of UIA events properly

- Manage object lifetime carefully to prevent memory leaks or dangling references

Cursor Management Patterns

JAWS provides multiple cursor types, each with specific use cases and technical requirements:

PC Cursor The standard Windows focus/caret. Scripts should respect PC Cursor position and avoid disrupting it unnecessarily.

JAWS Cursor An on-screen cursor that can read any visible text, including text that applications do not expose through accessibility APIs. Technical considerations include:

- Storing PC Cursor position before activating JAWS Cursor: SaveCursor()

- Positioning the JAWS Cursor: RouteJAWSToPC(), JAWSCursorUp(), etc.

- Reading text: GetLine(), GetWord(), GetCharacter()

- Restoring PC Cursor: RestoreCursor()

- Performance implications of Off-Screen Model (OSM) rendering

Invisible Cursor Similar to JAWS Cursor but operates without moving the user's focus. Critical for reading information without disrupting user workflow. Used via:

- RouteInvisibleToPC(), InvisibleCursorUp(), etc.

- GetLineWithCursor(Invisible_Cursor)

- Must save/restore PC Cursor position identically to JAWS Cursor

UIA Scan Cursors Introduced in JAWS 2020 to work with applications using UI Automation that render poorly in the traditional OSM. Technical differences include:

- JAWS Scan Cursor: GetLineWithCursor(JAWSScan_Cursor)

- Invisible Scan Cursor: GetLineWithCursor(InvisibleScan_Cursor)

- Navigate through UIA tree structure rather than screen coordinates

- More reliable for modern applications but with different navigation semantics

- Require understanding of UIA element tree hierarchies

The choice of cursor depends on application architecture, available accessibility API support, and specific task requirements. LLMs cannot reliably make these architectural decisions without deep understanding of screen reader internals.

Event-Driven Programming Patterns

JAWS scripting is fundamentally event-driven, with specific event functions that the JAWS engine calls when conditions occur:

  • AutoStartEvent() - Called when JAWS loads for an application

  • WindowCreatedEvent(handle hWindow) - Called when windows are created

  • FocusChangedEvent(handle hWindow) - Called when focus moves between windows

  • ActiveItemChangedEvent() - Called when active item changes in lists/trees

  • ValueChangedEvent() - Called when control values change

  • NewTextEvent() - Called when new text appears

  • KeyPressedEvent(string sKey) - Called before keys are passed to applications

  • MenuModeEvent(int iMode) - Called when menus are activated/deactivated

Effective use of these events requires understanding:

  • When each event fires relative to application state changes

  • How to avoid performance problems by keeping event handlers efficient

  • Which global variables must be updated within each event handler

  • How events interact with user buffer state and virtual cursor modes

  • When to call default event handlers vs. implementing custom behavior

LLMs frequently generate key-driven code (scripts bound to keystrokes) when event-driven code would be more appropriate and reliable.

The Compilation Knowledge Gap

A particularly problematic gap is LLMs' consistent failure to inform users about compilation requirements. From extensive experience, even advanced models neglect to mention that:

  1. Source files (.jss) must be compiled to binary files (.jsb)

  2. Compilation can be done via SCompile.exe or the JAWS Script Manager

  3. The compiled files must be placed in the correct directory structure

  4. Scripts must be reloaded in JAWS after compilation

  5. Syntax errors prevent compilation and provide error messages

  6. Different JAWS versions may have different compilation requirements

This omission leaves users frustrated, unable to understand why their "completed" scripts do not function.

Trust and Reliability Concerns

The Trust Problem

One of the major concerns about language models today is trust--they can give strikingly amazing results in some cases but are often subtly wrong in others, and some are non-deterministic.

For JAWS scripting, trust issues are particularly acute:

  • Users cannot easily verify script correctness without deep JSL knowledge

  • Testing requires actual blind or low-vision users or extensive simulation

  • Errors may not be immediately apparent but emerge in edge cases

  • Security vulnerabilities may be hidden in plausible-looking code

  • Performance issues may only manifest during heavy usage

The Need for Human Expertise

It becomes critical to design languages to be read, not just written, so humans can review and approve generated code. For JAWS scripting:

  • Scripts should be written following Freedom Scientific's coding standards (Chapter [scripting-standards]{reference-type="ref" reference="scripting-standards"})

  • All scripts must be thoroughly tested by experienced screen reader users

  • Security implications must be carefully evaluated

  • Performance impact must be assessed

  • Scripts must be documented for future maintainability

FSCompanion Lacks Data to guide JAWS Scripting

FSCompanion was created as a help and support assistant, not as a code generator. Its training and tuning were focused on Freedom Scientific's public help articles, forum posts, FAQs, and other user-facing documentation; it was not trained on a curated corpus of JAWS scripting source code or on the multi-file project layouts that real JAWS scripts require. Consequently, any code-like output it produces is a byproduct of document-driven retrieval and general LLM pattern completion, not a reflection of direct knowledge of JAWS Script Language (JSL) internals.

Because FSCompanion's fine-tuning data is primarily documentation and support content, it lacks many of the concrete, executable examples and API usages that experienced scripters rely on. When prompted for script snippets, the assistant will often fall back to generic programming patterns learned by the underlying model (either GPT-3.5, GTP-4, or GPT-4o) rather than Freedom Scientific's precise APIs, compilation constraints, or recommended file organization. That leads to outputs that may look plausible -- and even syntactically similar to JSL at a glance -- but which can contain subtle API mismatches, incorrect parameter types, or references to functions that do not exist in a given JAWS version.

From a technical standpoint, FSCompanion does not know about several crucial aspects of JAWS development: the need to split definitions across .jss, .jsm, and .jsh files, the requirement to compile sources into .jsb artifacts, the event signatures and cursor-management patterns that preserve user state, or the nuances of UIA/MSAA/IA2 integration. Because those details are rarely present in support articles, the assistant cannot reliably generate scaffolding that respects the runtime and compilation model; code it suggests may omit necessary save/restore cursor calls, fail to call default handlers, or assume synchronous behaviors that are incorrect in JAWS's event-driven environment.

Using FSCompanion-generated code without careful vetting therefore carries real accessibility and safety risks. A superficially working snippet can still degrade the experience for users who rely on JAWS: announcing the wrong information, disrupting focus or cursor position, introducing regressions across JAWS versions, or creating performance bottlenecks in frequently fired events. Those outcomes can be more harmful than no script at all, because they may silently reduce usability in ways that are difficult to detect without expert testing.

Practically, treat FSCompanion as a documentation and discovery tool rather than a scripting authority. Use it to find references, examples in support articles, and explanations of high-level concepts, but always validate any code through the standard JAWS development workflow: consult official API docs, compile and test in the target JAWS version, and have an experienced scripter review the result. If automated code generation is required, prefer approaches that ground responses in curated code examples (RAG with vetted repositories or models fine-tuned on actual JAWS scripts) and enforce a verification step before any script is used in production.

Best Practices for Using AI in JAWS Script Development

Treat LLM Output as a Starting Point, Not a Solution

When using LLMs for JAWS scripting assistance:

  1. Never deploy generated code without review: All LLM-generated code must be thoroughly reviewed by an experienced JAWS scripter before use.

  2. Verify syntax carefully: Check that generated code uses actual JSL syntax, not Python, Lua, or pseudocode.

  3. Validate all function calls: Ensure that all referenced functions exist in the JAWS API and are called with correct parameters.

  4. Test extensively: Test scripts with actual screen reader users in real-world scenarios, not just in isolated test cases.

  5. Review against standards: Compare generated code against Freedom Scientific's scripting standards (Chapter [scripting-standards]{reference-type="ref" reference="scripting-standards"}) and coding guidelines (Section [acceptable-guidelines]{reference-type="ref" reference="acceptable-guidelines"}).

  6. Verify compilation: Always attempt to compile generated scripts and address any compilation errors before testing.

  7. Check file structure: Ensure that supporting files (.jsm, .jsh, .jkm) are properly structured and coordinated.

Use LLMs for Specific Limited Tasks

LLMs may be more reliable for certain limited tasks:

  • Generating boilerplate code structures

  • Providing examples of common patterns (with verification)

  • Suggesting function names or approaches (with validation)

  • Explaining JAWS API documentation

  • Converting between different code formatting styles

  • Generating documentation templates

However, even these uses require expert verification before implementation.

Maintain Deep Understanding

When a model starts hallucinating, it can take more time to fix the generated code than to write it manually. Therefore:

  • Invest in learning JAWS Scripting Language properly

  • Study Freedom Scientific's official documentation

  • Learn from existing, vetted scripts

  • Understand the underlying accessibility principles

  • Develop expertise in debugging JAWS scripts

  • Participate in the JAWS scripting community

The Future of AI-Assisted JAWS Scripting

Potential Improvements

Future developments may improve LLM capabilities for specialized languages:

  1. Specialized fine-tuning: Models fine-tuned on specialized datasets can improve performance, though this requires substantial JAWS scripting examples.

  2. Retrieval-Augmented Generation (RAG): RAG approaches can help mitigate hallucinations by grounding responses in actual documentation.

  3. Improved evaluation methods: Developing standard benchmark datasets and evaluation metrics for LRPLs and DSLs could drive improvements.

  4. Domain-specific models: Creating models specifically trained on accessibility scripting languages could improve results.

  5. Better validation tools: Integrated compilation checking and API validation could catch errors before deployment.

Realistic Expectations

However, several factors suggest that LLM limitations for JAWS scripting will persist:

  • The JAWS scripting community will likely remain small

  • Proprietary scripts will continue to limit public training data

  • The specialized knowledge required remains difficult to encode

  • Solutions developed for specific language pairs prove ineffective when applied to other language combinations

  • The compilation and file structure complexity adds layers of difficulty

Conclusion

While LLMs and AI have transformed software development for mainstream languages, their application to JAWS Scripting Language faces fundamental challenges. The severe data scarcity, specialized syntax, and unique architectural requirements of low-resource programming languages mean that LLMs cannot fully leverage their capabilities.

For JAWS scripting specifically, LLMs frequently generate code in non-functional pseudocode, borrow inappropriately from other scripting languages (particularly Python from NVDA), fail to mention critical compilation requirements, misunderstand the multi-file architecture, demonstrate poor knowledge of Windows accessibility APIs, generate invalid function calls and event handlers, and produce code that violates established scripting standards. These limitations, combined with serious security concerns around package hallucinations (21.7% for open-source models) and the risks of "vibe coding" (accepting AI suggestions without review), mean that LLM-generated JAWS scripts require extraordinary caution.

The technical architecture of JAWS scripting--compiled language, multi-file coordination, Windows accessibility API integration, event-driven programming model, cursor management requirements, and speech/Braille output considerations--creates a complexity that LLMs cannot reliably navigate without extensive training data that simply does not exist in public repositories.

Developers must possess deep understanding of JAWS Scripting Language and its ecosystem to effectively evaluate, adapt, and integrate any LLM-generated code. The generated code should be treated as a potentially flawed starting point requiring expert review, never as a final solution. This expert review must encompass:

  • Verification of syntactic correctness against JSL grammar

  • Validation that all function calls use actual JAWS API functions with correct signatures

  • Confirmation that event handlers follow proper patterns and update necessary global state

  • Checking that cursor management includes proper save/restore sequences

  • Ensuring proper file structure across .jss, .jsm, .jsh, .jkm, and .jsd files

  • Verifying compliance with Freedom Scientific's scripting standards

  • Testing with actual screen reader users in real-world scenarios

  • Security review to prevent exposure of sensitive information

  • Performance testing to ensure responsiveness

Until substantial improvements occur in LLM training data and specialized fine-tuning for assistive technology scripting languages, human expertise remains irreplaceable in JAWS script development. The stakes--affecting users who depend on assistive technology for computer access--are too high to accept anything less than rigorously validated, professionally developed scripts.

Research on DSLs and LRPLs confirms these concerns with quantitative evidence. Studies show that even with fine-tuning, DSLs with high numbers of custom function names (like JAWS with its hundreds of specialized API functions) experience hallucination rates of 21.7% for open-source models, compilation failures in significant percentages of attempts, and the need for multiple iterations (sometimes 100+ rounds) to produce correct code. The specialized nature of JAWS scripting, combining domain-specific language characteristics with assistive technology requirements and Windows API knowledge, places it among the most challenging environments for LLM code generation.

As LLMs become more reliable and trustworthy over time, they will augment the developer experience, but they will not replace the need for programming expertise. For JAWS scripting, this human expertise is not just desirable but essential. The compilation requirement alone--which LLMs consistently fail to mention--demonstrates the gap between LLM capabilities and the practical knowledge required for JAWS script development. When combined with the specialized knowledge of Windows accessibility APIs (MSAA, IAccessible2, UIA), event-driven programming patterns, cursor management techniques, speech and Braille output considerations, and assistive technology UX principles, the knowledge gap becomes insurmountable for current LLM technology.

The future may bring improvements through specialized fine-tuning, retrieval-augmented generation grounded in JAWS documentation, better evaluation methods, and domain-specific models trained on accessibility scripting languages. However, the fundamental constraint--the small size of the JAWS scripting community and the proprietary nature of professional scripts--suggests that training data limitations will persist indefinitely. Until these challenges are addressed, developers working with JAWS scripting must rely primarily on human expertise, treating LLM assistance as a supplementary tool requiring rigorous validation rather than a primary development method.

More Information

Additional Reading

This chapter draws on extensive research examining the capabilities and limitations of Large Language Models for code generation, particularly in specialized and low-resource programming languages. The following references provide comprehensive background on the technical challenges, security implications, and practical considerations discussed throughout this chapter.

Surveys and Comprehensive Studies on LLMs for Code Generation

{{#cite joel2024survey}}

{{#cite cassano2024knowledge}}

{{#cite cassano2023multiple}}

{{#cite diera2023enhancing}}

{{#cite klimek2023potential}}

{{#cite github2024repository}}

Package Hallucination and Security Vulnerabilities

{{#cite spracklen2024package}}

{{#cite saini2025importing}}

{{#cite lanyado2024package}}

{{#cite haque2025secure}}

{{#cite pradel2024hallucination}}

{{#cite liu2024exploring}}

{{#cite oyesanya2024package}}

{{#cite usenix2025package}}

{{#cite helpnetsecurity2025package}}

{{#cite sciencedaily2025threats}}

{{#cite darkreading2024hallucinations}}

{{#cite infoworld2025hallucinations}}

Vibe Coding: Definitions, Practices, and Implications

{{#cite karpathy2025vibe}}

{{#cite wikipedia2025vibe}}

{{#cite willison2025vibe}}

{{#cite kim2025user}}

{{#cite googlecloud2025vibeoverview}}

{{#cite ibm2025vibe}}

{{#cite codingscape2025tools}}

{{#cite mcnulty2025vibe}}

{{#cite uxplanet2025testing}}

{{#cite arsturn2025rapid}}

{{#cite nocodefinder2025vibe}}

Industry Reports on AI Adoption in Software Development

{{#cite google2024dora}}

{{#cite google2025dora}}

{{#cite github2023survey}}

{{#cite googlecloud2024announcing}}

{{#cite techrepublic2024dora}}

{{#cite register2025dora}}

{{#cite semaphore2025roundup}}

{{#cite opslevel2024takeaways}}

{{#cite devdynamics2024stateofdevops}}

{{#cite thoughtfuldane2024insights}}

Code Generation Quality and LLM Behavior

{{#cite chen2021evaluating}}

{{#cite ouyang2024llm}}

{{#cite orlanski2023measuring}}

{{#cite gong2022distributed}}

Accessibility APIs and JAWS Technical Documentation

{{#cite microsoft2023iaccessible2}}

{{#cite microsoft2023uia}}

{{#cite freedomscientific2024scripting}}

{{#cite freelists:new-era-in-scripting-jaws}}



Getting Started Guide

JAWS ships with the ability for you to customize scripts out of the box. You do not need a special build of the product but you must have administrative rights on your installed version and be using an Administrator user account in order to take advantage of this powerful tool.

Writing Script Files with Script Manager or a Text Editor

Editing

Create or edit JAWS Script Source (.jss) files from within any text editor. If you are new to scripting, you may find it easiest to use the JAWS Script Manager to create and edit script files because the Script Manager provides many helpful tools for navigating through a script file. Starting with JAWS 20201, the Script Manager provides an even more robust set of tools for creating your own script sets.

Tools include:

  • SHIFT + F1 - Using a keystroke at the cursor where a function is located to have that function's details shown to you in a popup window you can review and dismiss with ESCAPE.

  • Inserting built-in functions.

  • Formatting scripts.

  • Providing script language help.

  • Writing and synchronizing the script documentation.

Formatting the script file for UTF-8 encoding.

You may learn about scripting by choosing the JAWS "Help Topics" item from the "Help" menu. Activate the Script Manager from within any application by one of the following methods:

  • Press JAWSKEY + 0.

  • Press JAWSKEY + F2 for the JAWS "Run Managers" dialog. Navigate through the list until Script Manager is selected, and then press ENTER. As mentioned above, starting with JAWS 2020, if you want to see the details for a function within a script, you can press SHIFT + F1 while your cursor is on the name of the function. For example, bring up the Notepad.jss file. It already has functions within it. Move to any function call within a script or function and place your cursor at the function call name. Pressing SHIFT + F1 shows you that function's details. Dismiss the function's details with ESCAPE. You are back in the .jss source file.

Naming

Script files follow the same naming and location conventions as most JAWS Settings files. Storing script files in the JAWS\Settings(Language) folder ensures that all necessary include files are present at compile time. By default, the JAWS Script Manager creates files with the same root name as the active application executable, and places them into the JAWS\Settings(Language) folder.

Compiling Script Files

The JAWS Script Manager compiles an active script file whenever the "Save" option is selected from the "File" menu. The compiler gives the resulting binary file the same root name as the script source file, and places it in the same folder. JAWS will load the new binary file the next time the application with the same root name gains focus by moving into the Windows foreground.

If you choose to edit script source files with a text editor instead of the Script Manager, you will need to call the application "SCompile.exe", located in the JAWS program folder to compile them from the command line. Call "SCompile", passing in script source file names. The compiler accepts wild cards, so many source files may be compiled with one command2.

Formatting for UTF-8 Encoding

UTF-8 is an acronym for UCS Transformation Format 8-bit multibyte character encoding for Unicode. ANSI is an acronym for American National Standards Institute. For more technical information about the meanings of these terms, and how to format script files for UTF-8, see Formatting Script Files for UTF-8.

IME Support

JAWS can make Input Method Editors (IME) accessible. These special types of editors allow you to input from the keyboard into documents containing characters belonging to languages such as Chinese, Japanese, and Korean. In order for JAWS to support IME, you must install a text service compatible with Microsoft Text Services Framework (TSF). The installer is called FSTxtSvc.msi, and it installs the Freedom Scientific Text Service (FSTxtSvc). Note that this text service is not installed by default for languages other than Chinese, Japanese, and Korean.

Saving a UTF-8 Formatted Script File

When you open a script file using Script Manager, JAWS assumes that the file is formatted as an ANSI file. When you save the file, it is saved as an ANSI file. Unless you explicitly enable UTF-8 formatting for the current file, it is not saved as a UTF-8 file. Unless you direct it to be saved elsewhere, it will be saved in your User\Settings\(Language) folder.

If UTF-8 symbols are needed to appear on a Braille display, one or more .jbt files may need to be formatted as UTF-8 files.

The following example illustrates how to reformat your .jbt file for UTF-8:

  • The .jbt file must temporarily replace the file whose name is identical in the Program Files folder for the current version of JAWS. Navigate to that folder. It's path will be something like, C:\Program Files\Freedom Scientific\JAWS\xx.0

  • Change the name of the file called "US_Unicode.jbt" to something like "#US_Unicode.jbt".

  • Copy the file with the same name as the original file whose name you just changed into the current folder. You should now have a file called "US_Unicode.jbt" file in the current folder as well as the renamed one that originally is part of the current JAWS build.

  • From within Script Manager with the .jbt file open, find the option in the Files menu called "UTF-8 Format". The option is unchecked by default.

  • Press ENTER on the option to enable UTF-8 formatting for the current file.

  • Change or add whatever UTF-8 symbol is desired in the file, following its exact correct syntax.

  • Save the file.

  • Unload and reload JAWS without rebooting.

  • From now on, the UTF-8 symbol coded into the .jbt file should be recognized by JAWS and displayed in Braille properly because the .jbt file has been saved with UTF-8 formatting enabled.

1

released in October, 2019

2

One reason to use this function is when you are writing JAWS scripts for a version of JAWS that is not the default on your system and/or is installed in a 40 minute mode. A Windows 11 environment is still required to run SCompile.exe



Naming JAWS Settings Files

Each time you start an application, JAWS determines what configuration files to load. Prior to JAWS 5.01, JAWS used the name of the executable file to retrieve and load the appropriate configuration files. JAWS uses only the first portion of the executable file name i.e. the part of the file without the extension. For example, when you started Microsoft Word 2007, the actual executable file name is winword.exe. JAWS uses only the first part of the file, winword, to locate and load into memory all configuration files for Word from the settings folder. JAWS loads these files on top of the set of default files already in memory.

Many times, the names of those files are not indicative of the actual application. For example, the configuration manager file for Internet Explorer 9 is Ieframe.jcf. The name of the file gives no indication of the actual program with which JAWS associates the file. This naming convention makes it difficult at times to locate the correct files for a particular application when its name is not clear.

The Confignames.ini File

JAWS 5.0 and later uses an .ini style file to equate more meaningful names with the executable file name. JAWS uses the Confignames.ini file to retrieve a more understandable name for a given application. This file can be found in your JAWS shared settings folder. The file contains aliases that are associated with the hard-to-remember executable file names. For example, when you run the Settings Center from within Internet Explorer 8 or 9, the file name JAWS displays in the title bar is Internet Explorer.jcf instead of Ieframe.jcf. As you browse the JAWS settings folder using Windows Explorer, you will see the same aliases there as you would in the title bar of a given JAWS manager as well.

Loading the Correct Files

Each time you start an application, JAWS uses the Confignames.ini file to determine if an alias exists for the application. If JAWS finds an alias in this file, then JAWS uses the alias to locate all the corresponding configuration files for the application. If no alias exists in the file, then JAWS uses the executable name of the application to locate all the corresponding configuration files.

For example, when you start Internet Explorer 9, JAWS notes the applications executable file name, Ieframe.dll, less the extension. JAWS must then search the Confignames.ini file for an entry containing Ieframe. When JAWS finds the entry, the alias of Internet Explorer is noted. JAWS then looks in the settings folder for all configuration files beginning with Internet explorer. When JAWS finds all the corresponding files, they are loaded into memory.

Adding Your Own Aliases

As you customize JAWS to work with new applications, JAWS continues to use the applications executable file name to create the various configuration files. However, you can add your own entries to the Confignames.ini file to give those hard-to-remember configuration files more meaningful names. When you add a new entry to this file, you must provide two pieces of information:

  • application executable name less the extension

  • alias to be used in place of the application name

If you are unsure of the exact name of the applications executable file, press JAWSKEY + Q and JAWS speaks the settings file currently in use along with the applications executable file name.

If the applications executable file name is hard to understand, you can press JAWSKEY + Q twice in succession to display the settings file in use information in the virtual viewer. Since you are adding an entry to the Confignames.ini file, your entry must follow a specific format. The applications executable name appears first. The executable name does not include the file extension. Following the executable name is the equals sign (=). You then type the alias for the executable file name. For example, the entry for Internet Explorer looks like the following:

ieframe=Internet Explorer

To add a new entry to the Confignames.ini file, do the following:

  • Open the Confignames.ini file in a text editor e.g., Notepad++ or EdSharp.

  • Press CONTROL + END to move to the bottom of the file.

  • Add the new entry using the format of: executable name(less the extension) = alias

  • Save the file.

When you start the application, JAWS uses the alias to locate and load the corresponding configuration files. If you have added an alias to the Confignames.ini file, you must restart the application before JAWS uses the alias to locate the configuration files. If you do not restart the application, JAWS uses the executable name to locate the configuration files.

1

released 2003



Freedom Scientific Scripting Practices

This document contains a set of standards which is required for all script submissions to Freedom Scientific. Since failure to conform to these standards results in scripts which are either buggy, suffer from degraded performance, or which are not localizable to multiple languages, all submissions of scripts must conform to the following standards in order to be considered for acceptance:

**Critical**: Do not break any currently existing features or intended functionality!
  • In the JSH file, define all script constants and globals. The only exception to this is for constants or globals that must be strictly local to the current script file and that should not be exposed to other script files.

  • In the JSM file, define all messages to be spoken, and use only those message names in the JSS file.

  • In the JSM file, define all strings used for comparison or for identification as constants, and use only those string names in the JSS file.

  • In the JSM file, add a comment for string names whose meaning is not obvious, explaining to translators where to find the text those string names represent in the comparison, or where to use those string names for identification in the program.

  • In the JSM file, define all window names and classes as constants, and use only those constants in the JSS file.

  • In the JSM file, define all string variables that are messages consisting of a specific formatted pattern such that each variable uses a variable placeholder in the formatted message. Then use the FormatString() or SayFormattedMessage() functions in the JSS file to format the message.

  • In the JSM file, document all replaceable parameters for each message that has them with comments explaining what information goes into the replaceable parameters.

  • Name all defined constants and variables for windows or controls so that they are self-documenting in order that a scripter or localizer can recognize the location of the window or control.

    • If it belongs to a dialog, include the dialog name as part of the constant or variable name.

    • If it belongs to a page in a multi-page dialog, include the page name as part of the constant or variable name.

    • If it does not belong to a dialog, name the constant or variable so that the scripter or localizer can determine to which view or component of the program the window or control belongs.

  • Create different constant or variable names for windows or controls that have the same names but appear in more than one area or in unrelated areas of the program. In this way, windows or controls each have their own constant or variable names that refer specifically to where they are used.

Do not re-use the same constant or variable name to refer to different windows or controls.
  • In the JSD documentation file, document all your functions and scripts. Take care to document well the synopsis, description, and any parameters or return types for each function and script. For scripts in particular, Be sure that the text of the Synopsis and Description fields is appropriate to be spoken and displayed in Braille by the JAWS Keyboard Help feature.

  • Do not attach the spacebar or any alphanumeric keys to scripts. If special behavior is required for these keys, use the KeyPressedEvent function instead of attaching scripts to the keys.

  • Use the SayString function only as a debugging tool during scripting, and do not use this function to speak anything in the finished product.

  • Do not use braces like "{" and "}" to simulate keystrokes. Use the TypeKey() or TypeCurrentScriptKey() functions when sending a keystroke to the application.

  • Structure your code so that it tests and executes in the most expedient manner possible. When adding code to frequently-run events, be especially careful not to introduce unnecessary sluggishness.

  • Use window or object information as opposed to screen information where possible.

  • Use the JAWS or Invisible Cursor to obtain information only when no other method works. In this case, always use the Invisible Cursor unless the JAWS Cursor is required to perform the action because the Invisible Cursor cannot. If it is necessary to use the JAWS or Invisible Cursor, store the location of the PC Cursor prior to activating the JAWS or Invisible Cursor, or prior to calling a function that activates either of these cursors. Then take care to re-activate the PC Cursor at the stored location as soon as the desired action is completed with the JAWS or Invisible Cursor.

    As of JAWS 2020, you might instead choose to use the UIA Scan Cursors. See the functions related to these cursors available for JAWS 2020 and later. Generally speaking, the same rules apply to the use of these cursors as to the traditional JAWS and Invisible Cursors. There are several methods to work with these cursors. The addition of the JAWS Scan Cursor and Invisible Scan Cursor was because the standard Off-Screen Model (OSM) used by JAWS and Invisible cursors has been largely replaced by what is called User Interface Automation (UIA) to present screen content. This made the JAWS and Invisible cursors less effective in many applications (e.g., when activating the cursoes in applictions the program would return "blank" instead of informative speech.). The UIA Scan Cursors work with the UIA model to provide better access to screen content in many applications.
  • Never use the SpeechOff() and SpeechOn() functions as a means of suppressing speech output temporarily. If you must suppress speech for specific purposes, use a specific global variable for the specific suppression.

  • Always respect the active cursor when defining behavior in a script or function. Do not break the functionality of the JAWS, Invisible Cursor, or the UIA Scan Cursors.

  • When designing your code, always consider whether the desired JAWS behavior should honor the status of the user buffer or the menu state as special or exception cases.

  • When designing your code, always respect the user's speech output configuration, and always honor speech and sound scheme functionality for controls and for text properties.

  • Keep all global variables up to date. If you overwrite a function that has global variables, be sure to update the necessary variables before returning from that function.

  • Overwrite for the specific circumstance when overwriting the behavior of an existing function or script. Then call the default function or script for all other circumstances. Wherever possible, avoid copying the entire default function or script to your script file and then adding exception cases. Doing so renders your code obsolete if the default code changes. Always use the same name for your function or script as the name of the default function or script.

  • Use event-driven code where appropriate. For instance, in lists or trees where first-letter navigation is possible, make sure that any code for outputting speech during navigation uses appropriate event-driven code such as the SayHighlightedText() function (called by the NewTextEvent() function), the ActiveItemChangedEvent() or ValueChangedEvent() function instead of key-driven code like the SayNextLine() or SayPriorLine() scripts.

  • When designing your code for overwriting the functionality of a keystroke native to the application, evaluate whether the keystroke should be passed through to the application if the special testing conditions in your code are not met. In the JSM file, define the key name to be passed through as a constant with a meaningful name that explains the keystroke's functionality. For example: Do not use ksAltI; rather, use ksIgnoreButton since the hotkey for the button may vary from language to language.

  • If overwriting the functionality of a key combination already defined in the default JKM file, do not make any entry in the application-specific JKM file for the key combination.

  • In JAWS hotkey help, include all new non-application and non-standard Windows key maps for all keys added to the JKM file.

  • Ensure that the ScriptFileName() function outputs relevant information for the current application and script file.

  • Do not output any special messages for scripts attached to native Windows keystrokes.

  • Ensure that the appropriate information (Application window information, real window information, and focus window information) is spoken when focus changes. Eliminate any double-speaking, and ensure that only relevant changes are spoken.

  • Ensure that the SayWindowPromptAndText() function speaks the same information about the focus window that was spoken when the window gained focus. In addition, toggle on training mode temporarily for the SayWindowPromptAndText() function when speaking the focus window so that training information is spoken as appropriate.

  • When designing help messages to be shown in the virtual viewer, place a statement at the top of the virtual viewer telling the user the current location. If showing a list of commands for a key layer, show what key should be pressed to start the layer. If showing a list of commands and their associated keystrokes, make each command in the list a link. Then for each command link, describe the command first, and then show the keystroke. Show any more general information in paragraph form without any links. Always end each virtual help screen with a message telling the user how to close the virtual viewer. This message need not be a link.

  • When scripting for special behavior, script both for speech and for Braille behaviors.

  • On controls where the position in group information is available, make sure that the position in the group is announced when focus moves to the control. Also, ensure that your special conditions cause the SayWindowPromptAndText() and SayLine() functions to announce the position in group. However, also ensure that JAWS does not announce the position in group when moving between the items in the group. JAWS should announce position in group information for controls such as lists, combo boxes, and radio buttons. For treeviews, along with position in group information, JAWS should also announce level and state information. Ensure that JAWS announces and displays in Braille the position, level and open/close state changes of treeview items as they are navigated.

Additional Guidelines for Writing Acceptable Scripting Code

Following are some additional guidelines for writing and formatting code so that it can be most easily maintained. Anyone looking at your code in the future (including yourself) will thank you for following these guidelines when writing your code.

Write self-documenting code by using meaningful script, function, variable and constant names. Self-documenting code is much easier to understand, maintain and debug.

Modularize code so that your scripts or functions do not become large and unwieldy. It is much more time-efficient to maintain and debug modular, smaller scripts and functions than to step through a large section of code line-by-line.

Capitalize script, function, variable and constant names so that JAWS speaks them in a recognizable manner. This is best accomplished either by capitalizing the individual "words" of the name, or by using underscore ("_") to separate the component "words" of the name.

In this document we favor using Pascal Case, which is Capitalizing each word making up a variable name. I find this the easiest to remember and the most readable. However, there are other acceptable formats for naming variables. The following table lists some of the most common formats for naming variables. The table also provides examples of each format.

Naming Scheme Description Example Common Use


Snake Case Snail Case Pothole Case Use underscore "_" to separate words; all lowercase var_name_in_snake_case Python (PEP 8 functions/variables)Rust (functions/variables)Ruby (methods/locals)Elixir (functions/variables)C (functions, varies)SQL schemas Kebab Case Lisp Case dash-case Use hyphens "-" between words; all lowercase var-name-in-kebab-case CSS properties/classesHTML data attributesURLs/filenamesnpm package names Camel Case Dromedary Case Lower camel case: first word lowercase, subsequent words capitalized varNameInCamelCase Java (methods/variables)JavaScript/TypeScript (functions/variables)C#SwiftKotlin,Dart (methods/variables) Pascal Case Upper Camel Case Each word capitalized; no separators VarNameInPascalCase Class/type names across most languages; public members in .NET (C#)modules in Elixir Flat case No separators; all lowercase varnameinflatcase Rare; sometimes short identifiers or legacy contexts Camel Snake Case Combination of camelCase and snake_case var_Name_In_Camel_Snake_Case Not standard; appears in mixed-style codebases or auto-generated code Pascal Snake Case Title Case Pascal-cased words separated by underscores Var_Name_In_Pascal_Snake_Case Niche; sometimes database/codegen conventions Macro Case Constant Case Screaming Snake Case Uppercase words with underscores; typically for constants/macros VAR_NAME_IN_MACRO_CASE C/C++ macrosconstants in PythonRustJava (static final)KotlinRuby environment variables COBOL Case Screaming Kebab Case Kebab case but ALL CAPS VAR-NAME-IN-COBOL-CASE COBOL identifiers and legacy systems Train Case HTTP Header Case Title-cased words separated by hyphens Var-Name-In-Train-Case Documentation headingsdesign systemssome HTTP headers and config keys

: Multiple-word Identifier Formats For Variables

When defining local variables, place "Var" on a line by itself at the left margin, and then place each succeeding local variable on a line by itself indented one tab stop. All varaibles except the final one in the list need to be followed by a comma. This makes the variable list easy to read quickly and to modify if items need to be added or deleted.

Var
    String sFirstVariable, ; first String variable followed by a comma
    Int iSecondVariable,   ; second integer variable followed by a comma
    Object oThirdVariable, ; third Object variable without a comma
    Handle hThirdVariable  ; final Handle variable without a comma

Place all level-0 statements at the left margin, and indent once using tab (not spaces) for each level. Line up the matching components of If-ElIf-Else-EndIf statements and of While-EndWhile statements. When an If or While statement contains compound conditions, place each condition on a line by itself. Line up the operator for each line of the compound test with the If, the ElIf, the Else, and the Endif, or the While-Endwhile statement. Following this convention makes it easy to find code blocks displayed in Braille and by using the JAWS indentation announcement capabilities.

; This is pseudocode, Not an actual JAWS Script
    While IsAppActive(appName)
    And (iteration < maxIterations)
  And (Not UserPressedKey("ESC"))

        SetFocusToForegroundWindow()

    While HasFocusChangedRecently(announceIntervalMs)
      And (GetObjectClass(GetFocus()) = "Edit")
      And (IsTextSelectable(GetFocus()))

      If (IsSelectionNonEmpty(GetFocus()))
        And (IsControlVisible(GetFocus()))
        And (Not IsControlProtected(GetFocus()))
        SayString("Selected text detected.")
                SayHighlightedText(GetFocus())
      ElseIf (IsCaretOnLineStart(GetFocus()))
        And (IsLineNonEmpty(GetFocus()))
        SayString("Line start. Reading line.")
                SayCurrentLine(GetFocus())
      Else
        SayString("Reading word under caret.")
                SayCurrentWord(GetFocus())
            EndIf

      If (IsDialog(GetForegroundWindow()))
        And (HasDefaultButton(GetForegroundWindow()))
        SayString("Dialog detected. Default button is " + GetDefaultButtonName(GetForegroundWindow()))
            EndIf

      If (UserPressedKey("CTRL+H"))
        And (IsHelpAvailable(appName))
        SayString("Opening Script help For " + appName)
        SayString(GetScriptDescription("FocusMonitor"))
        OpenHelpTopic("FocusMonitor")
            EndIf
        EndWhile

    If (UserPressedKey("CTRL+F"))
        And (GetObjectClass(GetFocus()) = "Edit")
        And (IsTextSearchable(GetFocus()))
        SayString("Find requested. Prompting For search term.")
        PromptUserForText("Enter search term:", "SearchTerm")
        If (SearchText(GetFocus(), GetVariable("SearchTerm")))
          SayString("Found: " + GetVariable("SearchTerm"))
                SayCurrentLine(GetFocus())
      Else
        SayString("Not found: " + GetVariable("SearchTerm"))
            EndIf
        EndIf

        iteration = iteration + 1
EndWhile

SayString("Focus monitor stopped.")

Comment your code judiciously. If the code itself is self-documenting1, comments are unnecessary. However, if you are coding in a specific manner or employing a technique whose purpose may not be readily apparent simply by reading the code, then comments are critical. Remember that your code and comments may be read by anyone. So please keep the comments professional and appropriate for all readers.


; FocusMonitor.jss -- Monitors focus changes and announces relevant text
; Author: 
; Purpose: Demonstrate comment guidelines with JAWS Scripting conventions
; Notes: Comments Use semicolons. Only non-obvious techniques are documented.
SayString("Starting focus monitor For " + appName)

While IsAppActive(appName)
    And (iteration < maxIterations)
    And (Not UserPressedKey("ESC"))

        SetFocusToForegroundWindow()

        ; Technique: Throttle announcements using a "recent change" window
        ; Reason: Prevents rapid, repetitive speech when focus flickers
        While HasFocusChangedRecently(announceIntervalMs)
            And (GetObjectClass(GetFocus()) = "Edit")
            And (IsTextSelectable(GetFocus()))

            ; Strategy: Prioritize what To read (selection \textrightarrow line \textrightarrow word)
            If (IsSelectionNonEmpty(GetFocus()))
                And (IsControlVisible(GetFocus()))
                And (Not IsControlProtected(GetFocus()))
                SayString("Selected text.")
                SayHighlightedText(GetFocus())
            ElseIf (IsCaretOnLineStart(GetFocus()))
                And (IsLineNonEmpty(GetFocus()))
                SayString("Line start.")
                SayCurrentLine(GetFocus())
            Else
                SayCurrentWord(GetFocus())
            EndIf

            ; Context hint: If a dialog is present, announce default action
            If (IsDialog(GetForegroundWindow()))
                And (HasDefaultButton(GetForegroundWindow()))
                SayString("Default: " + GetDefaultButtonName(GetForegroundWindow()))
            EndIf
        EndWhile

        ; Non-obvious UX: inline help On CTRL+H To reduce cognitive load
        If (UserPressedKey("CTRL+H"))
          And (IsHelpAvailable(appName))
          SayString(GetScriptDescription("FocusMonitor"))
          OpenHelpTopic("FocusMonitor")
        EndIf

        ; Avoid unbounded loops
        iteration \textleftarrow iteration + 1
EndWhile

SayString("Focus monitor stopped.")

Naming Conventions for Variables and Constants

Use a standard and consistent method for naming variables and constants. The Freedom Scientific scripting code adheres mostly to the following naming conventions for notating types of variables and constants.

Precede handle variable names with "h", string variable names with "s", integer variable names with "i" and object variable names with "o".

Precede global variable names with "g". For example, a global integer variable name is preceded with "gi".

When naming constants, precede window names with "wn", and window classes with "wc".

When defining messages to be spoken, precede the name with "msg"; use "sc" as a prefix to constant strings defined for on-screen comparison.

PrefixDescriptionExample
iLocal variable of type IntiLocalIntVariable
oLocal variable of type ObjectoLocalObjectVariable
hLocal variable of type HandlehLocalHandleVariable
sLocal variable of type StringsLocalStringVariable
giGlobal variable of type IntgiGlobalIntVariable
goGlobal variable of type ObjectgoGlobalObjectVariable
ghGlobal variable of type HandleghGlobalHandleVariable
gsGlobal variable of type StringgsGlobalStringVariable
wnVariable of containing window name constantwnWindowConstant
wcVariable containing window classwcWindowClass
msgmessagemsgMessageX
scconstant stringscStringConstant

This method is called Hungarian Notation. Using this notation makes it easier to identify the type of variable or constant being used in the code.

Definition:

: Hungarian Notation is a naming convention for variables where each name is prefixed with a short code (called a type tag) that indicates the variable's type or intended use. For example:

> strName (string), iCount (integer), oBuffer (object), bIsReady (boolean)

Purpose:

: This convention was introduced by Charles Simonyi at Microsoft during early Windows development. Its goals were:

1.  **Improve readability in weakly typed languages:** Early C and C++ lacked strong type checking and IDE hints. Prefixes helped developers quickly identify data types.

2.  **Reduce type-related bugs:** Seeing iCount vs. strName made accidental misuse less likely.

3.  **Aid maintainability in large codebases:** Prefixes allowed developers to scan code without jumping to declarations.

Variants:

: - Systems Hungarian: Prefix indicates the actual data type (e.g., i, o, str).

- **Apps Hungarian:** Prefix indicates semantic meaning or intended use (e.g., rwFileName for read/write filename, usPrice for U.S. dollars).

Why it is less common today:

: Modern languages (C#, Java, Python) provide strong typing, IDE support, and type inference, making Hungarian Notation largely unnecessary. Most style guides now recommend descriptive names instead (e.g., customerCount instead of iCustomerCount).

Criticism:

: - Can clutter names and reduce readability.

- Brittle when types change (e.g., iCount becomes a float).

- Adds cognitive overhead for new developers.

Modern Alternative:

: Use clear, descriptive names that explain the variable's purpose2.

AspectHungarian NotationModern Naming (Descriptive)Pros / Cons
Primary ideaPrefix encodes type or purpose (e.g., iCount, strName, bIsReady)Descriptive names without type prefixes (e.g., customerCount, displayName, isReady)Hungarian: Quick type hints in weakly typed contexts. Modern: Clear, readable names; relies on language/IDE types.
VariantsSystems Hungarian: actual type (i, p, str); Apps Hungarian: semantic role (rwFileName, usPrice)Usually just descriptive + context (domain terms, units) and optional suffixes/prefixes for semantics (e.g., priceUSD, filePathRW)Hungarian: distinguishes type vs. intent via tags. Modern: embeds semantics in the name itself.
Examples (variables)iTotal, strTitle, pBuffer, bHasFocustotalCount, title, bufferPtr, hasFocusHungarian: fast visual type cues. Modern: easier to read, fewer prefixes to parse.
Examples (functions)fnComputeTotal, bIsActive(), pGetBuffer()computeTotal(), isActive(), getBuffer()Hungarian: consistent tags across APIs. Modern: conventional verb phrases; language enforces types.
Typical usage contextsLegacy C/C++/Win32 codebases, scripts without strong typing or toolingMost contemporary languages and frameworks (Java, C#, Python, Swift, Kotlin, Rust, TS)Hungarian: helpful where tooling is minimal. Modern: standard across modern ecosystems.
Tooling impactRedundant with modern IDEs (tooltips, static analysis, intellisense)Complements IDEs (readable names + quick symbol navigation)Hungarian: can clutter names. Modern: relies on tooling for type info.
MaintainabilityCan be brittle if type changes (e.g., iCount changing to 64-bit or decimal)Names remain stable as types evolve; type is handled in declarations/signaturesHungarian: risks mismatched prefixes. Modern: fewer rename hazards.
Readability for non-expertsPrefixes add cognitive overhead (must learn tag system)Plain-language names are self-documentingHungarian: steeper learning curve. Modern: approachable.
Guideline trendRarely recommended in current style guidesWidely recommended: meaningful, domain-specific namesConsensus has shifted toward descriptive naming without type tags.
::::

Here is an example of a script that uses Hungarian Notation for its variable names, along with proper formatting and comments as described in the previous sections.

; Script: FocusAnnouncer.jss
; Purpose: Demonstrate Hungarian-style prefixes + JAWS scripting conventions with judicious comments
; Notes: Comments use semicolons. Tabs for indentation. Aligned If/ElseIf/Else/EndIf and While/EndWhile.

Var 
    Int iMaxIterations,      ; maximum number of iterations to prevent infinite loops
    Int iIteration,         ; current iteration counter
    Int iAnnounceIntervalMs, ; interval in milliseconds to throttle announcements
    String strTargetApp,    ; target application name to monitor
    Bool bEnabled,          ; flag to enable/disable the announcer
    Object oFocusObj        ; reference to the current focus object

Let iMaxIterations = 100
Let iIteration = 0
Let iAnnounceIntervalMs = 1200
Let strTargetApp = "Notepad"
Let bEnabled = TRUE
Let oFocusObj = NULL

SayString("Focus announcer starting for " + strTargetApp)

While bEnabled
    And (IsAppActive(strTargetApp))
    And (iIteration < iMaxIterations)

        ; Obtain the current focus object (handle-like reference).
        ; Rationale: Centralize acquisition to avoid stale references.
        pFocusObj \textleftarrow GetFocus()

        ; Throttle announcements so rapid focus flicker doesn't overwhelm speech.
        While HasFocusChangedRecently(iAnnounceIntervalMs)
            And (IsTextSelectable(pFocusObj))
            And (GetObjectClass(pFocusObj) = "Edit")

            ; Read priority: selection \textrightarrow line \textrightarrow word.
            If (IsSelectionNonEmpty(pFocusObj))
                And (IsControlVisible(pFocusObj))
                And (Not IsControlProtected(pFocusObj))
                SayString("Selection.")
                SayHighlightedText(pFocusObj)
            ElseIf (IsCaretOnLineStart(pFocusObj))
                And (IsLineNonEmpty(pFocusObj))
                SayString("Line start.")
                SayCurrentLine(pFocusObj)
            Else
                SayCurrentWord(pFocusObj)
            EndIf

            ; Surface contextual default action when a dialog is foreground.
            If (IsDialog(GetForegroundWindow()))
                And (HasDefaultButton(GetForegroundWindow()))
                Initialize strDefaultBtn \textleftarrow GetDefaultButtonName(GetForegroundWindow())
                SayString("Default: " + strDefaultBtn)
            EndIf
        EndWhile

        ; Inline help reduces cognitive load for discoverability.
        If (UserPressedKey("CTRL+H"))
          And (IsHelpAvailable(strTargetApp))
          SayString(GetScriptDescription("FocusAnnouncer"))
          OpenHelpTopic("FocusAnnouncer")
        EndIf

        ; Allow graceful exit.
        If (UserPressedKey("ESC"))
          SayString("Focus announcer stopping.")
            bEnabled \textleftarrow FALSE
        EndIf

        iIteration = iIteration + 1
EndWhile

Be consistent with your convention, and choose a meaningful convention if an appropriate one does not already exist. Using this type of notation makes it easier to know instantly what type of variable is being used without having to look back at the declaration list in JSH or JSM files.

1

Self-documenting code means all variables and functions are names in such a way that they explain what they do

2

Self-documenting code means all variables and functions are named in such a way that they explain what they do.



Compiling JSS Files with SCompile.exe

Set Up For Visual Studio Code/VSCodium

Why

I typically code outside of the Script Manager. I do my JAWS Script writing using VSCode, Positron, Theia, or Zed, which is comonly used by coders and programmers for python, R, Java, C#, TypeScript, JavaScript, and other development respectively[^1]1. I also prefer NVDA as my daily screenreader, so I want to make sure that I can compile my scripts in a way that is maximally accessible to me.

To accomplish this, I use a round-about way to control my terminal outputs to increase screenreader accessibility and ease of browsing Errors.

I create a task in VSCode using a .JSON file2. This will call a powershell .ps1 script or else a Command Prompt Batch (.bat) file that contains my actual commands. VSCode submits to the shell script the path of the file I currently have open, which is the one targeted to be compiled.

For this chapter, if you prefer Powershell in your terminal, follow the relavant instructions. If you prefer Command Prompt, follow the instructions for that.

Setup

To set up using SCompile, the following information is needed:

  • File path to scompile.exe (typically C:\Program Files\Freedom Scientific\JAWS[year]\scompile.exe).

  • VSCode, VSCodium, Code OSS, Positron, Theia, Mr. Code, or another compatible editor.

  • Administrator Rights for running VSCode (Otherwise VSCode cannot run scompile.exe in an Elevated (Admin) terminal)

    OR

  • A win-sudo or gsudo installation to allow Elevated Terminal Privileges (preferred)

To run scompile as administrator, one of the following need to be performed. One can also do both, but it is redundant.

  1. To Open VSCode with Admin rights

    • When on the icon for VSCode, press ALT + ENTER to open Propertie

    • Navigate to "Compatibility" tab

    • Select "Run this Program as Administrator"

    Now when you open the program, and Administrator prompt will appear and all actions in the terminal will be run with Admin rights.

  2. To install gsudo or win-sudo

    • In command prompt or powershell, type "winget install gsudo" or "winget install win-sudo" and follow the prompts

    Now when you open the program, you can type "gsudo" or "win-sudo" in the terminal before the command you want to run with Admin rights.

The steps to setting up a Task to run the necessary commands, the following steps need to be followed in order:

  1. Press ALT, then T for Terminal

  2. Press C for Configure Task

  3. Press DOWN ARROW to "Create tasks.json file from template"

  4. Press DOWN ARROW to "Others" and press ENTER

The resulting .JSON file looks like this3:

{
    "version": "2.0.0",
        "tasks": [
            {
            "label" : "echo",
            "type": "shell",
            "command": "echo Hello"
            }
        ]
}

Copy and paste the appropriate data into the appropriate sections and add an "args" section so the tasks.json looks like this if you open VSCode:

  1. Use with Powershell

    {
        "version": "2.0.0",
        "tasks": [
            {
                "label": "compile",
                "type": "shell",
                "command": "pwsh",
                "args": [
                    "-File",
                    "workspaceFolder/compile.ps1",
                    "file"
                ],
                "group": {
                    "kind": "build",
                    "isDefault": True
                },
                "problemMatcher": {
                "owner": "custom",
                "fileLocation": ["absolute"],
                "pattern": {
                    "regexp": "^file (.*), line (\d + ), column (\d + ): Error: (.*)\$",
                    "file": 1,
                    "line": 2,
                    "column": 3,
                    "message": 4
                    }
                },
                "presentation": {
                    "reveal": "always",
                    "clear": True,
                    "showReuseMessage": False,
                    "echoCommand": False
                }
            }
        ]
    }
    

    Now create the following file in your User scripts directory (typically "C:\Users\AppData\Roaming\Freedom Scientific\JAWS[year]\Settings\enu"):

    Name the file "compile.ps1".

    The full path for the file is now "C:\Users[user]\AppData\Roaming\Freedom Scientific\JAWS[year]\Settings\enu\compile.ps1"

    • Option 1: VSCode launches with Admin rights.

      param (
          [String]\$filePath
      )
      If (-Not filePath) {
          Write-Error "No file path provided."
          exit 1
      }
      # Run the compiler and capture the output
      \$output = & "`C:\Program` Files\Freedom Scientific\JAWS\2024\scompile.exe" \$filePath 2>&1
      # Print the compiler output
      \$output
      # Check the exit status of the compiler
      If (\$LASTEXITCODE -eq 0) {
          Write-Output "\$filePath Compiled Successfully"
      } else {
          # Print the exit message
          Write-Output "The terminal process terminated with exit code: 1."
      
          # Print the error message again
          \$output -match "Error.*" | ForEach-Object { Write-Output \$_ }
      }
      
    • Option 2 (preferred): Run in an elevated Terminal prompt

      param (
          [String]\$filePath
      )
      If (-Not filePath) {
          Write-Error "No file path provided."
          exit 1
      }
      # Run the compiler and capture the output
      \$output = & sudo "C:\Program Files\Freedom Scientific\JAWS\2024\scompile.exe" \$filePath 2>&1
      # Print the compiler output
      \$output
      # Check the exit status of the compiler
      If (\$LASTEXITCODE -eq 0) {
          Write-Output "\$filePath Compiled Successfully"
      } else {
          # Print the exit message
          Write-Output "The terminal process terminated with exit code: 1."
      
          # Print the error message again
          \$output -match "Error.*" | ForEach-Object { Write-Output \$_ }
      }
      
  2. Use with Command Prompt

    Create the following file in your User scripts directory (typically "C:\Users\AppData\Roaming\Freedom Scientific\JAWS[year]\Settings\enu"):

    Name the file "compile.bat".

    The full path for the file is now "C:\Users[user]\AppData\Roaming\Freedom Scientific\JAWS[year]\Settings\enu\compile.bat"

    {
        "version": "2.0.0",
        "tasks": [
            {
                "label": "compile",
                "type": "shell",
                "command": "pwsh",
                "args": [
                    "-File",
                    "\${workspaceFolder"/compile.ps1},
                    "\${file"}
                ],
                "group": {
                    "kind": "build",
                    "isDefault": True
                },
                "problemMatcher": {
                "owner": "custom",
                "fileLocation": ["absolute"],
                "pattern": {
                    "regexp": "^file (.*), line (\d + ), column (\d + ): Error: (.*)\$",
                    "file": 1,
                    "line": 2,
                    "column": 3,
                    "message": 4
                    }
                },
                "presentation": {
                    "reveal": "always",
                    "clear": True,
                    "showReuseMessage": False,
                    "echoCommand": False
                }
            }
        ]
    }
    
    • Option 1: VSCode launches with Admin rights.

      @echo Off
      setlocal
      set "filePath=%~1"
      If "%filePath%"==" " (
          echo No file path provided.
          exit /b 1
      )
      rem Run the compiler and capture the output
      "`C:\Program` Files\Freedom Scientific\JAWS\2024\scompile.exe" "%filePath%" 2>&1
      rem Check the exit status of the compiler
      If %errorlevel% equ 0 (
          echo %filePath% Compiled Successfully
      ) else (
          rem Print the exit message
          echo The terminal process terminated with exit code: %errorlevel%.
          rem Print the error message again
          For /f "tokens=* delims=" %%i in ('"`C:\Program` Files\Freedom Scientific\JAWS\2024\scompile.exe" "%filePath%" 2^>^&1 ^| findstr /r "Error.*"') do echo %%i
          )
      
    • Option 2 (preferred): Run in an elevated Command Prompt

      @echo Off
      setlocal
      set "filePath=%~1"
      If "%filePath%"==" " (
          echo No file path provided.
          exit /b 1
      )
      rem Run the compiler and capture the output
      sudo "C:\Program Files\Freedom Scientific\JAWS\2024\scompile.exe" "%filePath%" 2>&1
      rem Check the exit status of the compiler
      If %errorlevel% equ 0 (
          echo %filePath% Compiled Successfully
      ) else (
          rem Print the exit message
          echo The terminal process terminated with exit code: %errorlevel%.
          rem Print the error message again
          For /f "tokens=* delims=" %%i in ('"C:\Program Files\Freedom Scientific\JAWS\2024\scompile.exe" "%filePath%" 2^>^&1 ^| findstr /r "Error.*"') do echo %%i
      )
      

To speed up the keystrokes necessary to get to the Run Task dialog (currently 4 keystrokes at least), we can assign a keystroke to the Run Task command directly.

  • Press CONTROL + K,release the K while keeping the CONTROL button down, and press K again

  • "Tasks: Run Task" into the form field and press \

  • Press DOWN ARROW to Run Task, it is the second one down. You are now placed in a form field labelled "Press desired key combination and then press ENTER"

  • Press the desired shortcut combination and press ENTER. The program tells you if you are using a repeated keystroke. I used CONTROL + ALT + ; since it was not already being used.

Now you can press CONTROL + ALT + ; (semicolon) then just hit ENTER since scompile is the top run task available. It will bring up a drop down with output scanning options.

This will open a terminal on the bottom of the screen --either Powershell or Command Prompt depending upon your selected preferences -- and run the task of compiling the .jss file. If successful, the terminal output states

::: leftbar C:\ProgramData\Freedom Scientific\JAWS[year]\Scripts\enu[script.jss] Compiled Successfully :::

If there is an error, the following will be output to the terminal:

::: leftbar Compiling C:\ProgramData\Freedom Scientific\JAWS[year]\Scripts\enu[script.jss]

file C:\Users[user]\AppData\Roaming\Freedom Scientific\JAWS[year]\Settings\enu[script.jss], line XX, column XX: Error: Unexpected word XX

The terminal process terminated with exit code 1

file C:\Users[user]\AppData\Roaming\Freedom Scientific\JAWS[year]\Settings\enu[script.jss], line XX, column XX: Error: Unexpected word XX :::

If you press CONTROL + SHIFT + M and access the Problems tab, the top entry will be this:

::: leftbar Unexpected word XX [Ln XX, Col XX] :::

When you highlight the Error, the cursor for the editor moves to the line with the error and highlights it. Pressing F6 a few times moves the editing cusor there. Or else you can just use the line and column of the error to get to it

VS Code-Based Code Editors Summary

Given the popularity of Visual Studio Code and its open-source core Code-OSS, many editors and IDEs have been built on top of, or are compatible with, the VS Code base. The table below summarizes some of the notable editors and IDEs in this ecosystem, highlighting their relationship to VS Code, form factors, and key notes. My focus on these editors over others is the fact that accessibility tools work out of the box with them, making them suitable for JAWS scripting without a large amount of additional configuration. I am providing this list and diagram as a resource to alllow you to choose your preferred editor while still being able to follow along with the instructions in this book.

Editor / ProjectRelationship to VS CodeForm Factor / FocusKey Notes & Sources
Visual Studio Code (official)Distribution built from Code-OSS with Microsoft branding, telemetry and proprietary bitsDesktop (Electron), Web (Codespaces)VS Code is the Microsoft distribution of Code-OSS under a product license
Code-OSS (open-source core)MIT-licensed upstream core that many forks build uponUpstream source (not an end-user product)"Visual Studio Code is a distribution of the Code-OSS repository"
VSCodiumPrivacy-focused binary build of Code-OSS with telemetry removedDesktop (Electron)Community build; telemetry disabled; uses Open VSX by default in many distros
Positron (by Posit)Fork built on Code-OSS; data-science oriented (Python/R)Desktop; adds console, variables pane, data explorer, plotsPositron explicitly states "built on Code-OSS"; migration guides from VS Code
CursorVS Code fork with AI-first features (chat, multi-file edits)Desktop; AI integrated workflowMultiple sources describe Cursor as a VS Code fork with deep AI integration
OpenVSCode Server (by Gitpod)Runs upstream VS Code in a server/browser architecture (fork aimed at web)Browser; remote/dev server usageProject provides "a version of VS Code that runs on a remote machine and is accessed via a browser"
code-server (by Coder)Runs VS Code in the browser (server-side), self-hostableBrowser; remote/dev server usage"Run VS Code on any machine and access it in the browser" (open-source project)
StackBlitz CodeflowVS Code running natively in modern browsers via WebContainersBrowser; instant PR/workspace flowsArticle and docs describe Codeflow as VS Code in the browser powered by WebContainers
VS Code-compatible (Monaco/LSP), not direct forks
Eclipse TheiaVS Code-compatible framework (reuses Monaco/LSP; supports VS Code extensions); not a VS Code forkFramework + Desktop/Web IDETheia is independently developed; supports VS Code extensions and reuses Monaco; licensing differs from VS Code
Eclipse Che (Che-Theia)Cloud IDE/workspace platform whose default IDE is Theia-based (Che-Theia)Browser/Kubernetes workspacesChe-Theia is Theia with workspace features; supports VS Code extensions; Che commonly paired with Theia
Gitpod (Cloud IDE)Provides browser VS Code via OpenVSCode Server; historically used Theia in earlier offeringsBrowser; ephemeral cloud workspacesGitpod's OpenVSCode Server enables VS Code in-browser; older comparisons mention Che/Theia vs Codespaces
graph TD
    subgraph core["🔵 Core"]
        codeoss["Code-OSS<br/>(VS Code Open Source core)"]
        rawbuild["Code-OSS<br/>(raw builds)"]
    end
    
    subgraph forks["🟢 Forks / Distributions"]
        vscode["Visual Studio Code"]
        vscodium["VSCodium"]
        cursor["Cursor"]
        positron["Positron"]
        mrcode["MrCode"]
    end
    
    subgraph servers["🟠 Server / Browser"]
        openvscode["OpenVSCode Server"]
        codeserver["code-server"]
    end
    
    subgraph clouds["🟡 Cloud / Web IDEs"]
        codespaces["GitHub Codespaces"]
        vscodeweb["VS Code for the Web<br/>(vscode.dev)"]
        gitlabide["GitLab Web IDE"]
        gwork["Google Cloud<br/>Workstations"]
        gitpod["Gitpod"]
        sapbas["SAP Business<br/>Application Studio"]
        awsce["AWS SageMaker<br/>Code Editor"]
        coder["Coder platform"]
    end
    
    subgraph theia["🟣 VS Code-compatible"]
        theia_fw["Eclipse Theia<br/>Framework"]
        theiaide["Theia IDE"]
        theia_gen["Theia Yeoman<br/>Generator<br/>(custom IDEs,<br/>Embedded, IoT,<br/>Enterprise, Cloud,<br/>Education)"]
        che["Eclipse Che"]
        codeeditor["Code Editor<br/>(Oracle)"]
        smartface["SmartFace"]
        css["Code Composer<br/>Studio"]
        arduino["Arduino IDE 2.0"]
    end
    
    %% Forks from Code-OSS (solid arrows)
    codeoss --> vscode
    codeoss --> vscodium
    codeoss --> cursor
    codeoss --> mrcode
    codeoss --> rawbuild
    codeoss --> positron
    
    %% Servers from Code-OSS (solid arrows)
    codeoss --> openvscode
    codeoss --> codeserver
    
    %% Cloud services from Code-OSS (solid arrows)
    codeoss --> codespaces
    codeoss --> vscodeweb
    codeoss --> gitlabide
    codeoss --> gwork
    
    %% Cloud services from OpenVSCode Server (solid arrows)
    openvscode --> gitpod
    openvscode --> sapbas
    openvscode --> awsce
    
    %% Cloud services from code-server (solid arrows)
    codeserver --> coder
    
    %% Connection to Theia ecosystem (dashed for compatibility)
    codeoss -.->|compatibility| theia_fw
    
    %% Theia relationships (solid arrows)
    theia_fw --> che
    theia_fw --> theiaide
    theia_fw --> theia_gen
    theia_fw --> codeeditor
    
    theia_gen --> css
    theia_gen --> arduino
    theia_gen --> smartface
    
    %% Styling
    classDef coreStyle fill:#ADD8E6,stroke:#000,stroke-width:2px
    classDef forkStyle fill:#90EE90,stroke:#000,stroke-width:2px
    classDef serverStyle fill:#FFB347,stroke:#000,stroke-width:2px
    classDef cloudStyle fill:#FFFF99,stroke:#000,stroke-width:2px
    classDef compatStyle fill:#DDA0DD,stroke:#000,stroke-width:2px
    
    class codeoss,rawbuild coreStyle
    class vscode,vscodium,cursor,positron,mrcode forkStyle
    class openvscode,codeserver serverStyle
    class codespaces,vscodeweb,gitlabide,gwork,gitpod,sapbas,awsce,coder cloudStyle
    class theia_fw,theiaide,theia_gen,che,codeeditor,smartface,css,arduino compatStyle

The above information is from these sources:

{{#cite ms-code-oss-github}}

{{#cite ms-vscode-site}}

{{#cite vscodium-site}}

{{#cite archwiki-vscode}}

{{#cite positron-migrate-vscode}}

{{#cite posit-blog-positron-guides}}

{{#cite codecademy-cursor-guide}}

{{#cite vibe-coding-cursor}}

{{#cite gitpod-openvscode-github}}

{{#cite devclass-openvscode}}

{{#cite coder-code-server-github}}

{{#cite coder-code-server-docs}}

{{#cite stackblitz-webcontainers-post}}

{{#cite maiertech-codeflow}}

{{#cite eclipsesource-theia-vs-vscode}}

{{#cite theia-language-support}}

{{#cite che-theia-github}}

{{#cite eclipsesource-che-vs-codespaces}}

4

VSCodium, Positron, Theia, Eclipse Che, GitPod IDE, Coder, Cursor, Code-OSS, MrCode are all based on VSCode and the process I explain below applies to all of these and require virtually identical keystrokes

1

Zed is not screenreader friendly so I am not covering it here

2

JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format. It represents structured data using key--value pairs and arrays, making it both human-readable and machine-parsable. JSON is language-independent but uses conventions familiar to programmers of C-like languages. Commonly used for configuration files, APIs, and data exchange between systems. Example: {"name: 'Alice', 'age': 30, 'skills': ['Python', 'JAWS']}".

3

In a JSON file the tab indentation, comma usage, spaces, and brackets all need to be maintained, so it is unfortunately very easy for a JSON file to get garbled



Introduction to JAWS Scripting

Introduction

Users of screen readers have long been plagued with the plight of configuring their adaptive equipment to work with mainstream software. If you are a user of JAWS for Windows, you might not be aware that JAWS contains a built-in scripting language that lets you make mainstream applications appear more "speech friendly" and accessible. You have probably also heard that scripting is not for the faint of heart or the technologically timid.

This manual will:

  • Introduce JAWS script writing.

  • Explain why scripts are sometimes necessary.

  • Explain the structure of scripts.

  • Demonstrate how the Script Manager functions.

  • Teach you how to script an application for the first time.

This manual is intended for beginners to JAWS scripting or those who want a basic overview of its overall utility for making applications appear more accessible.

Definitions

A JAWS script is merely a bridge between the screen reader and the mainstream application. The script does not change the application itself but, rather, helps JAWS extract information from the program that it needs. A script can make a poorly behaved application speak more easily and naturally for the user and can also provide functionality that previously did not exist. For example, you can use scripts to build hot keys to read any part of the screen and to move to parts of an application that are not navigable using the standard keyboard commands. These are only two examples of how scripting can be used to make an application more accessible and usable.

::: {#overview-of-jaws-scripting-language}

Overview of JAWS scripting language

:::

The JAWS scripting language, just like any other programming language, has its own conventions, syntax and rules that a programmer has to follow. It is in a way comparable to "rules of the road" that each car driver and pedestrians have to follow when crossing or driving through the streets.

The programs, written in JAWS scripting language, are called scripts and are stored in script files with an extension .jss. However, before these programs can be used, they have to be compiled into a format that the computer can understand. The format is called JAWS Script Binary and the files will have an extension of .jsb. Please remember that it is the binary (.jsb) file that JAWS will use to execute (perform) instructions that you will have written in your script source (.jss) file.

  • .JSS stands for JAWS Script Source;

  • .JSB stands for JAWS Script Binary.

For the purpose of being clear on terminology, we will call the file that contains scripts, functions and statements a script file. Very often though you will hear people calling the script file a script. Be sure you understand the difference or there can be misunderstandings when describing your process to others. We will thoroughly explain the difference between the terms "Script" and "Function" a little later.

JAWS script files are associated with an application for which the script is written. For example, if the application name is "Microsoft Word" and the application's main executable file is WinWord.exe, the name of the JAWS script file for this application will by default be Word.jss1

  • To find out whether a currently-opened application has any associated script files, press JAWSKEY + Q when the application is in focus.

A JAWS script file will contain one or more sections and instructions to tell JAWS what to do in certain situations, for example what to speak when something happens on the screen or when a user presses a shortcut key. The instructions are called statements and the sections are called scripts or functions.

::: {#file-types-and-their-meanings}

File Types and Their Meanings

File Types and Their Meanings :::

::: {#overview}

Overview

:::

JAWS stores all the information, pertaining to the scripts and functions, into multiple files with different extensions. For example, you know that the script source goes into the file with an extension .jss and the compiled binary script file goes into the file with an extension of .jsb. You will be interested to know that the keyboard keystrokes, associated with our scripts, are saved into the file with an extension of .jkm.

Have you ever wondered how JAWS remembers your settings that you save with Keyboard Manager or Configuration Manager? If you run Graphic Autolabeler -- a feature that allows JAWS to automatically label graphics if the tooltips are present for them (JAWSKEY + CONTROL + G), JAWS remembers those labels next time you open the application. In the same way, if you change an option in a Configuration Manager, for example punctuation speaking level, and save the file, your settings will also be remembered. JAWS has this wonderful memory of your actions because the information you modify is saved into the files with different extensions. All of them, with the exception of the JSB files, are regular text files which you can open in any text editor. The JSB files are binary files and cannot be read in the same way that text files can.

Please keep in mind that even though most of JAWS script-related files are saved in text format, you should take precaution when modifying them by hand. This is because JAWS saves these files by following certain rules. If you change the format that JAWS expects, you may get unpredictable results with the behaviour of JAWS.

ExtensionNameDescription
JSSJAWS Script Sourcethis is where your original scripts and functions are located.
JSBJAWS Script Binarycontains machine-readable code ready for execution, i.e. format that computer understands.
JSDJAWS Script DocumentationContains documentation for your script file, such as list of scripts, functions and their names.
JKMJAWS Keyboard MapContains the list of all keystrokes for a given script file.
JSHJAWS Script HeaderContains a list of constants or global variables for your script.
JSMJAWS Script MessagesContains a list of message constants.
JCFJAWS Configuration FileContains the list of configuration parameters for a given application (check "Configuration manager" topic in JAWS help for more information).
JGFJAWS Graphics FileContains a list of graphics, icons and other symbols, with their labels (check the graphic autolabeler feature in JAWS tutorial for more information).
JDFJAWS Dictionary FileContains the list of words and phrases with your pronunciation (check the "Dictionary Manager" topic in JAWS help for more information).
JFFJAWS Frame FileContains the list of frames for a given application (check "Frame Manager" topic in JAWS help for more information).
JFDJAWS Frame DocumentationContains the documentation and descriptions of the frames for a given application.
JBSJAWS Braille StructureContains the list of Braille controls for use with JAWS and Braille display.
JBDJAWS Braille DocumentationContains documentation for Braille-related scripts and functions.
JBTJAWS Braille TableBraille table used by JAWS to support multiple languages other than English.
SBLSymbol fileContains the list of symbols for a given speech synthesizer, i.e. pronunciation of punctuation marks in different languages etc.

Not all 15 file types have to be present for a given script file, however, most of the time you will see the most important ones, such as .jss, .jsb, .jsd, .jsh, .jsm, and .jcf. Of course, you do not have to memorize any of these extensions, but it would be useful for you, as a "Scripter", to know what they stand for.

::: {#practical-usage}

Practical Usage

:::

As stated previously, most of the JAWS script files can be opened and edited in remarkpad (or any other text editor), except for the ones with an extension of .jsb. However, this is only recommended for advanced users because they will know the format that these files have to follow in order to be understood by JAWS.

It is, therefore, suggested that you use dedicated programs to open these files, i.e., use Configuration Manager to open .jcf files or Keyboard Manager to open .jkm files. A convenient place to access these tools is from the "Run JAWS Manager" dialog box accessed by pressing JAWSKEY + F2. This will display a list of available tools, like Script Manager or Configuration Manager.

::: {#configuration-manager}

Configuration Manager

:::

Through the Configuration Manager tool you can modify the behavior of JAWS. For example, you can change what is spoken, when and how the punctuation is handled and how the text is processed by JAWS. The Configuration Manager can also be accessed via "Run JAWS Manager" dialog box or by pressing JAWSKEY + 6 (on the number row).

Once the Configuration Manager opens, you will have to use the menus in order to review/modify a particular section in the configuration file. Remember to save your changes with CONTROL + S and close the "Configuration Manager" window when you have finished working with it.

::: {#dictionary-manager}

Dictionary Manager

:::

Another useful JAWS utility is JAWS Dictionary Manager. It can either be accessed through the "Run JAWS Manager" dialog box or by pressing an JAWSKEY + D shortcut key.

The concept of the Dictionary Manager is to enable users to change the way JAWS pronounces certain words and phrases. Let's say you don't like the way in which JAWS speaks your name. You can easily change that by adding a new word to the Dictionary Manager. With JAWS 5.02 or later, you can even replace certain words and phrases with sounds. So for example, rather than saying United Kingdom, JAWS can play an anthem of that country. For more information on this interesting and exciting feature, please check the "Speech and Sounds Manager" in the JAWS Help topics.

Once you open the Dictionary Manager, you will be presented with a dialog window containing the list of already-changed words, buttons to add/remove them and search for an existing word. The interface should be fairly straightforward from there on.

::: {#other-jaws-tools}

Other JAWS Tools

:::

Apart from the tools mentioned, JAWS has other useful utilities, such as Graphics Labeler. With a help of this application you can have JAWS attach a text description to a graphic or an icon. You can do this either manually by placing your cursor on a graphic, then pressing JAWSKEY + G and typing in a text label, or automatically by letting JAWS scan the current window and attempt to attach the label by using tooltips (for information on Tooltips search JAWS Help topics or Windows Online Help). You can activate Graphics Autolabeler by pressing CONTROL + JAWSKEY + G.

The Keyboard Manager will be discussed in the next chapter. However for more information about JAWS utilities, please refer to JAWS Help, topic "Using JAWS", subtopic "Overview of JAWS Utilities".

JAWS Hierarchy

One of the most powerful features of JAWS is that settings can be applied globally or on an application specific basis. Application specific settings are saved using the application name with the appropriate configuration file extension. Global settings are saved in the default versions of the various configuration files.

Application specific settings can override global settings; so if you change a setting in the specific default configuration file and some of your programs do not reflect this change, make the change in the configuration files for those programs as well.

graph LR
    subgraph USER["🟠 User Settings"]
        US["User Settings"]
        USC["User Scripts<br/>(jsb, jsm, jsh)"]
        UAP1["Word<br/>Word.jsb"]
        UAP2["Vivaldi Browser<br/>Vivaldi.jsb"]
        UAP3["Firefox Browser<br/>Firefox.jsb"]
        UAP4["Teams<br/>Teams.jsb"]
        US --> USC
        USC --> UAP1
        USC --> UAP2
        USC --> UAP3
        USC --> UAP4
    end
    
    subgraph DEFAULT["🔵 Default/Shared Scripts"]
        DG["Default/Shared<br/>Global Settings"]
        DSF["Default Script Files<br/>.jsb, .jss, .jsm<br/>.jsh, .jkm, .jsd"]
        DSHS["Shared/Default Settings<br/>.chr, .json, .xml<br/>.sbl, .vpf, .ini<br/>.jgf, .smf, .jdf<br/>.qs, .qsm"]
        DG --> DSF
        DG --> DSHS
    end
    
    subgraph APPS["🟢 Applications"]
        APP["Applications"]
        AW["Word<br/>Word.jsb"]
        AE["Edge Browser<br/>Edge.jsb"]
        AF["Firefox Browser<br/>Firefox.jsb"]
        AC["Chrome Browser<br/>Chrome.jsb"]
        AX["Excel<br/>Excel.jsb"]
        AZ["Zoom<br/>Zoom.jsb"]
        APP --> AW
        APP --> AE
        APP --> AF
        APP --> AC
        APP --> AX
        APP --> AZ
    end
    
    %% Default Script Files to Applications (blue arrows)
    DSF -->|scripts| AW
    DSF -->|scripts| AE
    DSF -->|scripts| AF
    DSF -->|scripts| AC
    DSF -->|scripts| AX
    DSF -->|scripts| AZ
    
    %% Shared Settings to Applications (teal arrows)
    DSHS -->|settings| AW
    DSHS -->|settings| AE
    DSHS -->|settings| AF
    DSHS -->|settings| AC
    DSHS -->|settings| AX
    DSHS -->|settings| AZ
    
    %% User overrides (red arrows)
    UAP1 -->|overrides| DSF
    UAP2 -->|overrides| DSF
    UAP3 -->|overrides| DSF
    UAP4 -->|overrides| DSF
    US -->|overrides| DSHS
    
    %% Styling
    classDef userStyle fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
    classDef defaultStyle fill:#ADD8E6,stroke:#4169E1,stroke-width:2px
    classDef appStyle fill:#90EE90,stroke:#228B22,stroke-width:2px
    
    class USER userStyle
    class DEFAULT defaultStyle
    class APPS appStyle
UtilityFile ExtensionDescription
Configuration Manager.jbsJAWS Braille structured file.
.jcfJAWS configuration file.
Dictionary Manager.jdfJAWS dictionary file.
Frame Viewer.jfdJAWS frame documentation file, stores the frame synopsis and description for all frames listed in the jff file.
.jffJAWS frame file, stores frame definitions.
Graphics Labeler.jgfJAWS graphic labels file.
Keyboard Manager.jkmJAWS key map file.

::: {#script-manager-files}

Script Manager Files

Script Manager Files :::

Unlike the other managers used by JAWS, the Script Manager has a number of files associated with it. All files follow the same naming convention as the files used by the other JAWS managers.

File ExtensionDescription
.jsdJAWS Script Documentation file. Contains descriptive information about each script or user-defined function when it is created.
.jshJAWS Script header file. Contains global variable and constant definitions.
.jsmJAWS Script Message file. Contains message and string constant definitions.
.jssJAWS script source file. Contains all scripts and functions developed for an application.
1

This file used to be called WinWord.jss prior to 2020

2

Released in 2003. As of 2026-01-20 JAWS is on version 2026



The Keyboard Manager

Introduction to the Keyboard Manager

You use the Keyboard Manager to control the assignment of keystrokes to JAWS screen reading activities. The Keyboard Manager stores keystroke assignments in key map files with the extension of .jkm.

There are two types of key map files:

  • Default

  • Application

The default key map file contains the keystroke assignments for the default scripts. Application key map files contain keystroke assignments for scripts in an application script file. JAWS stores key map files in the JAWS settings directory.

Starting the Keyboard Manager

When running an application, press JAWSKEY + F2 to open the Run JAWS Manager dialog, followed by K, and ENTER. When you start the Keyboard Manager from within an application, the Keyboard Manager automatically opens the key map file for that application, if one exists. Otherwise, the Keyboard Manager opens the default key map file, default.jkm. When you start the Keyboard Manager from the Utilities menu within the JAWS interface, the default key map file is opened.

Using the Keyboard Manager

As will be seen later, you usually assign keystrokes to scripts at the time you create the script using the Script Manager. You can use the Keyboard Manager to browse and change current keystroke assignments, as well as add and delete keystroke assignments.

The Keyboard Manager has a similar screen layout to Windows Explorer. It consists of two panes.

  • Left pane

  • Right pane

The left pane contains a list of all current application specific and the default key map files in alphabetic order. The right pane contains a list of scripts in the script file associated with the current key map file.

The list is organized in four columns:

  • Script name

  • Keystroke

  • Key map file name

  • Key map section

Use the ARROW KEYS to select one of the key map files in the left pane and then TAB to the right pane and use the ARROW KEYS to select a specific script. You can add a keystroke assignment to the laptop, desktop, Kinesis keyboard layout or all keyboard layouts. When you add keystrokes to a specific keyboard layout, the keystroke assignment does not appear when the keyboard layout is changed. When you do not assign a keystroke to a specific keyboard layout, then the Keyboard Manager displays "common" in the key map section column.

::: {#add-change-or-delete-a-keystroke}

Add, Change, or Delete a Keystroke

:::

After you locate the proper script, use the Action menu to Add, Change, or Remove the keystroke assigned to this script.

Changing keystroke assignments is not recommended unless you have given careful consideration to the keystroke assignment being changed. Instead of changing an existing keystroke assignment, you can add a new assignment using the Action menu. When you add a keystroke, the Keyboard Manager does not replace the existing keystroke assignment. Rather, an additional keystroke assignment for the same script is created. If more than one keystroke is assigned to a script, the script is listed once for each keystroke in the key map file.

Deleting a keystroke assignment from the key map file does not delete the script it is assigned to. Only the keystroke assignment is deleted.

::: {#find-a-keystroke}

Find a Keystroke

:::

To search for a specific keystroke in the current key map file, move to the Scripts List in the right pane, choose Find Keystroke from the Action menu, press the keystroke you wish to find, and press ENTER. If the keystroke exists, the Keyboard Manager selects the script name assigned to this keystroke. If the Keyboard Manager does not find the keystroke, then the Keystroke Not found dialog is displayed.

::: {#review-documentation-for-a-keystroke}

Review Documentation for a Keystroke

:::

When assigning a keystroke to a script, it is often useful to browse the script documentation first. The script documentation consists of the Synopsis (brief description of the script's purpose) and the Description (additional information about the script). You can view the documentation for the current script by choosing Documentation from the Action menu or by pressing ENTER while the script name in the list is selected.

::: {#changing-keyboard-manager-options}

Changing Keyboard Manager Options

:::

There are five groups of optional settings that change how the Keyboard Manager displays its information. All of these options are contained in one multi-page dialog. Choose any of the five groups from the Options menu to open that page of the Options multi-page dialog. Once you open the dialog, you can move to each page by pressing CONTROL + TAB.

The Options multi page dialog contains the following pages:

  • Key Filter

  • Sort

  • Hot key

  • Messages

  • File Filter

Use the Key Filter page of the Options multi-page dialog to decide which key assignments and scripts to display in the scripts list. Use the Sort page of the Options Multi-page dialog to decide which column of the script list the Keyboard Manager uses to sort the list. Use the Hot Key page of the Options multi-page dialog to choose keys you can use in a hot key edit box. Use the Messages page of the Options multi-page dialog to choose messages used by the Keyboard Manager. Use the File Filter page to decide where the Keyboard Manager should look for key map files to display.

::: {#key-filter-options}

Key Filter Options

:::

The Keyboard Manager has two key filter settings:

  • Key Assignments

  • Scripts

Each filter option has three radio buttons.

  • All

  • Active

  • Application

::: {#key-assignments-group}

Key Assignments Group

:::


Option Description All Displays all keystroke assignments in both the current key map file and the default key map file. Active Displays only active keystroke assignments in both the current key map file and the default key map file. If a keystroke is assigned in both the application and default key map files, only the application keystroke is active as JAWS always acts on the first keystroke it finds and it looks in the application key map file first. This setting filters out duplicate keystrokes in the default key map file. Application Displays only key assignments in the current key map file.


: Key Assignments Group

::: {#scripts-group}

Scripts Group

:::


Option Description All Displays all scripts. Assigned to Keys Displays only scripts assigned to keystrokes. Unassigned Displays only scripts not assigned to keystrokes.


: Script Groups

::: {#sort-options}

Sort Options

:::

The Sort page has four radio buttons that allow you to sort the key map file by a specific column.

  • Script Name

  • Keystroke

  • Key Map File

  • Key Map Section

Choose the radio button that corresponds to the column you would like to use as the sort column for the Scripts List in the right pane.

::: {#hot-key-options}

Hot Key Options

:::

The Keyboard Manager has four checkboxes on the Hot Keys page of the Options multi-page dialog that correspond to: TAB, SHIFT + TAB, ENTER, and ESCAPE. Check each one you want to use as a hot key. These keys are usually used to navigate in dialog boxes. For example, pressing TAB usually moves focus to the next control. That prevents it from being assigned to a script.

Assigning scripts to these keys is not recommended!

If you would like to assign TAB to a script, follow these steps:

  1. Choose Hot Key from the Options menu, check the Tab checkbox, and press ENTER.

  2. Select a specific script and choose either Add Keystroke or Change Keystroke from the Action menu.

  3. The Assign To: edit box is active in either the Add Keystroke or Change Keystroke dialog, press TAB, and ENTER.

::: {#messages-options}

Messages Options

:::

There is only one checkbox on the Messages page of the Options multi-page dialog. Check the Show notification messages when about to modify a file checkbox to have Keyboard Manager notify you before modifying a key map file.

::: {#file-filter-options}

File Filter Options

:::

The File Filter page has three radio buttons that allow you to indicate which set of key map files JAWS should display in the eyboard Manager:

  • Active Files

  • User Files

  • Shared Files

When you select the Active Files radio button, all key map files currently in use are displayed. If both a shared and user version of the same key map file exist, only the user-specific file is displayed. When you select the User Files radio button, only those key map files found in your user settings folder are displayed. These keystrokes override those in the shared key map files. When you select the Shared Files radio button, only those key map files found in the shared settings folder are displayed.

The Keyboard Manager Exercises

The following exercises give you practice in using many of the functions of the Keyboard Manager. The objective of the exercise is listed first.

Finding a Keystroke

The objective of this exercise is to find a specific keystroke within the default key map file and view the corresponding script documentation.

  1. Press JAWSKEY + F2 to display the Run JAWS Managers dialog.

  2. Type K to select the Keyboard Manager option followed by ENTER. This action starts the Keyboard Manager.

  3. Press JAWSKEY + UPARROW to read the current line. This is the current key map file. Did the selected key map file match the active application?

  4. Press CONTROL + SHIFT + D to select the default key map file. The contents of the file are shown in the right hand pane of the Keyboard Manager.

  5. Press TAB to move to the right hand pane of the manager. How many items does JAWS tell you are contained in the list?

  6. Press CONTROL + F to activate the Find Keystroke dialog.

  7. Press JAWSKEY + F12. JAWS speaks the keystroke after you press it as JAWSKEY + F12. The keystroke is also shown in the Search for Key edit box.

  8. Press ENTER to begin the search. Did JAWS find the keystroke? Did JAWS read the script name, keystroke, key map file name and section? If you did not hear this information, press JAWSKEY + UPARROW to read the current line and repeat the information.

  9. Press CONTROL + D to activate and display the Script Information dialog. Press TAB and SHIFT + TAB to move to and read the edit boxes contained in the dialog.

  10. Press ESCAPE to close the dialog after you have reviewed the script information.

Adding a Keystroke

The objective of this exercise is to locate a specific keystroke in the default key map file and add a second keystroke to the script attached to that keystroke. If you already have the Keyboard Manager running, you can move to it by pressing ALT + TAB.

  1. Press CONTROL + F to activate the Find Keystroke dialog.

  2. Press JAWSKEY + F11. This is the keystroke for which we want to search. JAWS echoes the keystroke as you press it and JAWSKEY + F11 is placed in the Search for Key edit box.

  3. Press ENTER to begin the search. When JAWS finds the keystroke, the information is selected and spoken automatically by JAWS.

    If the keystroke was not found, then the Keystroke Not Found dialog is displayed.

  4. Press CONTROL + A to activate the Add Keystroke dialog. The Assign To edit box is active.

  5. Press CONTROL + F11. JAWS echoes the keystroke and CONTROL + F11 is placed in the Assign To edit box.

  6. Press TAB to move to the Assign To X Keys Only check box where X represents the keyboard layout in use. If you are using the desktop layout then this is the Assign Key To Desktop Keys Only checkbox.

  7. Press SPACEBAR to uncheck the Assign Keys to X check box.

  8. Press ENTER to activate the Ok button in the Add Keystroke dialog. Since the default button is the Ok button, the dialog is closed. Next, the Confirm Add Keystroke dialog is displayed.

  9. Press SPACEBAR to activate the Yes button. The Confirm Add Keystroke dialog is closed and you are returned to the Keyboard Manager.

  10. Press JAWSKEY + UPARROW to read the current line. Did you hear the original keystroke information for JAWSKEY + F11 spoken by JAWS?

  11. Press DOWN ARROW to move to the next entry in the list. Did you hear the new keystroke echoed by JAWS? If you want to repeat the information, press JAWSKEY + UPARROW to read the current line.

After you have completed the steps above, be sure to test both new and old keystrokes. Do they both work?

Additional Practice: Now that you have practiced removing keystrokes, try adding a completely new keystroke to a different JAWS function. Choose a function from the default key map file that you find useful, and assign it an additional keystroke using the process you learned in this exercise. Test both keystrokes to ensure they work correctly. Consider which additional keystroke would be most ergonomic for your keyboard layout and usage patterns.

Changing an Existing Keystroke

The objective of this exercise is to locate the keystroke we just added in the previous exercise and change it. You should still have the Keyboard Manager running with the default key map file open.

  1. Press CONTROL + F to activate the Find Keystroke dialog. The focus is in the Search for Key edit box.

  2. Press CONTROL + F11. This is the keystroke for which the search is carried out. JAWS speaks the keystroke and CONTROL + F11 is displayed in the Search for Key edit box.

  3. Press ENTER to activate the Ok button. The find keystroke action is performed. When the keystroke is found, the keystroke information is spoken automatically by JAWS.

  4. Press CONTROL + H to activate the Change Keystroke dialog. The Assign To edit box is active in this dialog.

  5. Press SHIFT + F11. This is the new keystroke. JAWS echoes the keystroke and SHIFT + F11 is placed in the assign To edit box.

  6. Press TAB to move to the Assign to X Keys Only check box, where X represents the keyboard layout in use. If you are using the desktop layout, then this check box is labeled as Assign to Desktop Keys Only.

  7. Press SPACEBAR to uncheck the Assign to Desktop Keys Only checkbox.

  8. Press ENTER to activate the Ok button. The Change Keystroke dialog closes. The Confirm Change Keystroke dialog box is then displayed and the Yes button is active.

  9. Press SPACEBAR to activate the Yes button. The Confirm Change Keystroke dialog closes and you are returned to the Keyboard Manager.

  10. Press JAWSKEY + UPARROW to read the current line. What keystroke information was spoken by JAWS?

  11. Since the current keystroke entry is not the changed entry, press UP ARROW to move to the prior entry. Is this your new keystroke?

After you have followed the steps above, be sure to test both the old and new keystrokes. Do they both work as expected?

Removing a Keystroke

The objective of this exercise is to find the keystroke we changed in the previous exercise and remove it. This will leave only the original keystroke to list the items in the system tray.

  1. Press CONTROL + F to activate the Find Keystroke dialog. The Search for key edit box is active.

  2. Press SHIFT + F11. This is the keystroke for which the search is carried out. JAWS echoes the keystroke and SHIFT + F11 is placed in the Search for Key edit box.

  3. Press ENTER to perform the Find Keystroke action. When the keystroke is found, the information is highlighted and spoken automatically by JAWS.

  4. Press DELETE to remove the keystroke. The Remove Keystroke dialog is displayed and the Yes button is active.

  5. Press SPACEBAR to activate the Yes button and close the Confirm Remove Keystroke dialog. The keystroke is removed from the default key map file.

  6. Press JAWSKEY + UPARROW to read the current line. Is the SHIFT + F11 keystroke gone? Is the default keystroke, JAWSKEY + F11, the only keystroke displayed?

Additional Practice: Now that you have practiced removing keystrokes, try adding a completely new keystroke to a different JAWS function. Choose a function from the default key map file that you find useful, and assign it an additional keystroke using the process you learned in this exercise. Test both keystrokes to ensure they work correctly. Consider which additional keystroke would be most ergonomic for your keyboard layout and usage patterns.



Technical Overview of Scripts

Introduction

You can think of a script as a block of code that contains sequences of individual steps used to activate and control a wide variety of computer processes. A script is like a mini computer program that combines a number of steps into one operation. The action a script performs ranges from tasks as simple as entering repetitive strings of data to many of the standard routines your computer does on an ongoing basis as part of its operation.

Scripts or combinations of scripts and functions control most JAWS facilities. Scripts analyze what actions are taking place in an application and determine how to handle the screen reading for you.

Script files also contain a second block of code called a function. Like a script, a function is also a sequence of statements that perform a given task. However, functions differ from scripts in that you cannot activate them with a keystroke.

You create scripts and functions with the Script Manager. You use a standard set of programming codes, formats, and rules to create your scripts and functions. After you have written your script or function, you compile your script or function into machine-readable language, so that the computer can understand the instructions. Once you compile your scripts or functions, they are ready for your use.

JAWS Scripts and Script Files

A script file is a file that contains multiple scripts and functions. You can find a number of script files in the JAWS shared settings folder. These script files all have the extension of .jss for JAWS script source. For example, the Default.jss script file contains all the scripts and functions JAWS uses to interface with Windows applications. JAWS also uses application-specific script files. These files contain all the scripts and functions needed to access information in a given application. JAWS loads the application script file on top of the default script file when you start the corresponding application.

::: {#default-script-file}

Default Script File

Default Script File :::

JAWS loads the default script file each time it starts. The scripts and functions contained in this file are active in all applications. JAWS receives all the information from the scripts contained in the default script file it needs to provide proper voice output. The scripts within this file tell JAWS what to speak and when to speak it in most circumstances. The default script file is named Default.jss.

::: {#application-specific-script-files}

Application Specific Script Files

:::

The second type of script file JAWS uses is specific to a Windows application. You create an application-specific script file when you encounter situations that require customized reading of the screen. JAWS loads the application-specific script file when the application is started or becomes active. For example, an application named spreadsheet.exe has a script file called spreadsheet.jss. The application script file must exist in either the JAWS shared or user settings folder in order to be loaded with the application at run-time.

When the spreadsheet application is no longer active, JAWS unloads the Spreadsheet.jss script file. All of the default scripts then become active until JAWS loads another application's script file.

::: {#processing-keystrokes}

Processing Keystrokes

Processing Keystrokes :::

Each time you press a keystroke, JAWS goes through a series of steps to determine what action to perform. Even though your scripts may have different names, it is the keystroke binding that determines which script is performed. JAWS must first determine where the keystroke is assigned.

::: {#application-specific-key-map-file}

Application-Specific Key MapFile

:::

JAWS first looks for the keystroke assignment within the application-specific key map file. If JAWS finds the keystroke assignment in this file, then the name of the script associated with the keystroke is noted.

::: {#application-specific-script-file}

Application-Specific Script File

:::

JAWS then looks for the name of the script in the Application-specific Script file. If JAWS finds the script, then JAWS performs the script and no further processing is done.

::: {#default-key-map-file}

Default Key Map File

:::

If JAWS does not find the keystroke assignment in the application-specific key map file, then the default key map file is searched. If JAWS finds the keystroke assignment in this file, JAWS notes the name of the script activated by the keystroke.

Before JAWS executes the script, JAWS must determine if the script is contained in the application-specific script file.

::: {#application-specific-script-file-1}

Application-Specific Script File

:::

JAWS searches the application-specific script file for the script name found in the default key map file. If JAWS finds the script, then JAWS performs the script and no further processing is necessary.

If JAWS does not find the script within the application-specific script file, then JAWS searches the default file. If JAWS finds the script in the default file, then JAWS performs the script and no further processing is required.

Unknown Script Call

When JAWS does not find the name of the script attached to the keystroke in either the application specific or default script files, then an unknown script call error message occurs. JAWS speaks "unknown script call to" followed by the name of the script and then it is spelled. An unknown script call can occur when either the script has been deleted from the application-specific or default script file or when the name of the script is misspelled in the key map or script file.

To keep these types of errors from occurring, you should use the Script Manager to remove a script and its associated key map and documentation entries.

Passing the keystroke Through

If JAWS does not find the keystroke assignment in either key map file, then JAWS passes the keystroke through to the application. The application performs the keystroke just as if JAWS were not running. JAWS always performs a script in the application script file rather than a script found in the default script file even when you make the key assignment in the default key map file.

Assigning keystrokes

You can assign a keystroke to a customized script in an application-specific script file even though it is assigned in the default key map file. In doing so, you will not encounter any adverse consequences.

When you use a keystroke that is already defined in the default key map file, the default functionality is lost for only that application. For example, when you assign CONTROL + JAWSKEY + V to a script contained in the Notepad script file, the default script SayAppVersion, is no longer performed. JAWS recognizes the fact that you have used the default keystroke for an application-specific script.

So, JAWS does not perform the SayAppVersion script when you are using Notepad.

If you give the script in the application file the same name as the script in the default script file, you do not need to assign a keystroke to the application-specific script. JAWS performs the script in the application script file instead of the script found in the default file if they are both bound to the same keystroke. For example, you can find the AdjustJAWSOptions script in both the default script file and the Internet Explorer script file. The keystroke is assigned only in the default key map file. When you press JAWSKEY + V while you are in Internet Explorer, JAWS finds and performs the application-specific version of the AdjustJAWSOptions script. However, when you are using Notepad and press JAWSKEY + V, JAWS performs the AdjustJAWSOptions script from the default script file.

If you attempt to assign a script to a keystroke which is already in use by the default file, then JAWS displays a warning dialog. This warning dialog gives you the opportunity to continue with the assignment or change it to another key. This is to prevent you from accidentally disabling a script in the default file without realizing you are doing so. :::

Scripts vs. Functions

To this point we have discussed scripts as the primary way you interact with JAWS. A script is generally an entry point you invoke directly (for example, by pressing a keystroke or choosing a menu item). A function, by contrast, is a reusable block of code stored in a script file that is intended to be called by other code or the runtime. Functions let you encapsulate behavior, accept input, and optionally return a result when they finish executing.

In the JAWS Scripting Language (JSL) functions have several important properties worth understanding:

- Parameters and return values: A function may accept zero or more parameters supplied by its caller and may return a single result. Typical parameter types are numbers, strings, booleans, or runtime handles provided by the JAWS API. If you need to pass complex state, prefer passing compact identifiers or using clearly documented global objects.

- Side effects and purity: Some functions are written as "pure" helpers (they only compute and return a value), while many JSL functions produce side effects such as speaking text, moving the cursor, or changing settings. Minimize unexpected side effects and document them clearly so callers can rely on your function's behavior.

- Scope and visibility: User-defined functions live in script files and are visible to other code loaded together. Application-specific script files are loaded on top of the default script file, so an application script can override a function from the default file. To avoid accidental conflicts, choose descriptive, namespaced names for functions.

- Calling conventions: Functions are invoked by name from scripts or other functions. Event handler functions are invoked automatically by the JAWS runtime when matching events occur (see the next subsection). Built-in functions are called the same way as user functions but are supplied by the JAWS core.

- Compilation and runtime: Script files are compiled by the Script Manager before use. Syntax errors are reported at compile time or when a function is first executed; logical or runtime errors surface during execution and should be handled or documented.

There are three broad categories of functions used in JAWS scripting:

  • Event functions: Handler functions that the JAWS runtime invokes in response to UI or system events (for example, focus changes, new text on the screen, or cursor movement). These functions follow specific naming or registration conventions so the runtime can find and call them automatically. You usually do not create new event types, but you can implement or override existing event handlers in application-specific script files to customize how JAWS responds to those events.

  • Built-in functions: Functions provided by JAWS itself (the runtime and default scripts). These implement low-level operations---navigation helpers, speech primitives, cursor operations---and form the standard library available to all scripts. Built-in functions cannot be modified, but they can be called from your code.

  • User-defined functions: Functions you write to encapsulate reusable, application-specific logic. Use these to factor repeated behavior out of scripts, to expose small internal APIs, and to make scripts easier to test and maintain. Keep user-defined functions focused, give them descriptive names, document expected parameters/returns, and avoid relying on undocumented global state.

Best practices when designing functions in JSL:

  • Prefer small, single-purpose functions that are easy to read and test.

  • Document parameter meanings, return values, and any side effects (speaking, cursor movement, global changes).

  • Use clear naming to avoid collisions with default or application-specific functions.

  • Minimize and isolate side effects where practical; if a function must change global state, make that explicit in its name and documentation.

  • When overriding default behavior in an application script, call through to the default implementation only when appropriate and well understood.

Event Functions

JAWS performs event functions automatically when windows events occur. Without these event functions, JAWS does not speak system changes automatically.

You cannot create new event functions. However, you can modify existing event functions. You can also create application-specific versions of the event functions found in the default script file.

Some of the event functions within JAWS include:

AutoStartEvent () BottomEdgeEvent () FocusChangedEvent () NewTextEvent ()

JAWS performs the AutoStartEvent function each time an application is started or becomes active. JAWS performs the BottomEdgeEvent each time the active cursor reaches the bottom edge of a window. JAWS performs the FocusChangedEvent function when focus moves between applications, dialogs, and dialog controls. JAWS performs the NewTextEvent function each time any new text is written to the screen.

Built-in Functions

There are over 1300 built-in functions that are available for use in creating new or modifying existing JAWS scripts. You can think of the built-in functions as the building blocks of your scripts and functions. Some built-in functions include: SayLine, JawsCursor, NextWord, and PriorWord. You cannot modify existing built-in functions.

Built-in functions are performed when they are called by another script or function. These functions are performed by placing the name of the function within the coded lines of another script or function. When the script gets to the line that includes the name of the function, the function is performed. This process is known as "calling" a function.

User-defined Functions

You can find user-defined functions in script files. These functions are developed by either Freedom Scientific script developers or by a script developer outside of Freedom Scientific. These user-defined functions have been created for some special purpose and can also be modified. Like built-in functions, user-defined functions are called from a script or another function.

What are Scripts Exercises

.exercise

Performing Scripts

The objective of this exercise is to show how a single keystroke can activate either an application-specific script, or a script found in the default script file.

  1. Press WINDOWSKEY + M to minimize all of your running applications.

  2. Start Notepad from the start menu. You can find the Notepad application in your Programs | Accessories group within your Start Menu.

  3. After Notepad starts make sure it is the active application by pressing JAWSKEY + T. You should hear JAWS speak "Untitled - Notepad".

  4. Press JAWSKEY + V to activate the Adjust JAWS Options dialog. Note how many items are found within this dialog. How many are there? What was the first item in the tree view?

  5. Press ESC to close the Adjust JAWS Options dialog and return to Notepad.

  6. Press WINDOWSKEY + M to minimize all of your running applications and make the Desktop active.

  7. Press I until you locate the Internet Explorer icon on your desktop. When you find the icon, press ENTER to start Internet Explorer.

  8. Press JAWSKEY + T to read the title of the active window. Internet Explorer should be the active application.

  9. Press JAWSKEY + V to display the Adjust JAWS Options dialog. How many items are in this tree view? Is the tree view different from the tree view you saw while in Notepad? Why?

Additional Practice: Open multiple different applications (such as Word, Excel, Firefox, and your email client) and examine how the Adjust JAWS Options dialog differs in each application. Pay special attention to which options appear in some applications but not others. Create a brief note documenting how JAWS adapts its available options based on the active application. This demonstrates how JAWS uses both default and application-specific scripts.

:::

Creating Scripts Exercises

The objective of this exercise is to give you some practice adding comments and include statements to your script file. Before you begin this exercise, make sure you only have JAWS and Notepad running. You can press JAWSKEY + F10 to list all of your running applications.

  1. Press JAWSKEY + F2 followed by S and ENTER while Notepad is the active application. This opens The Script Manager with the Notepad.jss file in the edit window.

    Unless you have written any scripts in the Notepad script source file, this file will be empty.

  2. Press CONTROL + HOME to move to the top of the file. This ensures the insertion point is at the top of the script file.

    If the insertion point is already at the top of the file, you may hear a windows system sound.

  3. Type a semicolon (;). This starts a comment line in the script file.

  4. Type the text "JAWS [ version ] Script file for Notepad in Windows X" where X denotes the operating system you are using and version denotes the version of JAWS you are writing scripts for. At the end of this line, press ENTER to move the insertion point to the next line.

  5. Type a semicolon (;) to begin a second comment line in your script file.

  6. Type the text of "Written By" followed by your name and the current date. At the end of this line press ENTER to complete the line and move the insertion point to a new blank line.

  7. Press ENTER twice. This will create a blank line and then move the insertion point to a second blank line after your comment section. This will help separate the comment section from the area where include statements are placed.

  8. Type include "HJConst.jsh" This adds an include statement telling JAWS to include the contents of the HJConst.jsh file within the Notepad script file. Press ENTER to complete the line and move the insertion point to a new blank line.

    When you type the include statement, the file name must be surrounded by quotation marks.

  9. Press CONTROL + W to save your script file without compiling.

After completing the steps above, your Notepad script file should start with the following lines:

; JAWS [ version ] Script file For Notepad in Windows X
; Written by your name On mm/dd/yy
Include "hjconst.jsh"

The text of your name should be replaced with your actual name. The date should also be filled in for the date you are doing this exercise.

Additional Practice: Add a third include statement to your Notepad script file that references a header file. Examine the Script Manager's documentation to understand what HJConst.jsh, common.jsm, and other commonly included files contain. Write comments in your script explaining why you included each file and what major constants or functions you plan to use from each one. This demonstrates understanding of code organization best practices.

The HelloWorld Script

The objective of this exercise is to use the New Script dialog to create your first script. If you have just completed the previous exercise, make sure that Script Manager is the active application. If you have closed the Script Manager, make sure Notepad is still running, switch to Notepad, and follow step 1 in the previous exercise to start the manager.

  1. Press CONTROL + END to move to the bottom of the Notepad script file. This will ensure your new script is created at the bottom of the file below the comments you added in the previous exercise.

  2. Press ENTER twice to create a blank line between the Include statement and your new script.

  3. Press CONTROL + E to display the New Script dialog. The Script Name edit box is active.

    Script names cannot contain spaces or any punctuation marks such as dashes or underlines. The Script Manager will cause a system beep to occur any time you attempt to add any of these characters to your new script name. You should also capitalize the first letter of each word in a multiple word script name.

  4. Press TAB to move to the Can be Attached to Key check box and press SPACEBAR. This step tells JAWS you want to create a script and not a function.

  5. Press TAB to move to the Synopsis edit box. Type "Speaks a message in Notepad" into this edit box without the quotation marks. This text is spoken by JAWS when you ENTER Keyboard Help and press the keystroke that activates this script.

  6. Press TAB to move to the Description edit box. Type "Speaks a hello world message in Notepad." without the quotation marks. The description is heard when you ENTER keyboard help and press the keystroke that activates this script twice in succession.

  7. Press TAB to move to the Category list box. Since this is not used, you do not need to select an item from this list.

  8. Press TAB to move to the Assign To edit box. Be careful as any keystroke you press while in this edit box will be used as the keystroke that activates this script. Press CONTROL + 1 in the numbers row, not the number pad. Since the Ok button is the default button in this dialog, you can press ENTER to close the New Script dialog and return to the Notepad script file.

  9. Press UP ARROW once to move the insertion point to the first blank line in the body of the script. Type the following text:

    SayString ("Hello World!")
    

    The SayString function is no longer used to speak messages with JAWS. This function is obsolete and should only be used for debugging scripts and functions.

  10. After you have typed the line of text above, the insertion point is at the end of the line. Press DOWN ARROW once to move to the next line. You can press DELETE twice to remove the remaining blank lines.

After you have followed the steps above, you should have the following script in your script file:

Script HelloWorld ()
    SayString ("Hello World!")
    EndScript

If your script does not look like the one above, make corrections as needed. You can edit the text of any script just as you would in a word processor or text editor.

Additional Practice: Modify the HelloWorld script to use different JAWS functions. Instead of SayString, try using SayFormattedMessage with different output type constants (such as OT_MESSAGE, OT_STATUS, or OT_ICON). Create several variations of this script, each assigned to different keystrokes, and test each one to observe how JAWS handles different output types and how they affect the user experience.

Compiling and testing the HelloWorld Script

The objective of this exercise is to compile and test the HelloWorld script created in exercise 5.2.

  1. Press CONTROL + S to save and compile the Notepad.jss script file. Did you hear the "Compile Complete" message? If not, go back to the script and check it against the script shown in the previous exercise.

  2. After you have successfully compiled your script file, you are ready to test your new script. Press ALT + TAB to move back to Notepad.

  3. Press CONTROL + 1. Did you hear the message spoken by JAWS?

  4. Press JAWSKEY + 1 to turn on Keyboard Help. You should hear JAWS speak "Keyboard help on" when you are using beginner verbosity. Otherwise, you should hear , "On."

  5. Press the keystroke that activates your script, CONTROL + 1. Did JAWS speak the synopsis of your script?

  6. Press the keystroke, CONTROL + 1, twice in succession. Did JAWS speak the description of your script?

  7. Press JAWSKEY + 1 a second time. You will hear JAWS say "Keyboard help off" when you are using beginner verbosity. Otherwise, you should hear , "Off."

Additional Practice: Create a new script called "TestDifferentOutputTypes" that tests at least three different output type constants with the SayFormattedMessage function. Assign each test to a different keystroke and test them in Notepad. Document your observations about the differences in behavior and when each output type would be most appropriate to use in real-world scripts.

Using the InsertFunction dialog.

The objective of this exercise is to create a new script and insert a function in the body of the script using the InsertFunction dialog. If you are still in Notepad, press ALT + TAB to move back to the Script Manager.

  1. Press CONTROL + END to move to the bottom of the file.

  2. Press ENTER twice to create a new blank line. This blank line separates the new script from the previous HelloWorld script.

  3. Press CONTROL + E to activate the New Script dialog. Your cursor should be located in the Script Name edit box.

  4. Type "SayGreeting" without spaces. Capitalize the S in say and the G in Greeting.

  5. Press TAB to move to the Can be Attached to Key check box and press SPACEBAR to check it. This tells JAWS you are creating a script not a function.

  6. Press TAB to move to the synopsis edit box. Type "Speaks a greeting in Notepad".

  7. Press TAB to move to the description edit box. Type "Speaks a greeting in Notepad using the Say function."

  8. Press TAB to move to the category combo box. As the category is not used, you do not need to make a selection.

  9. Press TAB to move to the Assign To edit box. Press CONTROL simultaneously with the 2 on your numbers row, not the num pad. You should hear JAWS speak "CONTROL + 2." Since the Ok button is the default button in this dialog, press ENTER to close the New Script dialog.

  10. Press UP ARROW once to move to the first blank line in the body of your new script.

  11. Press CONTROL + I to activate the InsertFunction dialog box. The cursor should be located in the Function Name edit box.

  12. Type "Say." JAWS moves the highlight in the Function Name list box of this dialog to the location of the Say function and speaks its description.

  13. Press ENTER to tell JAWS this is the function you want to add to your script. You will then be prompted for the first parameter of the function. This parameter is the string of text that is spoken by JAWS each time you press CONTROL + 2.

    A parameter is information a function uses to perform its task.

  14. Type "Hello world, this is my second script." including the quotation marks. This is the actual message JAWS speaks each time you press CONTROL + 2.

  15. Press ENTER to add the first parameter. You will then be prompted for the second parameter of the Say function.

  16. Type "OT_MESSAGE" in all capital letters. This is a constant value contained within the HJConst.jsh script header file. This parameter tells JAWS what type of message this is and when to speak it.

  17. Press ENTER to accept the second parameter. Press ENTER again to leave the third parameter empty and close the InsertFunction dialog box. You are returned to the script file and the insertion point is at the end of the line containing the function you just inserted.

  18. Press the LEFT ARROW to move the cursor back into the text of the function and you will find a blank space and a comma in between the OT_MESSAGE and the right parenthesis at the end of the function. This happened because we chose to leave the third parameter of the Say function blank. In order for the script to compile properly, you must DELETE. the blank space and the comma in between the OT_MESSAGE and the right parenthesis.

  19. Press DOWN ARROW once to move to the next blank line. Press DELETE. twice to remove the two remaining blank lines. After following the steps above, your script should look like the following:

    Script SayGreeting ()
    Say ("Hello world, this is my second Script", OT\_MESSAGE)
    EndScript
    
  20. Now you are ready to compile the script. Press CONTROL + S to compile the script file. If you don't hear "compile complete", then you may have an error in your script. Go back and review the script. You should make sure your script matches the script shown above. After you have corrected any errors, try compiling the script again.

  21. Once you save and compile your script without any errors, return to Notepad and test your script. Press CONTROL + 2. Did JAWS speak the message?

Additional Practice: Create a new variation of the SayGreeting script that accepts parameters. Use the InsertFunction dialog to add functions that you haven't explored yet, such as InputBox to prompt the user for information, or FormatString to build dynamic messages. Combine multiple functions to create a more complex script that demonstrates your growing understanding of function composition and script logic.



The Script Manager

::: {#overview-of-the-script-manager}

Overview of the Script Manager

:::

The JAWS Script Manager is an application that makes it easier for a JAWS user or developer to write scripts. The Script Manager Looks just like any other Windows application, i.e. it incorporates menus, common keystrokes and various features, such as "find", "find and replace" and "go to". Script Manager also has a status bar which displays such things as the number of lines in your script file.

The fastest way to open the Script Manager is by following these steps:

  • Start any program, like Microsoft Word or Microsoft Internet Explorer;

  • Press JAWSKEY + 0 (on a number row).

JAWS will open the Script Manager application and load a certain file into it. The file that will automatically open is a script file (or script) for the Internet Explorer application.

Another way to open Script Manager is by pressing JAWSKEY + F2, then arrowing down to the "Script Manager" option and pressing ENTER.

If you briefly scroll through the content of the file, you will notice that it has a lot of different statements. Don't worry about their meaning at this point.

The script file consists of one or more scripts or functions. Each script or function consists of one or more statements. A script is a section of the script file that will do something when a user presses a shortcut key assigned to that script by a JAWS script programmer. A function, on the other hand, is a section of the script file that consists of one or more statement, but does not require a shortcut key in order to be executed. Instead, a function uses parameters and return values to communicate with the JAWS program.

::: {#scripts-versus-functions}

Scripts Versus Functions

:::

How do we differentiate between scripts and functions? The scripts are surrounded by the following statements:

Script MyScript ()
; Some statements here
EndScript

Note the use of the left and right parenthesis characters "( )" to indicate the end of many statements.

When writing your code, you can include comments. In fact, including commented text is very helpful particularly if you wish to refresh your memory at a later date when changing your scripts or when collaborating on scripting projects with other people. To include commented text, after typing each line of code type a semi-colon character (";"), then type the text for the comment. In the sample code, you will see some commented text.

Functions, on the other hand, use the following syntax:

Function MyFunction (Parameter1, Parameter2, Parameter3)
; Some statements here
EndFunction

Please note that Parameter1, Parameter2 and Parameter3 are optional. In other words, functions do not always need parameters in order to do something useful.

You can easily move between scripts and functions that are stored in a currently-opened script file by using F2 and SHIFT + F2 keystrokes. Press F2 to move forward through the scripts and functions; press SHIFT + F2 to move backwards. Notice that JAWS will announce the name of the script or of the function as you move through them. Unfortunately, JAWS does not automatically announce whether you are on a script or on a function. You will need to check for this yourself by using SayCurrentLine key or some other reading keystrokes.

Other useful commands in the Script Manager are:

  • To display documentation for your script or function (under the cursor), press CONTROL + D once the cursor is on the first line of the script or function.

  • To display information about a certain JAWS keyword, such as name of the function, place your cursor at the beginning of the keyword and press SHIFT + F1.

  • Press CONTROL + F to search for a string of text

  • Press CONTROL + G to jump to a line number

  • Press CONTROL + H to find and replace one text string with another

  • Press CONTROL + ALT + I to incrementally search the file for a text string.

The last keystroke mentioned is a particularly interesting feature of JAWS Script Manager. It allows you to search for a text string by automatically advancing the cursor through the file as you type. Press CONTROL + ALT + I and type the word "function". You will notice that JAWS composes the match string while you type. This is yet another great way to look for text within Script Manager.

Other useful commands, like inserting a function and deleting a script, you will find in the "help topics" for Script Manager.

Please practice opening script files for various programs, such as Microsoft Word, Microsoft Internet Explorer, Outlook Express etc, and start using the mentioned shortcut keys in your scripting tasks.

if the script manager opens an empty file, this means that the current application (program) does not have any scripts associated with it. :::

{#the-script-manager-user-interface} ### The Script Manager User Interface :::

The following is a brief overview of each menu found in the Script Manager. Only items that are unique to the Script Manager or perform unusual functions are described. Other standard Windows® menu options are noted as "standard function" The shortcut keys for applicable commands are also listed.

::: {#file-menu}

File Menu

:::

::: {#tblr:table4-1} Menu Item Keystroke Description


New CONTROL + N Standard Function Open CONTROL + O This is a standard function. However, you can only open those files that reside in the user settings folder with this command. Open User File None Use this command to open a file that resides in the user settings folder. Open Shared File None Use this command to open a file that resides in the shared settings folder. Open Default File CONTROL + SHIFT + D Use this command to open the default JAWS script file, Default.jss. Close CONTROL + F4 Standard Function Save CONTROL + S This command saves the file, but also compiles and saves a binary .jsb version if you are saving a .jss file. Save As None Standard Function Save As User None Use this command to save and compile a file in the user settings folder. Save As Shared None Use this command to save and compile a file in the shared settings folder. Save Without Compile CONTROL + W This command saves any file, but will not compile a saved .jss file. Synchronize Documentation None Use this command to make sure the script and documentation files concur. Also, when pasting in scripts from another .jss file, this feature copies documentation into the related JSD file. Print CONTROL + P Standard Function Print Preview None Standard Function Print Setup None Standard Function Listing of previously opened files 1,2,3,4 ... This portion of the File menu will list in chronological order approximately four of the Most recently accessed files. Exit ALT + F4

: File Menu --- Script Manager file-menu commands and associated keystrokes and behaviors :::

::: {#edit-menu}

Edit Menu

:::

Most commands in the Edit menu are standard, except for the following:

::: {#tblr:table4-2} Menu Item Keystroke Description


Select Script CONTROL + R Use this command to select the entire script in which the cursor is located. Find CONTROL + F This command opens the Find dialog. Use this dialog to find a text string. Find Next F3 This command is used with the Find dialog and the Incremental Search feature. This command will find the next occurrence of the text string entered in the Find dialog, or, the incremental search feature. Find Prior SHIFT + F3 This command is used with the Find dialog and the Incremental Search feature. This command will find the previous occurrence of the text string entered in either the Find dialog or the incremental search feature. Replace CONTROL + H This command opens the Replace dialog. Use this dialog to find and replace a string of text in the open script file. Incremental Search ALT + CONTROL + I Use Incremental Search to quickly search through a script for a specific string of text. Similar to the Find feature, Incremental Search allows you to incrementally update your search string by allowing you to add letters one at a time.

: Edit Menu --- editing commands in Script Manager including find/replace and incremental search :::

::: {#script-menu}

Script Menu

:::

::: {#tblr:table4-3} Menu Item Keystroke Description


New Script CONTROL + E Use this command to open the New Script dialog for creating a new script or user-defined function. Delete Script CONTROL + DEL Use this command to delete the script where the Insertion point is located. Insert Function Call CONTROL + I Use this command to open the Insert Function dialog where you can add a function to your script. Insert Perform Script CONTROL + SHIFT + I Use this command to open the Insert Perform Script dialog for calling another script. This is similar to calling a function, but it calls another script instead. Next Script F2 Use this command to move the Insertion point to the beginning of the next script in the file. Prior Script SHIFT + F2 Use this command to move the Insertion point to the beginning of the current script or to the beginning of the prior script, depending on the location of the insertion point. Go To Line CONTROL + G Use this command to open the Go To Line dialog where you can enter the line number of the line to which you wish to jump. This command moves the caret to the specified line number. Line numbers are shown in the Script Manager Status Bar. Script List CONTROL + L Use this command to open the Script List dialog where the scripts and user-defined functions in the current file are listed in alphabetical order. Pressing enter on a script name takes you to that script.

: Script Menu --- script creation, insertion, and navigation commands :::

::: {#view-menu}

View Menu

:::

::: {#tblr:table4-4} Menu Item Keystroke Description


Documentation CONTROL + D This command opens the Script Information dialog that contains all of the documentation for the current script. Toolbar NONE Standard function Status Bar NONE Standard function Display Full Path NONE This option is checked if you want to display the full directory path of the script in the edit window of the Script Manager Title Bar. If a new file is opened in the edit window, the Title Bar displays "Untitled". Zoom NONE This command opens the Zoom dialog where you can choose the amount of screen information you want displayed. For example, selecting 200% would magnify the screen two times its normal appearance. Tab Sizes NONE This command opens a submenu containing a list of tab settings from which you can choose the indent distance between tabs in your script.

: View Menu --- display options and developer view features (documentation, toolbar, zoom, tab sizes) :::

::: {#window-menu}

Window Menu

:::

All items in the Window menu perform standard functions.

::: {#help-menu}

Help Menu

:::

::: {#tblr:table4-5} Menu Item Keystroke Description


Help Topics NONE This option opens the list of help topics for Script Manager. Keyword Help SHIFT + F1 Choosing this command presents help information for the script or function on which the cursor is located.

: Help Menu --- access Script Manager help topics and keyword help :::

::: {#the-new-script-dialog}

The New Script Dialog

:::

You can open the New Script dialog using either the New Script item in the Script menu, or, by pressing CONTROL + E. You can open the Script Information dialog using either the Documentation item found in the View menu, or by pressing CONTROL + D. These two dialogs are actually the same, except that the Script Manager displays the New Script dialog when you first create a script, while the Script Manager displays the Script Information dialog when you wish to review documentation for an existing script. We will discuss using the New Script dialog here. However, the information is the same for both.

The New Script dialog is a multi-page dialog and consists of the following two pages:

  • General

  • Parameters

Each is described below. You can press CONTROL + TAB to move between pages.

::: {#general-page}

General Page

:::

The entries in the General page are as follows:

::: {#script-name}

Script Name

:::

You enter the name of your script or function in this edit box. It is helpful to use a name that is descriptive of what action the script performs. You may use several words concatenated together. For example, in MySampleScript, start each word with a capital letter so JAWS will pronounce the name as separate words.

No spaces or punctuation marks are allowed in the name. :::

{#can-be-attached-to-key} ##### Can Be Attached to Key :::

Press the SPACEBAR to check this check box when you want to create a script. If not, you will create a function. Remember that scripts can be attached to keys but functions cannot.

::: {#synopsis}

Synopsis

:::

Type a brief statement of what the script does in this edit box. The synopsis provides valuable information to you and other users when Keyboard help (JAWSKEY + 1) or Key Word help (SHIFT + F1) is accessed. To hear the synopsis, press JAWSKEY + 1 using the 1 on the number row, not the keypad. JAWS says "keyboard help on". Next, press the keystroke combination that calls your script. Keyboard help should say the information placed in the synopsis edit box. You can leave keyboard help mode by pressing JAWSKEY + 1 a second time.

::: {#description}

Description

:::

Enter a more detailed explanation of the action the script performs in this edit box. JAWS speaks the description when you enter Keyboard help (JAWSKEY + 1) or Key Word help(SHIFT + F1) in the Script Manager. The description is accessed by quickly pressing the key combination that calls your script twice after turning Keyboard Help on.

::: {#category}

Category

:::

Although an entry in this edit combo box is not required, you can type in a category name or choose one from the drop down combo box. When you select a category, the Script Manager adds the category to the script documentation file (.jsd). You can use the category to quickly locate all scripts and functions that are of the same category.

::: {#assign-to}

Assign To

:::

This edit box is only available if you checked the Can Be Attached to Key check box. Press the keystroke combination you wish to use for your script. For example, to enter CONTROL + ALT + Z, press and hold the CONTROL and ALT keys while pressing the Z key. If the choice you make is already assigned to another script, the Script Manager displays a warning message, at which time you can continue with the assignment or choose a different keystroke combination.

::: {#function-returns}

Function Returns

:::

This edit combo box is only available if you did not check the Can Be Attached to Key check box. You can type in a Return type or choose one from the drop-down combo box. Among the choices are Handle, Int, Object, String, or Void. Select the type of return that your function is designed to return to the calling script. Select Void if you do not need to use any value returned by the function. The return type appears on the first line of the function before the key word, Function.

::: {#return-description}

Return Description

:::

This edit box is only available if you did not check the Can Be Attached to Key check box. Enter a brief description of the information that is being returned by the function and how the information is to be used. After entering all the necessary information for your new script or function, you can either press CONTROL + TAB to move to the parameters page of this multi-page dialog and enter any parameters for your new function or press ENTER to close the New Script dialog and return to the main Script Manager edit window to begin writing your new script or function.

::: {#parameters-page}

Parameters Page

:::

This page contains information about parameters used by the function. A parameter is data that the function needs in order to accomplish its work. As with variables, the data can be in the form of an Integer, String, Handle, or Object. You will only use the Parameter page when you are creating a function. It is also never used if the function needs no parameters.

::: {#existing-parameters}

Existing Parameters

:::

If parameters already exist for this function, this list box displays them. It will also show parameters as you add them. You can use the arrow keys to select a parameter for subsequent deletion.

::: {#new-parameter}

New Parameter

:::

If you wish to add a parameter, type its name in this field. Follow the same naming conventions you would for naming a new script: start each word with a capital letter and no spaces.

::: {#by-reference}

By Reference

:::

Check this check box to allow a two-way exchange of information from the calling script to the function. Normally, this data transfer is in one direction. This process is known as passing the parameter "by value". In other words, when you call the function from the script, the current value of the parameter is copied and sent to the function. In this situation, once the parameter exchange takes place, if the value of the parameter changes, the script would not be aware of the change. When you check the By Reference check box, a two-way exchange of information takes place. In this situation, the data's memory address passes rather than the value.

::: {#description-1}

Description

:::

Type a brief description of the parameter in this edit box.

::: {#available-types}

Available Types

:::

You should choose Handle, Int, Object, or String from this list box, depending on which type of information this parameter is meant to contain. For example, Handle refers to a window handle.

::: {#add}

Add

:::

Once you have completed the preceding fields, the Add button becomes available. Press SPACEBAR to activate this button to add your new parameter to the Existing Parameters list box.

::: {#remove}

Remove

:::

This button is available if you have highlighted an entry in the Existing Parameters list box. Activating this button with SPACEBAR deletes the highlighted parameter from the list.

::: {#using-the-insert-function-dialog}

Using the Insert Function Dialog

:::

Under the Script menu there are two selections: Insert Function Call and Insert PerformScript. You use These commands to insert functions and to call other scripts from within a script. The Insert Function Call is described below. Use the following steps to Insert a function into your script:

With your script open, choose Insert Function in the Script menu, or press CONTROL + I. This displays the Insert Function dialog. The dialog lists over one thousand functions you can use when creating your scripts.

When the dialog opens JAWS speaks the title, "Insert Function 1". The term Function 1 means that you are at the first level of the dialog. The first field in the dialog is an edit box. If you happen to know the name of your function, you can start typing it in the edit box. The highlight in the alphabetical list automatically moves to the function whose name starts with the letters you type. As soon as you have typed in enough letters to hear the full name of the function for which you are searching, press ENTER to select the function.

If you do not know the name of the function, press TAB to locate the alphabetical list of all the available functions. Type in a few letters that you think might spell the name until you hear the name you want. You can then use the arrow keys to move to the exact function you want.

JAWS speaks the description of the highlighted function each time you press another keystroke. While you are in the Insert Function dialog, you can also TAB to the Description and Returns fields to listen again to information about a selected function. You can also type in function names while you are in the list. The Script Manager will eventually find the function with the correct name.

Press ALT + N to select a function. When you do, one of two things happens:

  • If the function you selected does not require parameters, the Script Manager inserts the function into your script and you will return to the main Script Manager editing window.

  • If the function requires one or more parameters, then JAWS displays a second dialog (Insert Function 1 dialog) and describes the type of parameter that is needed.

For example, if you choose SayAs () as a function, you will need to enter the text or message you wish spoken, specify a variable name, or insert a function.

If you want to insert another function as the parameter for the function you are adding to your script, TAB to the Insert Function button and press SPACEBAR or ALT + I. The Script Manager displays the Insert Function 2 dialog. The only difference between this list and the main list of functions is that only functions the Script Manager thinks are appropriate choices for this parameter are included.

You must either choose a function from this list or type the function name directly into the parameter edit field when it first appears. Press ENTER when you have finished.

Continue with this process until all of the required parameters have been entered. Sometimes you will need to go to a third or higher level; for example, "Insert Function 3", "Insert Function 4", and so on by pressing ALT + I again.

This process of using functions as parameters for other functions is called "nesting". :::

When you have entered all parameters, the Script Manager returns you to the main editing window, and your function with all of its parameters is inserted into your script.

.hint function list in this dialog contains both those functions built into JAWS and functions that have been defined by any users in the current script file. Thus, if you define a new function for the script file, you will see it appear in the function list after you compile it. :::

::: {#using-the-insert-performscript-dialog}

Using the Insert PerformScript Dialog

:::

You can use the Insert PerformScript command to add a line to your script that calls another script. Choose Insert PerformScript in the Script menu, or press CONTROL + SHIFT + I. The Script Manager displays the Insert PerformScript dialog with the cursor placed in a list box that contains all of the available scripts you can call from the script you are writing.

You can select one of these scripts by either using the ARROW KEYS to go through the list of suggested scripts until you locate the script you wish to use, or, by typing the name of the script until JAWS locates it.

Once the correct script has been located, press ENTER on its name. For example, if you selected a script called "SayName" the Script Manager inserts the line shown below:

::: center

PerformScript SayName ()

:::

This line causes the script "SayName" to be executed when your script is run, just as if you had pressed the keystroke yourself. This is one way scripts are reused by other scripts without reproducing the code all over again.

The Script Manager Exercises

The following exercises give you practice in using many of the functions of the Script Manager. The objective of the exercise is listed first.

Navigating Scripts

The objective of this exercise is to gain practice using the Next and Prior script movement commands.

  1. Press JAWSKEY + F2 to display the Run JAWS Managers Dialog.

  2. Press S followed by ENTER. These keystrokes select and run the Script Manager.

  3. After the Script Manager opens, press CONTROL + SHIFT + D to open the default script file.

  4. Press F2 to move through the file a script at a time. Does JAWS automatically speak the name of the script or function?

  5. Press SHIFT + F2 to move to the prior script. Does JAWS continue to speak the name of the script or function automatically?

Additional Practice: Use F2 and SHIFT + F2 to navigate through the default script file and identify at least five scripts that relate to web browsing functionality. For each script, write down its name and briefly describe what you believe its purpose to be based on the name and context. This exercise will help you become familiar with the overall organization of JAWS scripts.

Listing Script and Function Names

The objective of this exercise is to give you experience activating and using the Script List dialog. If the Script Manager is already running, make sure it is the active application.

  1. Press CONTROL + L to display the Scripts List dialog.

  2. Press DOWN ARROW to move down through the list of scripts and functions.

  3. Continue pressing DOWN ARROW until you reach the script titled "AdjustJAWSOptions".

  4. Press ENTER. Did JAWS move to and speak the name of the script?

  5. Press CONTROL + L a second time.

  6. Type "SAY". Did the Script Manager select the first script beginning with say? Press JAWSKEY + UPARROW to verify the name of the script.

  7. Press ESC to close the Scripts List dialog.

Additional Practice: Using the Script List dialog, search for and locate scripts related to a specific feature you use frequently, such as "Move," "Find," or "Read." Open the Script Information dialog for three different scripts and read their complete documentation. This practice will help you understand how JAWS organizes related functionality and prepare you for creating your own organized script files.

Viewing Script Documentation

The objective of this exercise is to give you practice in using the Script Information dialog to view script information. If you have Script Manager running, make sure it is the active application. Press JAWSKEY + T to read the title of the active application. If you do not have Script Manager running, follow steps 1 through 3 in exercise 4.1 to start the Script Manager and open the default script file.

  1. Press CONTROL + L to display the Script List dialog.

  2. Type "SAY" to move to the first script beginning with that text.

  3. Press DOWN ARROW until you reach the script named "SaySystemTime".

  4. Press ENTER to select the script and move to the script within the default script file

  5. Press DOWN ARROW twice to move into the body of the script. This also removes the highlight from the script name.

  6. Press CONTROL + D to display the Script Information dialog.

  7. Review the documentation for the SaySystemTime script. Press TAB and SHIFT + TAB to move through the fields in the Script Information dialog.

  8. Press ESCAPE to close the dialog after you have finished reviewing the information.

Additional Practice: Find and review the documentation for at least three additional scripts in the default script file. Choose scripts that perform functions you use regularly. For each script, note the following: the script name, the keystroke assigned to it (if any), and a brief summary of what it does based on its documentation. This will build your familiarity with existing JAWS functionality and help you avoid creating duplicate scripts when developing your own.



Manipulating Cursors

The cursors used by JAWS are not as important for a regular user of the screen reader, but they are of a great importance for any JAWS Script writer as they add a lot of flexibility to what we can do with the information presented on and off the screen.

There are four cursors used by JAWS:

  • PC Cursor -- a cursor that is synchronized with the physical cursor and keyboard navigation of an active application;

  • JAWS Cursor -- a cursor that simulates mouse navigation, including mouse clicks, scrolling and by-pixel movements;

  • Invisible Cursor -- very similar to JAWS Cursor, however, does not support mouse actions, such as clicks (single and double clicks);

  • Virtual PC Cursor -- a cursor that is primarily used in HTML documents (such as in Internet Explorer).

It is crucial to be aware of the differences between these four cursors during scripting, because they behave differently and may provide you with different information every time you use them. Let's look at each of the cursors one by one.

::: {#pc-cursor}

PC Cursor

:::

When the PC Cursor is active, it will allow you to navigate only within the application window. For example, if you open Microsoft Word, you will only be able to use arrow keys, tab key and other keyboard keystrokes that are supported by Microsoft Word. You will not be able to view the information that is not directly accessible through keyboard, like ruler, toolbars or status line. Of course, you can review the status line with a JAWS keystroke (JAWSKEY + PAGE DOWN), but this is not a native Microsoft Word shortcut key and will not work if you close your screen reader.

Another good example is a window title. If you try to press UP ARROW within a Word Document, or any other application, you will never be able to get to the line that displays the title of the window. This is because applications do not give you direct keyboard access to that information, even though it is readily displayed on the screen. The JAWS keystroke JAWSKEY + T is only specific to JAWS and will not work if you shut down your screen reader.

::: {#jaws-cursor}

JAWS Cursor

:::

A JAWS Cursor, on the other hand, allows you to review the screen regardless of whether the application gives you keyboard access to the information on the screen or not. For example, if you switch to the JAWS cursor while in the Microsoft Word application and start using your arrow keys, you will notice that there is much more information available to you than before. You will find that you can now arrow up all the way to the top of the window and read the title of the application with your usual reading keystrokes (by word, by character etc).

The JAWS Cursor is very useful for JAWS scripters because it allows us to find more information about our application and apply it in our scripts. Let's say we wanted to have a keystroke to read the status line for our application. Our status line, however, is displayed two lines up from the bottom of an active window. We could have written something like this:

Script SpeakStatusLine()
Var
    String sStatusLine
SaveCursor()
JAWSCursor()
RouteJAWSToPC()
JAWSPageDown()
JAWSHome()
PriorLine()
PriorLine()
Let sStatusLine = GetLine()
Say (OT_STATUS, GetLine())
RestoreCursor()
EndScript

Assign your script to a keystroke of your choice and off you go!

You probably have questions about three functions that you have seen in this script: SaveCursor(), RestoreCursor() and RouteJAWSToPC(). The first two functions are especially important to remember because they allow you to tell JAWS to return the user to whatever cursor and location they were using before they switched to the JAWS Cursor. You cannot always assume that they were using PC Cursor before they turned on the JAWS Cursor, can you? SaveCursor(), therefore, tells JAWS to remember the active cursor and RestoreCursor() will return the users back to that cursor. It is always a good idea to use these functions in your scripts whenever you switch between various cursors. Usually you will use SaveCursor() immediately before activating a different cursor and RestoreCursor() once you completed your intended action.

::: {#restricting-jaws-cursor}

Restricting JAWS Cursor

:::

When sighted users review the screen with a mouse, they can position it anywhere on the screen and perform clicks at different points of it. The same can be achieved using the JAWS Cursor.

Because the screen can contain a lot of information from different windows, this could easily confuse a non-sighted person. To deal with this problem JAWS has a concept known as "cursor restrictions". With the JAWS Cursor or Invisible Cursor turned on, we can use JAWSKEY + R to toggle between:

  • Application window restriction -- JAWS Cursor will only be allowed to move within the window of the active application;

  • Current window restriction -- JAWS will only be allowed to move within the boundaries of a current window (note this can be different from an application window);

  • Frame restriction -- the JAWS Cursor will only be allowed to move within the boundaries of the user-defined window/regions, called frames;

  • Unrestricted -- the JAWS Cursor will be allowed to move anywhere on the screen, just like a physical mouse does.

When you script, it is useful that you make sure that your JAWS or Invisible Cursor is at the location where you want it to be. Otherwise, you may be clicking on the wrong button or reading wrong information. The quickest way to check whether your JAWS Cursor follows the PC Cursor is to use the function RouteJAWSToPC().

One last note on the JAWS Cursor. Please remember that when you move the JAWS Cursor in your scripts or with the arrow keys, the actual physical mouse pointer will also move on the screen. This concept will be more clear and make more sense when we discuss the Invisible Cursor below.

::: {#invisible-cursor}

Invisible Cursor

:::

The Invisible Cursor in many ways is identical to the JAWS Cursor. The major difference between the two is that the Invisible Cursor does not allow us to perform mouse clicks. However, all the other reviewing functionality of the JAWS Cursor is also applicable to an invisible cursor. We can also restrict the movements of the Invisible Cursor in exactly the same way we do with the JAWS Cursor (even the keystroke JAWSKEY + R is the same).

You may be wondering about the necessity of having both JAWS Cursor and Invisible Cursor since they act almost identically! Have you heard sighted people say that something changed on the screen as soon as they pointed their mouse at button or a picture? Did you know that some buttons or graphics change their color when the mouse pointer rests on them? Did you know that the shape of the mouse pointer itself can change if the application is doing something? Well, guess what! It can make our life difficult when we try to find the color of the graphic or even to label one for later use in our scripts. This is where Invisible Cursor can become useful.

Let's say that we have an application with a graphic that change its color or characteristics when a mouse pointer is moved over it. We would like to be able to label that graphic. If we use the JAWS Cursor to do this and label the graphic with a mouse pointer on it, JAWS may have problems recognizing that graphic later when the mouse pointer is not positioned on that graphic.

Here is the possible algorithm that we could use to make that graphic recognizable:

  • Turn on the JAWS Cursor

  • Move to the graphic that you would like to label or get an information about

  • Get the information that you need (for example, retrieve the color of the graphic)

  • Switch to Invisible Cursor

  • Route Invisible Cursor to the JAWS Cursor

  • Switch to JAWS Cursor and move your arrow key away from the graphic

  • Switch back to Invisible Cursor and get the information about the graphic again (for example, retrieve its color)

  • Compare the information that you've got before with the information that you obtained with Invisible Cursor and see if there are any differences.

The scenario can get even more complicated if your graphic will look differently after the user clicks on it with a single click or double click.

In basic terms, think of an Invisible Cursor as a copy of the JAWS cursor which is not displayed on the screen but can navigate just like a mouse pointer, but without an ability to perform mouse clicks. Also keep in mind that the JAWS Cursor will follow the movements of a physical mouse, whereas the Invisible Cursor will not.

::: {#virtual-pc-cursor}

Virtual PC Cursor

:::

The Virtual PC Cursor is completely independent of the screen and of any application. The idea behind this type of cursor is to enable JAWS to create its own navigation interface regardless of what is displayed on the screen. Two major examples of the applications where Virtual PC cursor is used are Internet Explorer and JAWS screen sensitive help. Whenever you press JAWSKEY + F1 to see the information about current application screen or shortcut keys, JAWS creates its internal area (known as the Virtual Viewer) that allows you to browse through the information as if you were viewing a regular web page. Try, for instance, to press JAWSKEY + F1 in Microsoft Word application or a document area, and you will find a lot of interesting and useful information about the currently-active document as well as some global settings for Microsoft Word. In addition, notice that in addition to regular text, JAWS is able to display links to other related information to make it look like you are browsing a web page.

::: {#summary}

Summary

:::

In this document we have discussed the four cursors that are available in JAWS: PC Cursor, JAWS Cursor, Invisible Cursor and Virtual PC Cursor. It is important that you understand the purpose of each of these cursors, because they behave differently from each other as well as provide different information about the application and the screen. When scripting, take extra care to make sure that you are in fact using the cursor that you intend to use, otherwise your scripts may report wrong information to the user. Remember to save the active cursor before you switch to a new one (using the SaveCursor() function), so that you can return the user to where they were before your script executed.



Creating Scripts to Read Information from the Screen

Now you know about the four cursors, let's discuss reading information directly from the screen.

You may find a variety of reasons for moving a cursor around a given window. Some applications contain buttons that are only accessible with the mouse or JAWS Cursor. These buttons usually cannot be reached by pressing TAB or through the menu system. You may also encounter applications that place blocks of text in areas of the screen that can only be read using the JAWS Cursor or Invisible Cursor.

Before you create any script that moves a cursor to read information, you should determine the outcome of the script. If you are trying to activate a button within an application window, use cursor movement keystrokes to move the JAWS Cursor or Invisible Cursor to the button. You should keep track of each keystroke you press as you move the appropriate cursor. Each cursor movement command you use has an equivalent built-in function. For example, the built-in function, NextLine, acts just like pressing the DOWN ARROW from your keyboard. It moves the active cursor down one line.

Instead of pressing JAWSKEY + PAGE DOWN to read the bottom line of the screen, use cursor movement commands instead. You can use the JAWS cursor to accomplish this task by following the steps below:

  • Press NUMPAD MINUS (-) to activate the JAWS Cursor.

  • Press JAWSKEY + NUMPAD MINUS (-) to route the JAWS Cursor to the location of the PC Cursor.

  • Press PAGE DOWN to move the JAWS Cursor to the bottom of the window.

  • Press JAWSKEY + UP ARROW to read the current line.

Now you know the steps needed to move the JAWS Cursor to and read the contents of the bottom line of the window. You can take these steps and use built-in functions to accomplish the same task.

You also need to think about which cursor you will use to read or access the information. Are you going to need mouse commands? Or will you only need to read the information? Use the JAWS Cursor when you will need to perform mouse commands such as left or right mouse clicking. Use the Invisible Cursor when you need to read information but do not need to perform mouse commands. You also need to remember not to leave the wrong cursor active when your script finishes. If you are using the invisible cursor to read information on the screen, you don't want to leave that cursor active when your script finishes. Instead, you want to make sure the cursor, which was active before the script is executed, is again activated when the script finishes.

Moving Cursors

After you activate a cursor you should save its location. This ensures that the cursor is restored to the correct position on the screen after your script is executed. For example, when you are using the JAWS Cursor to access a specific button within an application, you want it to stay there because you need to perform a left mouse click. If you write a script that moves the JAWS Cursor without saving it first, then you must move the JAWS Cursor back to the button after your script is finished. Failing to do this within your script results in the wrong cursor activated and in the wrong place.

When you have chosen to use either the JAWS Cursor or Invisible Cursor, you also need to move the cursor to the active application window. This action ensures the cursor you are using to read specific information is in the correct window. This is important as the JAWS Cursor and Invisible Cursor can be anywhere on your screen. So it is always a good idea to move these cursors to the active application. Otherwise, moving the cursor may yield unexpected results.

Saving the Cursor

You use the SaveCursor () built-in function to save the cursor and its location. The SaveCursor () function notes the active cursor and its present location. You can call this function after activating any of the cursors such as the JAWS Cursor. The following block of code illustrates the use of the SaveCursor () function:

JAWSCursor () ; activate the JAWS Cursor
SaveCursor () ; save the JAWS Cursor and its location

You can call the SaveCursor function multiple times in a script, after each cursor you activate. This is called "stacking saved cursors." The following code example illustrates the use of multiple SaveCursor () function calls:

JAWSCursor () ; activate the JAWS Cursor
SaveCursor () ; save the JAWS Cursor and its location
InvisibleCursor () ; activate the Invisible Cursor
SaveCursor () ; save the Invisible Cursor and its location

::: {#restoring-saved-cursors}

Restoring Saved Cursors

:::

After you perform your script and JAWS finds one or more saved cursors, JAWS restores them automatically. When you save multiple cursors, JAWS restores the cursors in reverse order.

You can also use the RestoreCursor () built-in function when you need to restore a specific cursor before your script finishes. This function is useful when you need to save a cursor first, perform an action with that cursor, and restore it before the script finishes.

The following code example illustrates the use of the RestoreCursor () function:

PCCursor () ; activate the PC Cursor
SaveCursor () ; save the PC Cursor
JAWSCursor () ; activate the JAWS Cursor
SaveCursor () ; save the JAWS Cursor
; reading statements go here
RestoreCursor () ; restore the JAWS Cursor

In the above example, the RestoreCursor () function restores the last saved cursor. In this case, the RestoreCursor () function restores the JAWS Cursor since it was the last cursor saved.

Routing the Cursors

The PC Cursor is generally the active cursor in most applications. When you need to access information outside of the boundaries of the PC Cursor, you need to route either the JAWS Cursor or Invisible Cursor to the location of the PC Cursor. When you route either cursor, you have a starting point that you know exists within the active application.

::: {#routing-the-jaws-cursor}

Routing the JAWS Cursor

:::

You use the built-in function, RouteJAWSToPC to move the JAWS Cursor to the location of the PC Cursor. This function repositions the JAWS Cursor to the exact position of the PC Cursor. This function also moves the mouse pointer to the location of the insertion point or selection highlight.

However, this function does not activate the JAWS Cursor. Any cursor movement functions used in your script will move the active cursor instead of the JAWS Cursor. If you want the JAWS Cursor to move you must activate it first. The following code example illustrates the use of the RouteJAWSToPC function:

JAWSCursor ()
SaveCursor ()
RouteJAWSToPC ()

In the above example, the JAWS Cursor is first activated and then saved. The RouteJAWSToPC function moves the JAWS Cursor from its current location to the location of the PC Cursor. At this point, you can use some of the cursor movement functions to move the JAWS Cursor.

::: {#routing-the-invisible-cursor}

Routing the Invisible Cursor

:::

You use the built-in function, RouteInvisibleToPC (), to move the invisible cursor to the location of the PC Cursor. This function repositions the Invisible Cursor to the exact position of the PC Cursor. Unlike the JAWS cursor, the Invisible Cursor is not connected to the mouse pointer, so the function does not move the mouse pointer.

If you want to move the Invisible Cursor you must also activate it first. The following code example illustrates the use of the RouteInvisibleToPC () function:

InvisibleCursor ()
SaveCursor ()
RouteInvisibleToPC ()

In the above example, the Invisible Cursor is activated then saved. The RouteInvisibleToPC () function then moves the Invisible Cursor to the exact location of the PC Cursor. Now that the Invisible Cursor is in the active window, you can use cursor movement commands to read information contained within the current application window.

Moving the Cursor

After you have activated, saved, and moved the JAWS Cursor or Invisible Cursor to the active application window, you can move the cursor. Nearly all of the keyboard commands you use to move the various cursors within JAWS have corresponding built-in functions. For example, pressing DOWN ARROW to move the cursor to the next line has a comparable built-in function of NextLine (). Likewise, pressing RIGHT ARROW has a comparable built-in function of NextCharacter.

When you press DOWN ARROW to read the next line, behind the scenes JAWS activates the SayNextLine () script. The SayNextLine () script does more than just move the cursor down to the next line. The script determines what type of window is active and then reads the information accordingly. :::

{#JAWSPageDown-and-JAWSPageUp} ### JAWSPageDown and JAWSPageUp {#JAWSPageDown-and-JAWSPageUp} :::

The JAWSPageDown and JAWSPageUp built-in functions perform special versions of their respective keyboard commands. You can use these functions when any of the cursors are active. However, the outcome of the function is based on the active cursor.

When the PC Cursor is active, each function performs the standard PAGE UP and PAGE DOWN commands for the application. For example, when you press PAGE DOWN from within a word processor, the PC Cursor is moved down a screen of information. Likewise, when you press PAGE UP from within a word processor, the PC Cursor is moved up one screen of information. The following code example illustrates the use of the JAWSPageDown () function using the PC Cursor:

PCCursor ()
SaveCursor ()
JAWSPageDown ()

In the above example, the PC Cursor is activated and then saved before it is moved. Next, the JAWSPageDown function moves the PC Cursor down one screen of information.

When the JAWS or Invisible Cursor is active, the JAWSPageDown () function moves the cursor to the bottom of the active window based on the cursor restriction setting. Likewise, the JAWSPageUp () function moves the JAWS or Invisible Cursor to the top of the active window based on the restriction setting. The following code example illustrates the use of the JAWSPageDown () function using the Invisible Cursor:

InvisibleCursor ()
SaveCursor ()
RouteInvisibleToPC ()
JAWSPageDown ()

In the above example, the Invisible Cursor is activated and then saved. Next, the RouteInvisibleToPC () function routes the Invisible Cursor to the location of the PC Cursor in the active window. Finally, the JAWSPageDown function moves the Invisible Cursor to the bottom of the active window.

The JAWS restriction setting is set to application by default. This setting keeps the JAWS Cursor and Invisible Cursor within the boundaries of the active application window. You can cycle through the various restriction settings by pressing JAWSKEY + R. See the JAWS help system for more information on cursor restriction settings. :::

{#jawsend-and-jawshome} ### JAWSEnd and JAWSHome :::

The JAWSEnd and JAWSHome built-in functions perform special versions of their respective keyboard commands. Like the JAWSPageDown () and JAWSPageUp () functions, you can use these functions when the PC Cursor, JAWS Cursor, or Invisible Cursor is active. However, the outcome of each function is based on the active cursor.

When the PC Cursor is active, each function performs the standard END and HOME commands for the application. For example, when you press END from within a word processor, the PC Cursor is moved to the end of the current line. Likewise, when you press HOME from within a word processor, the PC Cursor is moved to the beginning of the current line. The following code example illustrates the use of the JAWSHome () function using the PC Cursor:

PCCursor ()
SaveCursor ()
JAWSPageDown ()
JAWSHome ()

In the above example, the PC Cursor is activated, saved, and moved down one screen. The JAWSHome () function then moves the cursor to the beginning of the line. When you execute this block of code, the PC Cursor is limited to the active window.

When either the JAWS or Invisible Cursor is active, the JAWSEnd function moves the cursor to the last text character or graphic on the line within the active window. Likewise, the JAWSHome () function moves the cursor to the first text character or graphic on the current line within the active window. The active window is based on the cursor restriction setting. The following code example illustrates the use of the JAWSHome () function using the Invisible Cursor:

InvisibleCursor ()
SaveCursor ()
RouteInvisibleToPC ()
JAWSPageDown ()
JAWSHome ()

In the above example, the Invisible Cursor is activated, saved, moved to the location of the PC Cursor and moved to the bottom of the screen. Next, the JAWSHome () function moves the Invisible Cursor to the beginning of the current line. By moving the Invisible Cursor to the beginning of the current line, you now have a distinct starting point. You can then use a number of other built-in movement functions to move the Invisible cursor across the line to read a specific piece of information such as a line number.

::: {#next-and-prior-cursor-movement}

Next and Prior Cursor Movement

:::

You can also use built-in functions to move to the next or prior piece of information. Many of these functions also have equivalent keyboard commands like the JAWSEnd (), JAWSHome (), JAWSPageDown (), and JAWSPageUp () functions.

You can use these functions with any of the three cursors. However, the outcome of the function is determined by the active cursor. For example, if you move the JAWS Cursor to the title bar of the active application, you can continually press JAWSKEY + RIGHT ARROW to move across the title bar a word or graphic at a time. When you continually press this keystroke, the JAWS Cursor does not stop at the end of the line. Rather, it continues to move on to the next line until you reach the bottom of the window.

On the other hand, you can only move the PC Cursor within the document edit area of a word processor when you continually press JAWSKEY + RIGHT ARROW. Once you reach the bottom of the document edit window, the PC Cursor can move no further.

When you continually press JAWSKEY + RIGHT ARROW, JAWS activates the SayNextWord script. The script must determine how to read the next word based on the active window. When you use any of the built-in functions to move to the next item, the active cursor is only moved to that item, but, does not speak it. :::

The following list of built-in functions moves the active cursor based on the name of the function. For example, the NextWord() function moves the active cursor to the next word. The NextSentence function moves the active cursor to the next sentence and so on.

  • NextCharacter ()

  • NextLine ()

  • NextParagraph ()

  • NextSentence ()

  • NextWord ()

  • PriorCharacter ()

  • PriorLine ()

  • PriorParagraph ()

  • PriorSentence ()

  • PriorWord ()

The following code example illustrates the use of the NextWord function using the Invisible Cursor:

InvisibleCursor ()
SaveCursor ()
RouteInvisibleToPC ()
JAWSPageDown ()
JAWSHome ()
NextWord ()

In the above example, the Invisible Cursor is activated, saved, and then routed to the location of the PC Cursor. Next, the Invisible Cursor is moved to the bottom of the screen and then to the beginning of the current line. The NextWord function then moves the Invisible Cursor to the next word or graphic on that line.

Speaking the Information

As you learned in the previous section, the movement functions built into JAWS only move the cursor, but do not speak any information. You must use another built-in function to actually speak the information found at the active cursor location.

You can use built-in functions to read the current character, word, line, and more. You can also use built-in functions to read information from the cursor location to either the beginning of the line or the end of the line. You can use the functions listed below to read a specific piece of information. For example, the SayCharacter () function speaks the current character while the SayWord () function speaks the current word. The list of functions follows:

  • SayCharacter ()

  • SayChunk ()

  • SayField ()

  • SayLine ()

  • SayParagraph ()

  • SaySentence ()

  • SayWord ()

The functions listed below all speak information beginning at the location of the active cursor:

  • SayFromCursor ()

  • SayToCursor ()

  • SayToBottom ()

  • SayToPunctuation ()

.hint You can find more information for any of the functions listed above by reviewing the documentation file for functions built into JAWS, builtin.jsd. You can view this file in the Script Manager or in any text editor. You can find this file in the JAWS shared settings folder. Navigate to the JAWS program group in the Start menu and choose Explore JAWS Explore Shared Settings. This opens a Windows Explorer screen where you can find all of the original JAWS script files. :::

Reading Information with Scripts Exercises

These exercises give you some practice in creating scripts that read pieces of information.

Reading the Script Manager Status Line

The objective of this exercise is to use built-in cursor movement and reading functions to read the status line in the Script Manager.

  1. Press JAWSKEY + F2 to activate the Run JAWS Managers dialog.

  2. Press S to select the Script Manager followed by ENTER.

  3. Since this script should work in Script Manager, you need to open the script file for the manager. Choose Open Shared File from the File menu or press ALT + F followed by the letter E.

  4. Type the file name Script Manager and press ENTER. You don't need to include the file extension for script source files, .jss, because this is the default file type.

  5. Press CONTROL + END to move the insertion point to the bottom of the file. Press ENTER to create a blank line between the last script and your new script.

  6. Press CONTROL + E to activate the New Script dialog.

  7. Type "ReadBottomLine" in the Script Name edit box. Be sure to capitalize the first letter of each word in the name of the script.

  8. Press TAB to move to the Can be Attached to Key check box. Press SPACEBAR to check the check box.

  9. Press TAB to move to the Synopsis edit box. Type "Reads the status line in the Script Manager" without the quotation marks.

  10. Press TAB to move to the Description edit box. Type "Reads the status line in Script Manager using various cursor movement and reading functions" without the quotation marks.

  11. Press TAB to move to the Category edit combo box. You do not need to ENTER any information in this combo box as it is not used.

  12. Press TAB to the Assign to Key edit box. Press CONTROL + SHIFT + L. This is the keystroke that activates the script.

  13. Press ENTER to close the New Script dialog and return to the Script Manager window.

  14. Press UP ARROW once to move to the first blank line of the ReadBottomLine script.

  15. Press CONTROL + I to activate the InsertFunction dialog. You are looking for the function to save the current cursor. Type Save in the Function Name edit box. Did JAWS find the SaveCursor function? If so, then press ENTER to insert the function into your script and close the InsertFunction dialog.

  16. After you have inserted the SaveCursor function into your script, the insertion point is at the end of the line. Press ENTER to move to the next line.

  17. Press CONTROL + Ito activate the InsertFunction dialog. You now need to locate the InvisibleCursor function. This will activate the Invisible cursor which you will use to read the status line of the window. Find the InvisibleCursor function and press ENTER to insert it.

  18. Press ENTER to complete the line and move to a new blank line.

  19. Follow the same procedure found in step 17 to insert the following functions into your script: RouteInvisibleToPC JAWSPageDown SayLine

  20. After following these steps, the script should look like the following:

    Script ReadBottomLine ()
    SaveCursor ()
    InvisibleCursor ()
    SaveCursor ()
    RouteInvisibleToPC ()
    JAWSPageDown ()
    SayLine ()
    EndScript
    
  21. If your script looks like the one above, press CONTROL + S to save and compile the script file. Did you hear the compile complete message? If so, then you are ready to test the new script. If not, then go back to the script and make sure it looks like the one above then compile your script file a second time.

  22. Press CONTROL + SHIFT + L to test your script. Did you hear the status line of the Script Manager spoken by JAWS?

Additional Practice: Explore what other cursor movement and reading functions are available in the FSDN documentation. Create a script that reads a specific section of the Script Manager window, such as the script name list or the script body text. This will require you to understand window structure and cursor positioning, essential skills for advanced scripting.

Read the Line Number and Total Lines in the Script Manager Status Line

The objective of this exercise is to create a script that reads only the line number and total number of lines within the status line. In the previous exercise, you created a script that read the entire Script Manager status line. Create a script that only speaks the line number and total number of lines in the script file. On the script manager status line there is more information than you necessarily want to hear, for example, "For help, F1". Your script should only say what you want to hear, which is the word "line" followed by the total number of actual lines in the script file. If the Script Manager is not the active application, press ALT + TAB until the Script Manager becomes the active window. The Script Manager.jss script file should also be opened within the manager. You can verify the file name by reading the title of the window with JAWSKEY + T. Before you create the script, follow the steps below to determine what functions are needed:

  1. Press NUM PAD MINUS. twice in succession to activate the Invisible cursor.

  2. Press JAWSKEY + NUM PAD MINUS to route the Invisible cursor to the PC cursor location.

  3. Press PAGE DOWN. to move the Invisible cursor to the bottom of the window.

  4. Press HOME. to make sure the Invisible cursor is at the beginning of the status line.

  5. Press JAWSKEY + RIGHTARROW until JAWS speaks "Line:".

  6. Press JAWSKEY + PAGE UP to read from the location of the Invisible cursor to the end of the line.

After you followed the steps above, did JAWS speak the line number and total number of lines? Your new script should also read only the line number and total number of lines within the current script file. The steps needed to create the script follow:

  1. Press CONTROL + END to move to the bottom of the script file.

  2. Press ENTER twice to insert a blank line between the last script and your new script.

  3. Press CONTROL + E to activate the New Script dialog.

  4. Fill in the script information fields as follows:

    1. Script Name: ReadLineNumber

    2. Can be Attached to Key: checked

    3. Synopsis: Reads the line number and total number of lines.

    4. Description: Reads the line number and total number of lines from the status line.

    5. Category: not used

    6. Assign To: CONTROL + SHIFT + S

  5. After you have entered all the script information, press ENTER to close the New Script dialog and return to the Script Manager edit area.

  6. Press UP ARROW once to move to the first blank line in the body of the script.

  7. Use the InsertFunction dialog, activated by CONTROL + I, to insert the following functions into your script:

    1. SaveCursor ()

    2. InvisibleCursor ()

    3. SaveCursor ()

    4. RouteInvisibleToPC ()

    5. JAWSPageDown ()

    6. JAWSHome ()

    7. NextWord ()

    8. NextWord ()

    9. NextWord ()

    10. NextWord ()

    11. NextWord ()

    12. SayFromCursor ()

    You should press ENTER after each function is inserted into your script. Failure to do so, causes each of the functions to be inserted on the same line.

  8. After you have followed all the steps above, your script should look like the following:

    Script ReadLineNumber ()
    SaveCursor ()
    InvisibleCursor ()
    SaveCursor ()
    RouteInvisibleToPC ()
    JAWSPageDown ()
    JAWSHome ()
    NextWord ()
    NextWord ()
    NextWord ()
    NextWord ()
    NextWord ()
    SayFromCursor ()
    EndScript
    

After you have completed the steps above, Compare your script to the script shown above. Make any corrections to your script as necessary.

When correcting your script, you can use normal editing techniques just as you would in a word processor or text editor.

  1. Now that you have reviewed your script, press CONTROL + S to save and compile your script. Did you hear the compile complete message? If so, then you are ready to test your script. If not, then note the error shown in the Error dialog. Next, press ESCAPE. to close the Error dialog and return to your script. Review your script for the error and correct it. You can refer back to the script shown above, if necessary.

  2. Once you have a complete compile, press CONTROL + SHIFT + S to activate your script. Did you only hear the line number and total number of lines spoken by JAWS?

Additional Practice: Modify this script to read different portions of the Script Manager status line, such as the column number, word count, or other available information. Experiment with different combinations of cursor movement functions to extract and speak precise information. This demonstrates how scripting can provide customized access to application information.



Constants and Variables

Variables

A variable is an entity that holds a value that can change during script processing. Each variable is of a specific type. JAWS stores the value of a variable in memory and can be used by script code whenever needed. You must declare variables with a name and a type before they can be used. You must give each variable a distinct name to distinguish it from other functions and names used in the script or script file. Using duplicate variable names within scripts or script files will cause compile or execution problems.

You can declare variables either locally, or, globally. Variable types include: handle, integer, object, and string.

Variable Types

You can use one of four variable types within your scripts and functions. You store only one specific type of information in each of these variable types.

Variable types include:

  • Integer

  • String

  • Handle

  • Object

::: {#integer-variables}

Integer Variables

:::

You use the integer variable type to store an integer or whole number. A whole number does not contain a decimal point. The default value of an integer variable is always 0. You must declare an integer variable before it can be used. You declare an integer as follows:

Var
    Int iMyIntegerVariable

::: {#string-variables}

String Variables

:::

You use the string variable type to store a string of characters. A string is a group of characters including letters, numbers, punctuation marks, and spaces. When you assign a value to a string variable, you must enclose the string value in quotation marks. The default value of a string variable is always null or no characters. You can indicate the value of Null by two quotation marks with no space between them. You must declare a string variable before it can be used. You declare a string variable as follows:

Var
    String sMyStringVariable

::: {#handle-variables}

Handle Variables

:::

You use the Handle variable type to store a window handle. A window Handle is a unique number assigned by the system to each window in a currently running program. A Handle is also a whole number and can be manipulated like other integer variables. However, the use of a Handle variable is reserved solely for the identification of a window handle. The default value of a Handle variable is always zero. You must declare a Handle variable before it can be used. You declare a Handle variable as follows:

Var
    Handle hMyHandleVariable

::: {#object-variables}

Object Variables

:::

You use the object variable type to store an object. An object refers to the types of objects used within certain Microsoft® applications such as the Office suite. The default value of an object variable is always null or empty. You must declare an object variable before it can be used. You declare an object variable as follows:

Var
    Object oMyObjectVariable

Naming Variables

As you begin to use variables within your scripts, there are a few ways you can name them to easily identify their contents. When you use multiple words for variable names, be sure to capitalize each letter. This will make for better pronunciation of the variables by JAWS. It is also a good idea to give your variables meaningful names. Giving a string variable the name of "i" does not indicate the string information stored in the variable. You can also use Hungarian notation to name your variables.

Var
    Int iAverageTemperatureForUtahLastWeek ; Too long: hard to read and pronounce
    Int iT; Too short: meaningless, unclear purpose
    Int iTemp ; Pointless/generic name: doesn't convey intent or scope
    Int iMeanTemperature ; Good: type prefix + descriptive, concise purpose

Hungarian notation uses lower case letters at the beginning of variable names to indicate the variable type. For example, you could name a string variable that contains a window name sWindowName. The lower case "s" indicates the variable is of type string. The "WindowName" portion of the variable name indicates the variable will contain a window name. Some examples of variable names follow:

  • iVersion ("i" for integer type)

  • sCellText ("s" for string type)

  • hRealWindow ("h" for Handle type)

  • oDocument ("o" for object type)

Local Variables

You can declare variables locally within a script in the first statement after the Script start statement. You use the key word, Var, to indicate the start of the local variable declaration. Each variable declaration is placed on a separate line. When you declare multiple variables, you follow each variable name with a comma except for the last variable in the list.

When you declare variables locally, you can only use them within the script or user-defined function in which they are declared. Once JAWS performs your script or user-defined function, all local variables lose their values.

An example of a local variable declaration follows:

Var
    Handle hWnd, ; stores window Handle
    Int iIsJavaWindow,
    Int iTheTypeCode,; window sub type code
    Int iMenuMode ; stores value of menu

Global Variables

You declare global variables at the beginning of a script file outside of any script or user-defined function. You place global variable declarations immediately following any include statements. You indicate the start of the global variable declaration with the key word, Globals. Each variable declaration is placed on a separate line. When you declare multiple global variables, you follow the name of each variable with a comma except for the last variable in the list.

A good idea is to add a comment at the end of the declaration stating how the variable is used. After you declare and assign a value to a global variable, that value remains in memory even after you close the application that uses it. If you start the application during the same computer session, the global variables from that application's script file retain the same values they had prior to the application being closed. You can initialize the values of global variables programmatically or by unloading and restarting JAWS.

An example of a global variable declaration follows:

Globals
    Handle GlobalPrevFocus, ; Handle of previous focus window
    Handle GlobalPrevReal, ; Handle of previous real window
    String GlobalPrevRealName, ; name of previous real window
    Handle GlobalPrevApp, ; Handle of previous application
    Handle GlobalFocusWindow, ; temp variable To pass a window

You can also declare global variables in a JAWS script header file. You give a header file the file extension of .jsh and create the file in the Script Manager. You can find an example of a header file containing global variable declarations in the HJGlobal.jsh header file. The HJGlobal file is included in the Default.jss script file. Including the HJGlobal.jsh header file in a default script file allows the global variables to be used in any of the default scripts and user-defined functions. When you include the HJGlobal.jsh file in an application-specific script file, you can use these variables to get specific information as needed. Care should be taken when using any global variables from the HJGlobal.jsh file. The default scripts and user-defined functions often modify the values contained in these variables and may produce unwanted results in your script file.

Assigning Values to Variables

You use the let statement to assign values to any one of the 4 variable types. For example, "Let iControl = 1500" assigns the value of 1500 to the variable, iControl. If you fail to use the let statement to assign a value to a variable, the script compiler will generate a syntax error.

Some examples of let statements follow:

Let sDialogPageName = GetDialogPageName ()
Let iCount = 1
Let sWindowName = "Options"
Let hWnd = GetFocus ()

Constants

Constants do not change value. Constants are a way of using easily remembered names to store hard to remember strings of letters or numbers. Think of a constant as a number or group of letters or words that has been given or assigned a new name. This is done purely for mnemonic reasons since it is easier to remember a name than a number or long group of letters or words. There are no restrictions to how many constant names you can assign to a number. For example, in the default JAWS constants file,HJConst.jsh, both of the constants True and On are assigned the value of one. This means that you can write a script statement to check if a condition equals TRUE, ON, or 1. They are all considered to be the same value once the constant declarations have been made. The use of constants is strongly recommended because its more difficult to remember that when something is true, its state is one, but easy to understand the difference between TRUE and FALSE. Moreover, when someone else is reading your script file, it's much easier for the person to understand what you were trying to do if they see well-named constants instead of numbers. Finally, if you need to change the value of a number that is used in several places, you can change all of them at once if you have used a constant to represent that number by simply changing the value of the constant declaration.

You declare constants at the beginning of a script file. You indicate the beginning of a constant declaration section with the key word, Const. When declaring multiple constants, each constant name must be followed by a comma except for the last constant in the list.

An example of a constant declaration follows:

Const
    True = 1,
    False = 0,
    On = 1,
    Off = 0

You may decide to define your own constants for a script file. You may also use those that are already declared in HJConst.jsh. If you decide to use either file or both, you must remember to include the header file or files.

The Include and Use Statements

You use the Include statement to tell JAWS to include the contents of a header or message file in a script file when you compile that script source file (jss). When you compile the .jss file creating the binary file (.jsb), all of the information in the included files is compiled into the resulting .jsb file.

You must include the file name and extension of the file to be included and enclose the entire name in quotation marks.

An example of an include statement follows:

Include "HJConst.jsh" ; default JAWS constants

The statement above tells the compiler that the file called HJConst.jsh, is to be included as part of the current script file. The optional comment provides information about the file being included. The file to be included must be contained within the language (ENU) sub-folder of the shared or user Settings folder for the specific version of JAWS you are using.

The use statement creates a link between the named binary file and the script source file in which the use statement is contained. The main difference between the Use statement and include statement is that the Use statement does not add more code to the script binary file.

An example of a Use statement follows:

Use "utilities.jsb" ; utility functions

The file name, including file extension, to be used is enclosed in quotation marks. The statement tells the script compiler that the Utilities.jsb file is to be linked to the script file in which the use statement is contained. The comment provides information about the file being used. This comment is optional. The binary file to be used must be contained within the language (ENU) folder of either the shared or user settings folder for the version of JAWS you are using.



Flow Cotrol

Flow-control diagrams

graph TD
    subgraph SEQ["Sequential Process"]
        S1["Start"]
        S2["Step 1"]
        S3["Step 2"]
        S4["End"]
        S1 --> S2 --> S3 --> S4
    end
    
    subgraph IFTHEN["If-Then"]
        IF1{If}
        THEN1["Then"]
        ENDIF1["EndIf"]
        IF1 -->|Y| THEN1
        THEN1 --> ENDIF1
        IF1 -->|N| ENDIF1
    end
    
    subgraph IFELSE["If-Else"]
        IF2{If}
        THEN2["Then Do X"]
        ELSE2["Else"]
        THEN21["Then Do Y"]
        ENDIF2["EndIf"]
        IF2 -->|Y| THEN2
        IF2 -->|N| ELSE2
        ELSE2 --> THEN21
        THEN2 --> ENDIF2
        THEN21 --> ENDIF2
    end
    
    subgraph IFELIF["If-ElIf-Else"]
        IF3{If}
        ELIF1{ElIf}
        ELIF2{ElIf...}
        ELSE3["Else"]
        THENA["Then Do A"]
        THENB["Then Do B"]
        THENC["Then Do..."]
        THEND["Then Do Z"]
        ENDIF3["EndIf"]
        IF3 -->|Y| THENA
        IF3 -->|N| ELIF1
        ELIF1 -->|Y| THENB
        ELIF1 -->|N| ELIF2
        ELIF2 -->|Y| THENC
        ELIF2 -->|N| ELSE3
        ELSE3 --> THEND
        THENA --> ENDIF3
        THENB --> ENDIF3
        THENC --> ENDIF3
        THEND --> ENDIF3
    end
    
    subgraph WHILE["While Loop"]
        W1{While}
        D1["Do"]
        EW["EndWhile"]
        W1 -->|Y| D1
        D1 --> EW
        D1 -->|Loop Back| W1
        W1 -->|N| EW
    end

JAWS does not always perform scripts in a sequential or top to bottom manner, with each line being performed in order and only once. You may find it necessary to perform a series of statements several times within a script. You may also find it necessary to skip statements in a script based on the outcome of a condition being evaluated. These types of statements control the flow, or sequence of events, in a script or function. A script or function can contain any or all of these techniques.

Sequential

Sequential flow is the most basic type of flow control. In a sequential statement structure, JAWS performs each statement sequentially beginning with the first statement in the script and continuing to the EndScript statement.

The following script is an example of sequential flow. You can find this script in the Default.jss script file. The script selects text from the beginning of the line to the cursor. The code of the script follows:

Script SelectFromStartOfLine()
Let nSaySelectAfter = False
SelectingText(True)
SelectFromStartOfLine ()
SelectingText(False)
EndScript

JAWS performs the script above each time you press SHIFT + HOME to select the text from the cursor to the beginning of the line. JAWS performs each statement in the script only once.

Selection, Conditional, or Decision Making

In this type of statement structure, JAWS evaluates one or more conditions before processing continues. The flow of the script is then based on the outcome of the condition being evaluated. This process is often referred to as branching. Think of walking down a path and coming to a fork in that path. Before you continue, you must decide which path is the best way to continue. Your script can do the same thing. As JAWS processes your script sequentially, there may be a poInt in the script where a decision must be made. The statements JAWS processes next are based on the outcome of that decision.

::: {#the-if-then-statement}

The If Then Statement

:::

You can use the If Then statement structure to select which path in your script is taken if the preceding statement is true. You must include the If, Then, and EndIf key words in all If statement structures. You place the condition to be evaluated between the If and Then key words. When JAWS evaluates the condition and finds it to be true, JAWS performs any statements following the If statement.

An example of a basic If statement follows:

If DialogActive () == True Then
    SayFormattedMessage (OT_MESSAGE, "A dialog box is active") ; The condition evaluates To True
EndIf

In the above example, JAWS can only take one path based on the outcome of the condition being evaluated in the If statement. When a dialog box is active, then JAWS performs the SayFormattedMessage () function and speaks "A dialog box is active." When the condition being evaluated is false, then JAWS does not perform the SayFormattedMessage () function and processing continues with any statements that follow the EndIf key word.

::: {#the-else-and-elif-statements}

The Else and ElIf Statements

:::

You can use two optional statements in an If Then structure. You can use the Else key word to provide an alternate path. When the condition specified in the preceding If statement is found to be false, then JAWS performs the statements following the Else key word. Thus, you can account for both true and false conditions in your If statement. An example of an If Then-Else statement follows:

If DialogActive () == True Then
    SayFormattedMessage (OT_MESSAGE, "A dialog box is active") ; the condition evaluates To True
Else
    SayFormattedMessage (OT_MESSAGE, "No dialog box is active") ; the condition evaluates To False
EndIf

In the above example, the If statement determines if a dialog box is active. When the If statement is true, JAWS performs the SayFormattedMessage () function following the If statement and speaks "A dialog box is active." If a dialog box is not active, then JAWS performs the SayFormattedMessage () function following the Else key word and speaks "No dialog box is active."

You can use the ElIf statement as a secondary way of formulating a branch. The ElIf statement can take the place of an Else statement. You can also use the ElIf statement in addition to the Else key word. You can use as many ElIf statements as needed in your scripts. However, when you use the ElIf statement in addition to the Else key word, those ElIf statements must precede the Else statement.

Two examples of the uses of the ElIf statement within an

If Then-Else-EndIf statement follow:

If DialogActive () == True Then
    SayFormattedMessage (OT_MESSAGE, "A dialog box is active")
ElIf DialogActive () == False Then
    SayFormattedMessage (OT_MESSAGE, "No dialog box is active")
EndIf

The above example uses an ElIf statement in the place of the Else key word. The If statement determines if a dialog box is active. When the If statement is true, JAWS performs the SayFormattedMessage ()function following the If statement and speaks "A dialog box is active." When the If statement is false, JAWS performs the ElIf statement that determines if there is no active dialog box. If the ElIf statement is true, then JAWS performs the SayFormattedMessage ()function following the ElIf statement and speaks "No dialog box is active." Since there are only two possibilities, JAWS must perform either the SayFormattedMessage () statement that follows the If statement or the SayFormattedMessage () statement that follows the ElIf statement.

The following example illustrates the use of an ElIf statement in conjunction with an Else statement:

If DialogActive () == True Then
    SayFormattedMessage (OT_MESSAGE, "A dialog box is active")
ElIf MenusActive () == ACTIVE Then
    SayFormattedMessage (OT_MESSAGE, "A menu is active")
Else
    SayFormattedMessage (OT_MESSAGE, "No dialog box or menu is active")
EndIf

The above example uses an ELIF statement in addition to the Else key word in the If Then statement structure. The initial If statement determines if a dialog box is active. If a dialog box is active, then JAWS performs the SayFormattedMessage () function following the If statement and speaks "A dialog box is active." If a dialog box is not active, then JAWS performs the ELIF statement that determines if a menu is active. If the ELIF statement is true, JAWS performs the SayFormattedMessage () function following the ELIF statement and speaks "A menu is active." However, if no menu is found to be active, then JAWS performs the SayFormattedMessage () function following the Else key word and speaks "No dialog or menu is active."

::: {#nested-if-statements}

Nested If statements

:::

You can place or nest an If statement inside of another If statement. Nesting If statements allows you to check for a condition only when another condition exists. JAWS evaluates the nested If statement only when the first condition is true. JAWS performs the sequence of statements within the nested If Then statement only if both conditions are found to be true. An example of the use of nested If statements follows:

If DialogActive () Then ; determine If a dialog box is active
    Let sWindowName = GetWindowName (GetRealWindow (GetFocus ())); retrieve the window name For the active dialog
    If sWindowName == "Open" Then ; the Open file dialog is active
        SayFormattedMessage (OT_MESSAGE, "The Open File dialog is active")
    Else
        SayFormattedMessage (OT_MESSAGE, "A dialog box other than the Open File dialog is active.")
    EndIf
Else
    SayFormattedMessage (OT_MESSAGE, "No dialog box is active")
EndIf

In the above example, the first If statement determines if a dialog box is active or being displayed. When the If statement is true, JAWS performs the let statement and retrieves theinuing to the EndScript statement. window name for the active dialog. Next, the nested If statement uses the window name to determine if the Open File dialog is active. If the nested If statement is true, then JAWS performs the SayFormattedMessage () function following the nested If statement and speaks "The Open File dialog is active." If a dialog box other than the Open File dialog is active, then the nested If statement is false and JAWS performs the SayFormattedMessage () function following the else key word and speaks "A dialog other than the Open File dialog is active."

If JAWS determines no dialog box is active, then JAWS performs the SayFormattedMessage () function following the Else key word in the outer If statement following the Else key word and speaks "No dialog box is active."

Iterative or Looping

The third type of flow control you can use in your scripts is called iterative or looping. You use the iterative statement structure to perform the same statement or group of statements repeatedly while a condition is true. You use a loop to perform a sequence of statements several times, thus shortening the number of statements required. Looping provides a way to determine the number of repetitions automatically, depending on conclusions derived from script operation.

::: {#the-while-endwhile-statement-structure}

The While-EndWhile Statement Structure

:::

You perform looping in your scripts by using the While-Endwhile statements structure. A While Loop is a statement structure that repeats or loops WHILE a condition is true.

A While loop consists of two parts:

  • The While statement which sets the condition to be tested for

  • EndWhile statement that terminates the loop.

JAWS performs all statements within the boundaries of the While and EndWhile statements repeatedly until the condition in the While statement becomes false. An example of a While-EndWhile loop structure follows:

While Variable1 < 5 ; this condition will cause the loop To be performed 4 times
    ; Statements To be performed go here
    Let Variable1 = Variable1 + 1 ; increment the value of Variable1 by 1   with each step
EndWhile

In the above example, JAWS performs the While loop while Variable1 is less than 5. Once the value of Variable1 becomes equal to 5, the loop ends and no further processing occurs.

A loop continues until a condition becomes false. You must be careful not to set up a loop with a condition that will never become false. To do so would create an infinite loop, which will cycle forever, and lock up the computer until the program is terminated manually. Think carefully about the condition meant to terminate the loop to be sure it will become false at some time. If you find that the computer seems to lock up after you execute a new script with a While loop in it, this is probably what is happening. :::

{#avoiding-infinite-loops} ### Avoiding Infinite Loops :::

When you create an iterative flow sequence in a script using a While loop, care should be taken not to create an infinite loop that results in a locked computer. Since a loop continues until a condition becomes false, you must be certain that the condition being tested can actually become false. One way you can avoid this problem is to include statements designed to break the loop after a certain number of repetitions. An example of this follows:

Var
    Int iSafety
Let iSafety = 1
While iSafety < 10
    NextLine ()
    If GetLine () == "%1" Then
        Let iSafety = 10 ; cause the loop To terminate
    EndIf
    Let iSafety = iSafety + 1 ; increment the value of the iSafety variable
EndWhile

In the above example, JAWS performs the loop while the value of iSafety is less than 10. Each time JAWS performs the loop, JAWS performs the NextLin () function to move to the next line. The If statement determines if the text at the location of the active cursor is that of "Save As ..." When the If statement is found to be true, the iSafety is given the value of 10. This makes the While statement false and the loop terminates. When the If statement is false, then the value of iSafety is incremented by 1.

When the value of iSafety becomes equal to 10, JAWS terminates the loop as iSafety is no longer less than 10.

A second example of a while loop follows:

While (hPos); perform the While loop While the value of hPos is Not zero once the value of hPos becomes zero, Then the loop terminates
    ; While statement could also be written as While hPos! = 0
    If IsWindowVisible (hPos) Then ; determine If the window referenced by hPos is visible
        SpeakWindowInformation (hPos)
    EndIf
    Let hPos = GetNextWindow (hPos) ; retrieve the Handle For the next window
EndWhile

In the above example, JAWS performs the loop while the value of the handle variable, hPos, is not equal to zero. Within the loop, JAWS determines if the window referenced by hPos is visible. If the window is visible, then JAWS speaks information about the window. Next, the GetNextWindo () function retrieves the handle for the next window. If the GetNextWindo () function does not actually find a next window, then th () function places zero in the hPos variable. When the hPos variable contains zero, the condition being evaluated in the While statement is no longer true as the value of the variable is now zero. This terminates the While loop.

Compound Statements

You can create compound statements using both If Then-EndIf and While-EndWhile statement structures. A compound statement can determine if 2 conditions are both true. A compound statement may also determine if one of two conditions are true.

::: {#compound-statements-using-and}

Compound Statements Using AND

:::

When you join 2 statements together using the && operators, the statement is said to be a "and" compound statement. In this type of compound statement, both conditions must be true before the entire If Then or While statement are true. If either one of the conditions being evaluated is false, the entire If Then or While statement is then considered to be false. You use two & symbols to indicate a compound statement where both sides must be true. An example of the use of the && symbols in an If Then statement follow:

Let sWindowName = GetWindowName (GetRealWindow (GetFocus ())) ; retrieve the name of the active window
If DialogActive () && sWindowName == "%1" Then
    Say ("%1", OT_MESSAGE)
EndIf

In the above example, the compound If statement determines if the active dialog box is the Open File dialog. The first part of the If statement determines if a dialog box is active. The second part of the If statement determines if the name of the active dialog is that of the Open File dialog. If both conditions of the If statement are true, then JAWS performs the Say statement following the If statement and speaks "The Open File dialog is active."

When there is no active dialog, the first condition is false making the entire If statement false. Likewise, if the name of the active dialog is something other than that of "Open", then the second condition is false making the entire If statement false. In either case, JAWS does not perform the Say statement following the If statement.

::: {#compound-statements-using-or}

Compound Statements Using OR

:::

When two statements are joined together using the operators, the statement is said to be a "or" compound statement. In this type of compound statement, either condition can be true for the entire If Then or While statement to be true. However, both statements do not have to be true to make the entire If Then or While statement true.

You use the symbol to indicate a compound statement where either side must be true. An example of the use of the symbols in an If Then statement follow:

If iValue < 5 || iValue 10 Then
    Say ("%1", OT_MESSAGE)
EndIf

In the above statement, either sides of the can be true for the entire If statement to be considered true. Therefore, the value of the iValue variable can be less than 5 or it can be greater than 10. A value of 4 in the iValue variable would make the entire statement true as the iValue < 5 statement is true.

Logical Operators

You use logical operators to compare variables to other variables or constants. You frequently need to know if one variable has the same value, a lesser value, or a greater value than another variable. Sometimes you must compare several items or groups of items with other items. The logical operators are usually used within If Then and While loops to check whether conditions required for logical decisions are true or false. A list of the JAWS logical operators is shown below.

OptionDescription
==Two equals signs together in this manner ask whether the first condition is "equal to" the second condition. That is, is the expression to the left of the two equals signs equivalent to the expression on the right side. For example, the expression (A == B) asks whether A equals B.
!=An exclamation point and an equals sign together in this manner ask whether the first condition is "not equal to" the second condition. That is, is the expression to the left of the exclamation point and equals sign different from the expression on the right side? For example, the expression (A != B) is true if A does not equal B.
<A < sign asks whether the first condition is "less than" the second condition. That is, is the expression to the left of the < sign less than the expression to the right side? Thus, the expression (A < B) is true if A is less than B.
<=A < sign followed by an equals sign asks whether the first condition is "less than or equal to" the second condition. That is, is the expression to the left of the <= signs less than or equal to the expression to the right side. Thus, the expression (A <= B) is true if A is less than or equal to B.
>A > sign asks whether the first condition is "greater than" the second condition. That is, is the expression to the left of the > sign greater than the expression to the right side. Thus, the expression (A > B) is true if A is greater than B.
>=A > sign followed by an equals sign asks whether the first condition is "greater than or equal to" the second condition. That is, is the expression to the left of the >= signs greater than or equal to the expression to the right side. Thus, the expression (A >= B) is true if A is greater than or equal to B.
&&This operator is placed between two logical comparisons made using logical operators such as the ones described above. It asks whether the first condition is true "and additionally" is the second condition true. The total expression is evaluated as true only if the comparisons on both sides of the && operator are true. Thus, in the expression (A == B) && (C != D), a value of true is only returned if A does equal B and C does not equal D.
||This operator is placed between two logical comparisons made using logical operators such as the ones described above. It asks whether either the first condition is true or whether the second condition is true. The total expression is evaluated as true if either of the comparisons on either side of the operator is true. Thus, in the example (A == B) || (C == D), a value of true is returned if either A equals B or C equals D. Of course, a value of true would also be returned if both expressions were true.

Controlling the Flow of Scripts Exercises

The following exercises will give you practice in creating If-Then statements.

Using the If statement to Check for User Verbosity

The following script for Notepad uses an If statement to determine which user verbosity level is active and speaks an appropriate message. You will need to use the GetVerbosity function to determine the current verbosity level. The GetVerbosity function returns the constant BEGINNER, INTERMEDIATE, or ADVANCED depending on which level JAWS is currently set on. The constants are defined in the header file hjconst.jsh. Use the If statement and the GetVerbosity function to determine which verbosity level is currently active and speak a message accordingly.

  1. Make sure that the Notepad script file is open and your cursor is at the bottom of the file ready to insert a new script.

  2. Add the following information in the New Script dialog:

    1. Script Name: CheckVerbosity

    2. Can be Attached to Key: checked

    3. Synopsis: Speaks a message based on which verbosity level is active.

    4. Description: This script uses the GetVerbosity function to determine which verbosity level is active and then speaks a message accordingly.

    5. Category: None

    6. Assign to Key: CONTROL + SHIFT + C

  3. The script should first check to see if the verbosity level is set to beginner. If so, a message should be spoken. After typing the keyword If, press CONTROL + I to activate the InsertFunction dialog box and insert the GetVerbosity function. Notice the function requires no parameters. The statement should look like the following and should be placed beneath the line containing the script name:

    If GetVerbosity () == BEGINNER Then ; Check To see If verbosity is beginner.
    

    You do not need quotes around the word BEGINNER because it is a constant value rather than a string value.

  4. On the next line use the SayFormattedMessage function to have JAWS speak the message, "Your verbosity is beginner." Be sure to indent the line first. The line should look like the following:

    SayFormattedMessage (OT_Message, "Your verbosity is beginner")
    
  5. Since we are checking for three conditions (beginner, intermediate, or advanced) we must use the ElIf statement to check for intermediate verbosity. The statement should look like the following:

    ElIf GetVerbosity () == INTERMEDIATE Then ; Check To see If verbosity is INTERMEDIATE
    
  6. On the next line use the SayFormattedMessage function to have JAWS speak the message, "Your verbosity is intermediate."

  7. Since the verbosity level must be one of three levels, we know that if it is not beginner or intermediate then it must be advanced. Therefore we can simply use the Else statement and have JAWS speak the message, "Your verbosity is advanced."

  8. After inserting the Else statement and final SayFormattedMessage function don't forget the EndIf keyword before the EndScript statement. When finished, your script should look like the following:

    Script CheckVerbosity ()
    If GetVerbosity () == BEGINNER Then ; Check To see If verbosity is beginner.
        SayFormattedMessage (OT_Message, "Your verbosity is beginner")
    ElIf GetVerbosity () == INTERMEDIATE Then ; Check To see If verbosity is INTERMEDIATE
        SayFormattedMessage (OT_Message, "Your verbosity is intermediate")
    Else ; If the verbosity is Not beginner or intermediate, it must be advanced
        SayFormattedMessage (OT_Message, "Your verbosity is advanced")
    EndIf
    EndScript
    
  9. Press CONTROL + S to save and compile the script. If any errors exist be sure your script looks like the one above.

  10. Switch over to Notepad and press CONTROL + SHIFT + C to run your script. JAWS should speak the message telling you what your verbosity currently is.

  11. Be sure to change your verbosity to all three levels and test your script. Do the following to change your verbosity:

    1. Press JAWSKEY + V to open the Adjust JAWS Options dialog box.

    2. Press the letter 'U' until you find the User Verbosity option and press SPACEBAR to cycle between the three values.

    3. Press ENTER to accept your change and close the Adjust JAWS Options dialog box and return to Notepad.

Additional Practice: Extend the logic to branch on additional environment settings (for example, Braille on/off, ScreenEcho level, or KeyboardLayout) and announce a concise combined status. How can you keep the branching readable as conditions grow?

Looping Example

The following script in Notepad should make JAWS count out loud from one to ten. You will accomplish this using a While EndWhile loop. During each iteration through the loop, JAWS will speak the value of an integer variable and then increase the value of the variable by one. The SayInteger function will be used to speak the value of the integer variable.

  1. Make sure that the Notepad script file is open and your cursor is at the bottom of the file ready to insert a new script.

  2. Add the following information in the New Script dialog:

    1. Script Name: LoopingExample

    2. Can be Attached to Key: checked

    3. Synopsis: Counts out loud to ten.

    4. Description: This script uses a loop and the SayInteger function to count from one to ten.

    5. Category: None

    6. Assign to Key: CONTROL + SHIFT + L

  3. You must first create an integer variable that will be used to count to ten. Make sure the cursor is in the body of the script and create an integer variable named iCount.

  4. Using a Let statement, assign a value of 1 to the iCount variable.

  5. Since we want JAWS to stop counting after it reaches ten, we use a While loop that only executes while the value of iCount is less than eleven. ENTER the following on a blank line below the Let statement:

    While iCount < 11; This loop will execute 10 times
    
  6. You can now insert the SayInteger function that will speak the value of the iCount variable. On a blank line below the While statement, press TAB to indent the code inside the loop. Then press CONTROL + I to activate the InsertFunction dialog box and locate the SayInteger function.

  7. After choosing the SayInteger function, The Script Manager prompts you for two parameters. The first parameter is the numeric value or integer variable containing the numeric value to be spoken. When prompted by the Script Manager for this parameter, type "iCount" without the quotation marks to indicate that the function will speak the value of the iCount variable. The Script Manager then prompts you for the second parameter, the base of the number to be used. Since this parameter is optional, press TAB until you reach the Finish button followed by the SPACEBAR to activate the button and close the InsertFunction dialog. After the function is inserted into your script, you will need to remove the comma and space between the iCount variable and the right parenthesis. The line should look like the following:

    SayInteger (iCount)
    
  8. On the next line you can now increase the value of the iCount variable by one. First press TAB to indent the new line to the same level as the previous line. Now type the following Let statement:

    Let iCount = iCount + 1; Adds 1 To the value of iCount. When it reaches 11, the loop will stop.
    
  9. On the next line add the EndWhile keyword to conclude the loop.

  10. After performing the above steps, your script should look like the following:

    Script LoopingExample ()
    Var
        Int iCount
    Let iCount = 1
    While iCount < 11; This loop will execute 10 times.
        SayInteger (iCount); Speaks the value of the iCount variable
        Let iCount = iCount + 1; Adds 1 To the value of iCount. When it reaches 11, the loop will stop.
    EndWhile
    EndScript
    
  11. Press CONTROL + S to save and compile the script. If you get a compile error, check to make sure your script matches the example above.

  12. You can now move to Notepad and press CONTROL + SHIFT + L to activate your script. You should hear JAWS count from one to ten.

Additional Practice: Generalize the loop to count to a user-specified number, add an adjustable delay between counts, and speak a start/end message. How would you guard against excessively large inputs or negative numbers?



Understanding Functions

You can find three types of functions within the JAWS scripting language. The three types of functions include:

  • Built-in

  • User-defined

  • Event

Built-in functions are included with the JAWS scripting language and cannot be modified. User-defined functions are functions created for a specific task within a script file and can be modified. Event functions are part of JAWS and can be modified. A description of each type of function follows.

You can find complete descriptions of all built-in, user-defined and event functions that come with JAWS by reviewing the Freedom Scientific Developer Network function reference manual. You can download the manual from the following URL: https://support.freedomscientific.com/support/jawsdocumentation/FSDN

Built-in Functions

Freedom Scientific has provided >1,000 pre-defined functions within the JAWS scripting language. Each function performs a specific series of activities. You use these functions as the building blocks or instructions used to develop your scripts. For example, the RouteJAWSToPC() function checks the position of the JAWS Cursor and PC Cursor, makes the necessary calculations and moves the JAWS Cursor to the same point as the PC Cursor. All the activity is transparent to the JAWS user.

There are built-in functions that accomplish such tasks as: speaking messages, retrieving specific blocks of text, navigating the windows hierarchy and more. You can use the Insert Function dialog to insert any built-in function into the body of your scripts. You can also type the name of the function manually into the body of your script. If you choose to type the built-in function into your script manually, you must make sure you spell the name of the function correctly. You must also be sure the parameters the function requires are of the correct type and in the correct order.

User-Defined Functions

You can also use the script language to create or modify user-defined functions. The difference between a built-in function and a user-defined function is that you can modify user-defined functions while you cannot modify built-in functions.

A user-defined function is a self-contained module of scripting code that you develop to accomplish a specific task. A function is useful when you need to accomplish the same task from a variety of scripts and other user-defined functions. You can use the code of the function without having to write it multiple times. When you write the code once in a function, the time you need to maintain the code is reduced. Rather than modifying blocks of code in several different locations, you need only to make the changes in one place. After you have made the changes, re-compile any scripts or user-defined functions that call the newly modified function.

After you have created the function, you can call it from another script or function, and the task is performed. When the function completes processing, control is returned to the calling script or function where processing continues. You can find many examples of user-defined functions written by the script developers at Freedom Scientific in the default script file, Default.jss. To view the default script file in the Script Manager, do the following:

  • Press JAWSKEY + F2 to activate the Run JAWS Manager dialog.

  • Press S to select the Script Manager followed by ENTER to start the manager.

  • Press CONTROL + SHIFT + D to open the default script file.

Event Functions

The purpose of event functions is to cause JAWS to perform specific tasks automatically without waiting for you to initiate the action with a keystroke. Each event function is triggered by its corresponding windows event. For example, when an application writes new text to the screen, the new text event is triggered. This event causes JAWS to perform the NewTextEvent() function to determine what type of text was written to the screen. Event functions differ from user-defined functions in that you cannot create new event functions. However, you can modify the code in existing event functions.

All parameters for an event function are declared between the left and right parentheses in the function begin statement. When JAWS calls this event function, values are automatically passed for each of the parameters between the parentheses of the function call statement. You cannot add or remove parameters that an event function uses. However since values for each of these parameters are passed when the function is called, you can use the data provided by any of them when you need to customize the event function.

A list of some of the most important event functions follows:

  • AutoStartEvent()

  • FocusChangedEvent()

  • NewTextEvent()

JAWS performs the AutoStartEvent() Function when an application starts and any time the application becomes active. Any code that you do not place within a conditional statement is performed each time the function is called. You can use the AutoStartEvent() Function to initialize any global variables used by the application script file, speak an introductory message when the application starts or perform functions to initialize other settings used by the scripts and user-defined functions contained in the application-specific script file.

Using a global variable to determine if the AutoStartEvent() has occurred once is a useful technique. This technique is used when you want the AutoStartEvent() Function to perform a specific task the first time an application starts but not every time the application receives focus. :::

JAWS performs the FocusChangedEvent() function when focus moves between applications, dialogs, and dialog controls. Each time a focus change occurs, the FocusChangedEvent() compares the previous window with the current window and determines exactly what JAWS should speak.

For example, pressing TAB to move from control to control within a dialog box triggers the FocusChangedEvent(). In turn, JAWS performs the FocusChangedEvent() function to determine the type of change and what JAWS should speak. So when you move from an edit box to a combo box, JAWS speaks the associated prompt of the combo box, the text of "Combo box" and any value contained in the combo box.

JAWS performs the NewTextEvent() function when any new text is written to the screen. The function determines what type of text is written and what is spoken by JAWS. For example, pressing SHIFT + DOWN ARROW to select lines of text in your favorite text editor causes the NewTextEvent() to occur. JAWS in turn performs the NewTextEvent() function to speak the text as it is selected.

There are over 25 event functions JAWS calls automatically. You can review the code of each of these event functions by reviewing the default script file, Default.jss within the Script Manager.

  • Press JAWSKEY + F2 to activate the Run JAWS Manager dialog.

  • Press S to select the Script Manager followed by ENTER to start the manager.

  • Press CONTROL + SHIFT + D to open the default script file.

  • Press CONTROL + L to display the list of all scripts and functions contained within the file. Look for any function name that includes the word "event" in its name. When you find a function containing "event," press enter to move directly to that function.

Parameters and Returns

The simplest function does not receive or return any data to the calling script or function. A good example of a function that does not require any parameters or return any data is the SayLine built-in function. This function only speaks information and does not require any parameters or return any data to the calling script or function.

{#passing-parameters} ### Passing Parameters :::

A parameter is data you pass to a function. You pass a parameter at run time rather than include it as part of the code because the information may be different each time you call the function. A parameter can be any of the variable types used in the scripting language: handle, integer (int), object or string. You declare a parameter like a variable. Instead of declaring the parameter in the body of your function using the key word Var, you place the type and name of the parameter between the parentheses following the function name. When your function requires multiple parameters, you separate each parameter declaration with a comma. Some examples of function beginning lines containing parameter declarations follow:

Void Function SelectingText(Int nMode)
Void Function ProcessSelectText(Int nAttributes, String buffer)

You can also use the New Script dialog within the Script Manager to declare parameters. After you have entered all the general information about the new function, press CONTROL + TAB to move to the Parameters page of the New Script dialog. Press TAB to move to the New Parameter edit box and type the name of the parameter. You should follow the same rules for naming parameters as you would for naming variables. Press tab to move to the Description edit box and type in a description of the parameter. After you have entered a description for the new parameter, press tab until you reach the Available Types list box. Use your ARROW KEYS to select the type of data the parameter will contain. After you have chosen a parameter type, move to and activate the add button to add the parameter to your function.

You declare a function that requires a single string parameter as follows:

Void Function SayName (String sMyName)
SayFormattedMessage (OT_MESSAGE, sMyName)
End Function

In the above example, the SayName() function receives a string parameter, sMyName, from the calling script or function. The SayFormattedMessage() function uses the value in sMyName as its first parameter. You can call the SayName() function in one of the following ways:

::: {#example-1}

Example 1:

:::

Script SayMyName ()
SayName ("John")
End Script

Example 2:

Var
    String sMyName
Let sMyName = "John"
SayName (sMyName)
End Script

The data being passed in the sMyName parameter can either be enclosed in quotation marks as in the first example or declared as a variable in the calling script as in the second example. In either case, the function is expecting a string of data to be passed. When you insert the SayName() function into the above script using the Insert Function dialog, you are prompted to provide the data for the parameter just as if you were inserting one of the JAWS built-in functions.

::: {#returning-data}

Returning Data

:::

A return is data that is sent back from a function to the calling script or function after the function completes processing. You use the keyword, return, to return the data to the calling script or function. The calling script or function uses this returned data for further processing.

A function can return any of the following:

  • Void

  • Handle

  • Integer

  • Object

  • String

When you create a function, the return type is placed in front of the key word, Function, in the beginning line of the user-defined function. You select the return type from the New Script dialog within the Script Manager at the same time you create the user-defined function.

A function that requires no parameters and does not return any data to the calling script or function is declared as follows:

Void Function SpeakTheName ()
Var
    String sMyName
InputBox ("Enter the name:", "EnterName", sMyName) ; prompt the user For their name
If sMyName != cscNull Then ; determine If a value was entered in the input box
    SayFormattedMessage (OT_MESSAGE, sMyName)
Else
    SayFormattedMessage (OT_ERROR, "No name entered.")
EndIf
EndFunction

In the above example, the Void keyword precedes the Function keyword. The void keyword indicates that the function does not return any data to the calling script or function.

A function that requires no parameters and returns a string value is declared as follows:

String Function ReturnTheName ()
Var
    String sMyName
InputBox ("Enter the name:", "EnterName", sMyName) ; prompt the user For their name
Return sMyName ; Return the name To the calling Script or Function
EndFunction

In the above example, the String keyword precedes the Function key word. The String keyword indicates that the function returns a string value to the calling script or function.

Understanding Functions Exercises

The following exercises will give you practice in creating varying types of user-defined functions. Each exercise creates a user-defined function and a corresponding script to call the function. Each exercise will indicate the script file that should be used.

Basic User-Defined Function

The purpose of this exercise is to create a function that speaks a message and then types a string of text into an Notepad document. If you don't already have Notepad open, start Notepad and activate the script Manager from within Notepad. This should open the Notepad.jss script file that contains scripts from the previous exercises in this manual. If you run Script Manager from within Notepad and a blank file is opened, type the following lines at the top of the file:

; Script file For Notepad
; JAWS version 12.0
Include "hjconst.jsh"
Include "common.jsm"

First, create the function that speaks a message and then types a string of text into Notepad. Use the SayFormattedMessage function to speak the message and the TypeString function to type the text. SpeakGreeting Function Documentation:

  1. Script Name: SpeakGreeting

  2. Can be Attached to Key: not checked

  3. Synopsis: Speaks a message and types a string of text.

  4. Description: Speaks a message and types a string of text into an open Notepad text document.

  5. Category: none

  6. Function Returns: void

  7. Return Description: none

Void Function SpeakGreeting ()
    SayFormattedMessage (OT_MESSAGE, "Hello world, it's a great day For writing scripts.")
    TypeString ("Hello world, it's a great day For writing scripts.")
EndFunction

Once you have successfully compiled your function, you will need to create the script to call it. Use the InsertFunction dialog to insert the SpeakMessage function into the body of your script. This is the only statement that goes into the body of your script as the function performs the desired task. TypeAndSpeakGreeting Script Documentation:

  1. Script Name: TypeAndSpeakGreeting

  2. Can be Attached to Key: checked

  3. Synopsis: Calls the SpeakGreeting function to speak a message and type text.

  4. Description: Calls the SpeakGreeting function to speak a message and type text in Notepad.

  5. Category: none

  6. Assign to: CONTROL + SHIFT + G

Script TypeAndSpeakGreeting ()
SpeakGreeting ()
EndScript

Additional Practice: Refactor the greeting into a parameterized function (for example, pass time of day and audience), and create small test scripts to exercise variations. How would you structure reusable utilities shared across scripts?

User-Defined Function with a Single Parameter

The purpose of this exercise is to create a user-defined function that speaks a message using a string of text passed to it as a parameter. If you don't already have Notepad open, start Notepad and activate the script Manager from within Notepad. Before you create your user-defined function and related script, you need to create the message used by your function in the Notepad.jsm message file. You can open the file within the Script Manager and add your message. If you already have a Notepad.jsm message file, do the following to open the file in the Script Manager:

  1. Press CONTROL + O to display the Open File dialog.

  2. Type Notepad.jsm in the File Name edit box and press ENTER.

  3. If you have not previously created the Notepad message file, perform the following:

    1. Press CONTROL + N to display the New File dialog.

    2. The active control is a list of file types. Press M. to select Messages followed by ENTER. This will open an untitled message file in the Script Manager.

    3. Type the following text in the file:

      ; Message file For Notepad
      Messages
      EndMessages
      
  4. Press CONTROL + S to

    save the file. JAWS prompts you for the filename. Type Notepad in the File Name Edit box followed by ENTER.

Now you are ready to insert the individual message in the Notepad.jsm message file. To add the individual message, perform the following:

  1. Press UP ARROW until you reach the line entitled "Messages."

  2. Press END. to move to the end of the line.

  3. Press ENTER twice to create two blank lines.

  4. Type the following messages:

    @MsgName
    Hello world, my name is %1.
    @@
    ; message For missing or no name
    @MsgNoName
    You did Not ENTER a name.
    @@
    
  5. Press CONTROL + S to save the file.

  6. Press CONTROL + TAB to move back to the Notepad.jss script source file.

    After you have moved back to the Notepad.jss script file, be sure to include the Notepad.jsm file if you haven't done so already. Failure to do so will result in errors at the time of compilation.

Now you are ready to create the function that will speak your message and the script that calls the function. Your function should accept a single string parameter: the name passed to it from the calling script. Before the function speaks the message, check to make sure the parameter actually contains some text using an If statement. If there is no text in the parameter, speak an error message and use the return statement to exit the function. Use the FormatString function to combine the passed string parameter and the MsgName message you created above into one message. Next, call the SayFormattedMessage function to speak the message after it has been formatted.

SpeakTheName Function Documentation:

  1. Script Name: SpeakTheName

  2. Can be Attached to Key: not checked

  3. Synopsis: Speaks a message that includes a name.

  4. Description: Speaks a Hello World message using a string parameter passed to the function containing a name.

  5. Category: none

  6. Function Returns: void

  7. Return Description: none

After you have entered the information shown above into the General page of the New Script dialog, press CONTROL + TAB to move to the Parameters page. You will use this page to tell JAWS the name and type of the parameter the function needs to perform its task. When you reach this page, press TAB to move to the New Parameter edit box and add the following information:

  1. New Parameter: sName

  2. By Reference: not checked

  3. Description: String containing the name to be combined with the message and spoken.

  4. Available Types: string

After you have entered the information shown above, press ALT + A to activate the Add button and add your new parameter. Next, press TAB until you reach the Ok button. Press SPACEBAR to activate the button and close the New Script dialog.

Void Function SpeakTheName (String sName)
Var
    String sMessage
If sName == "" Then; check To make sure text was actually passed in the sName parameter
    SayFormattedMessage (OT_ERROR, MsgNoName); speak an error message
    Return; exit the Function
EndIf
Let sMessage = FormatString (MsgName, sName); format the message using the passed parameter
SayFormattedMessage (OT_MESSAGE, sMessage)
EndFunction

Once you have successfully compiled the SpeakTheName function, you will be ready to create the script that calls the function. Your script should assign a value to a variable called sName. Use the InsertFunction dialog to insert the SpeakTheName function. The variable sName will be the parameter to the SpeakTheName function.

SayName Script Documentation:

  1. Script Name: SayName

  2. Can be Attached to Key: checked

  3. Synopsis: Prompts you for a name to be spoken by JAWS.

  4. Description: Displays a dialog box that allows you to ENTER your name. JAWS then speaks a message containing the name you entered.

  5. Category: none

  6. Assign to: CONTROL + SHIFT + N

Script SayName ()
Var
    String sName
Let sName = "John"
SpeakTheName (sName)
EndScript

Additional Practice: Enhance the function to normalize/capitalize names, trim whitespace, and optionally speak phonetic hints. What input validation patterns will you adopt to keep callers simple?

User-Defined Function with Multiple Parameters

In the previous exercise, you created a function that accepted a string parameter containing your name. This parameter could hold only your first name or the combination of your first and last names. In this exercise, modify the SpeakTheName function to accept two string parameters. The original parameter of the function, sName, will be used to hold the first name. The second parameter created for this exercise, will hold the last name. Before you modify the function, you will need to change the content of the MsgName message contained in the Notepad message file. Press CONTROL + TAB to move from the Notepad.jss file to the Notepad.jsm file. In the Notepad.jsm message file, change the MsgName message to look like the following:

@MsgName
Hello world, my name is %1 %2.
@@

Press CONTROL + S to save your changes followed by CONTROL + TAB to move back to the Notepad script file. Now you are ready to modify the existing SpeakTheName function. To add an additional parameter to the function, perform the following:

  1. Move to the body of the SpeakTheName function.

  2. Press CONTROL + D to display the script Documentation multi-page dialog.

  3. Press CONTROL + TAB to move to the Parameters page. When you move to this page, the focus is placed in the Existing Parameters list box.

  4. Press TAB to move to the New Parameter edit box.

  5. Add the following information for your new parameter:

    1. New Parameter: sLastName

    2. By Reference: not checked

    3. Description: String containing the last name.

    4. Available Types: string

After you have added all the necessary information for the new parameter, press ALT + A to activate the Add button. This moves the focus back to the New Parameter edit box. Press TAB until you reach the Ok button. Press SPACEBAR to activate the button and close the Script Documentation multipage dialog. Move the Insertion point to the beginning line of the SpeakTheName function. It should now look like the following:

Void Function SpeakTheName (String sName, String sLastName)

You are now ready to modify the function to use the second parameter. First, you should add a second If statement to check if anything was passed in the sLastName parameter. Move your Insertion point to the line containing the EndIf statement. Press END. to move to the end of the line followed by ENTER to create a new blank line. Add the following statements to the function:

If sLastName == "" Then
SayFormattedMessage (OT_ERROR, MsgNoName); speak an error message
Return; exit the Function
EndIf

Second, you will need to add a third parameter to the call to the FormatString function. Move your Insertion point to the line containing the FormatString function and change it to look like the following: Let sMessage = FormatString (MsgName, sName, sLastName) ; format the message using the passed parameters After you modify the function to use the new parameter, compile the script file. Once you have compiled the file successfully, you will be ready to modify the script.

You can alter the messages used to speak the error messages when nothing is contained in either the first or last name parameters. To do this, you would add a second message to the Notepad.jsm message file for the last name and alter the contents of the message for the first name. Then you could use each message appropriately to speak the correct error message.

To modify the script you will need to add a second variable to hold the last name. Use a Let statement to assign a value to the variable and pass it as the second parameter into the SpeakTheName function. Modify the SayName script to look like the following:

Script SayName ()
Var
    String sLastName,
    String sName
Let sName = "John"
Let sLastName = "Doe"
SpeakTheName (sName, sLastName)
EndScript

Additional Practice: Extend the function to support an optional middle name and title, with robust handling when some parts are missing. How would you design the signature and defaults to remain clear?

User-Defined Function with a Return Value

The purpose of this exercise is to create a function that returns a value to the calling script. In the previous 2 exercises, you created a script and function that used 2 parameters to speak a message. The script used the Let statement to assign values to variables which were then passed into the function to speak the message. In this exercise, you will create a function that uses the InputBox function to prompt you for your first and last names. The function will then format the message to be spoken using the FormatString function. The FormatString function uses the MsgName message from the previous exercise along with the values for the first and last names entered using the InputBox function. Finally, the function returns the message as a string to the calling script. The InputBox function is a built-in function that displays a dialog box with an edit field for entering text. Using the parameters of the function, you pass strings of text to be used as the title of the dialog box and the prompt for the edit field. The third parameter should be a variable name that will contain the text entered when the OK button is activated in the dialog box. An example of the InputBox function follows:

InputBox ("Name entry", "Please enter your first name", \$sName)

In the example above, the title of the dialog box will be "Name entry." The text "Please enter your first name" will be the prompt for the edit box. sName will contain the text entered by the user. If no text is entered, sName will be empty.

  1. Script Name: RetrieveTheName

  2. Can be Attached to Key: not checked

  3. Synopsis: Prompts you for your first and last names.

  4. Description: Uses the InputBox function to prompt you for your first and last names.

  5. Category: none

  6. Function Returns: string

  7. Return Description: String of text containing the formatted message to be used by any of the Say functions.

String Function RetrieveTheName ()
Var
    String sFirstName,
    String sLastName,
    String sMessage,
    String sPrompt,
    String sTitle
Let sTitle = "Name Entry"
; retrieve the first name
Let sPrompt = "Enter your first name:"
InputBox (sPrompt, sTitle, sFirstName)
; retrieve the last name
Let sPrompt = "Enter your last name:"
InputBox (sPrompt, sTitle, sLastName)
; format the message
Let sMessage = FormatString (MsgName, sFirstName, sLastName)
; Return the formatted message
Return sMessage
EndFunction

Once you have compiled the function successfully, you will be ready to create the script that calls it. You will need to declare a single string variable to hold the message that is returned from the function. Your script should then call the function and store the returned message in the local variable. Finally, your script will use the SayFormattedMessage function to speak the message.

SpeakFormattedMessage Script Documentation:

  1. Script Name: SpeakFormattedMessage

  2. Can be Attached to Key: checked

  3. Synopsis: Speaks a message containing first and last names.

  4. Description: Speaks a message returned from the RetrieveTheName function.

  5. Category: none

  6. Assign to: CONTROL + SHIFT + M

SpeakFormattedMessage Script:

Script SpeakFormattedMessage ()
Var
    String sMessage
Let sMessage = RetrieveTheName (); call the Function To retrieve and format the message
SayFormattedMessage (OT_MESSAGE, sMessage); speak the message
EndScript

Additional Practice: Have the function return different messages based on runtime conditions (for example, verbosity or active application). How could you cache results or avoid recomputation if called frequently?



Windows Program Structure

What is a Window?

Most people who use the Windows environment never really understand what the word "window" actually means. Most users realize the rectangular box that appears on the screen when a new application is opened is a window. They probably think of the text area of their word processor as a window as well.

In most applications, every dialog box, menu, button, edit field, list box, etc. is actually a separate window with one or more identifiers that can be used to refer to it. However, a programmer may choose to create controls, such as entry fields, without making them actual windows. Programs like this are the most difficult to make accessible because there's no simple way to identify and speak the various controls.

Windows Hierarchy

The operating system does not randomly place the various windows that may be present on your screen at any one time. They are interrelated with a special hierarchy that allows the Windows operating system and the programmers who work within it to keep track of each window.

You can think of these inter-relationships as one of parents and children. The desktop is the parent of all application windows. Thus, the JAWS window, your word processor's window and the Internet browser's window are all children of the desktop. These windows are all one level down from the desktop, which makes them all children of the desktop at the same logical level. It also means that all of them are peers of each other. When you later encounter terms such as PriorWindow() and NextWindow(), the reference is to moving among peer windows at the same logical level.

The word processor window has several child windows, the text area, the menu bar, the toolbar and the status line. These are all children of the word processor window and are all children at the same logical level. When you press the keystroke to open a file in your word processor, the word processor displays a child window that prompts you for the file to open. This window is often referred to as a dialog box, but it is a child window to the word processor, its parent.

If you think of the Open File dialog box as a parent then you will find that the File Name edit box and all other controls are children of the open file dialog box. These are all children of the parent dialog and are at the same logical level. Each window is a child to the window one level up that spawned or generated it, and each window is a parent to the windows one level down from it.

You can find a good analogy of the parent-child relationship by using the directory structure of your PC. On your disk drive, the C:\ drive is the parent of all other directories on your drive. All of the subdirectories one level down from C:\ are children of that parent and are at the same logical level.

Thus, if you have sub-folders named Program Files, Users, and Windows on your system, they are all one level down from C:\. They are all children of C:\ and are all one logical level down. For the purposes of folder structure and window hierarchy, you can assume that being at the same logical level means that all windows were spawned or generated by the same parent.

When you open the Program Files subdirectory, you should find subdirectories such as Common Files, Freedom Scientific and Internet Explorer. These three sub-folders are all one level down from Program Files, are children of Program Files, and are at the same logical level as each other, two levels down from C:\. This can continue until the lowest logical level of a particular branch is reached.

The parent/child structure of Windows works much the same way as a folder structure. Each application is a branch of the tree, and child windows are spawned from it. All windows one level down from the parent application are children at the same logical level. Each of these children can spawn children of their own, and these children are three levels down from the parent application.

Diagram of Windows Window Hierarchy and File/Directory Analogy

graph TD
    subgraph WIN["🪟 Windows Window Hierarchy"]
        D["Desktop<br/>(window parent)"]
        A["Applications"]
        J["JAWS"]
        W["Word"]
        C["Chrome"]
        TA["Text Area"]
        MB["Menu Bar"]
        TB["Toolbar"]
        SL["Status Line"]
        OFD["Open File<br/>Dialog"]
        FNE["File Name<br/>edit box"]
        OC["Other controls"]
        
        D --> A
        A --> J
        A --> W
        A --> C
        W --> TA
        W --> MB
        W --> TB
        W --> SL
        W --> OFD
        OFD --> FNE
        OFD --> OC
    end
    
    subgraph FILE["📁 File/Directory Hierarchy"]
        DR["C:<br/>(drive root)"]
        PF["Program<br/>Files"]
        CF["Common<br/>Files"]
        FS["Freedom<br/>Scientific"]
        BR["Browser"]
        U["Users"]
        WD["Windows"]
        
        DR --> PF
        DR --> U
        DR --> WD
        PF --> CF
        PF --> FS
        PF --> BR
    end
    
    ANALOGY["🔗 Analogy<br/>Desktop ↔ Drive<br/>Window spawn ↔ Subfolder<br/>Dialog ↔ Folder"]
    
    style WIN fill:#ADD8E6,stroke:#4169E1,stroke-width:2px
    style FILE fill:#90EE90,stroke:#228B22,stroke-width:2px
    style ANALOGY fill:#FFE4B5,stroke:#FF8C00,stroke-width:2px
    style D fill:#ADD8E6,stroke:#000
    style A fill:#90EE90,stroke:#000
    style J fill:#FFFFE0,stroke:#000
    style W fill:#FFFFE0,stroke:#000
    style C fill:#FFFFE0,stroke:#000
    style DR fill:#ADD8E6,stroke:#000
    style PF fill:#90EE90,stroke:#000
    style U fill:#FFFFE0,stroke:#000
    style WD fill:#FFFFE0,stroke:#000

Identifying Windows

An application programmer assigns a number of identifiers to each window. These identifiers allow the window in question to be referred to unambiguously. Each window has a class, type, type code, window subtype code, and control ID. These window categories are important because JAWS behaves differently, depending on what category of window is active.

For example, if an edit field is active, JAWS tracks the insertion point. When you press DOWN ARROW, JAWS speaks the line of text to which the insertion point moves. When a list box or menu is active, JAWS tracks the highlight or lightbar as the arrow keys are used to move it up and down the list. JAWS knows to do these things because of the scripts that are associated with the up and down arrow keys in the Default.jss script file. These scripts contain logic that decides what to do based on the type of the window that has the focus when one of these keys is used.

::: {#the-window-handle}

The Window Handle

:::

The window handle is a unique number assigned by the operating system to each window when it is created during a given session. Window handles change each time the window is created. However, the handle value remains constant as long as the window exists.

As long as a window exists, you can use the handle to refer to and identify that window. But when a window is closed, it relinquishes its handle. If the window is created later, the operating system assigns a different handle.

You can retrieve the window handle using the built-in functions, GetCurrentWindow() and GetFocus(). There is a distinct difference between these two functions. The GetFocus() function retrieves the handle of the window that contains the insertion point or system focus. The GetCurrentWindow() function retrieves the handle of the window containing the active cursor.

An example of how the GetFocus() function is used follows:

Script GetWindowFocus ()
Var
    Handle hFocusWindow
Let hFocusWindow = GetFocus ()
; the GetFocus statement could be replaced by the following line:
; Let hFocusWindow = GetCurrentWindow ()
SayInteger (hFocusWindow); speak the value of the window Handle
EndScript

::: {#window-class}

Window Class

:::

The window class is a string of text that denotes some information about a window and what it does. A window class can be edit, list box, or a button. It provides valuable information about the window. However, the window class does not always provide specific information. Checking the window class will return the same information for a button, radio button, and checkbox all of which have a Window Class of button. JAWS recognizes 28 different classes.

Many times, programmers use custom window classes that JAWS cannot recognize. In these cases, you must tell JAWS how to treat the unrecognized class. After you tell JAWS how to treat a custom window class, JAWS reacts to the window class just as if it were a recognized window class.

You can retrieve the Window Class with the function, GetWindowClass().

An example of how the window class is retrieved follows:

Script RetrieveWindowClass ()
Var
    String sTheClass
Let sTheClass = GetWindowClass (GetFocus ())
If sTheClass == "Edit" Then ; the window class is an edit box
    SayFormattedMessage (OT_MESSAGE, "Focus is in an edit box.")
Else
    SayFormattedMessage (OT_MESSAGE, "The focus is Not in an edit box.")
EndIf
EndScript

::: {#window-type}

Window Type

:::

The window type is a string of text that describes the window. Occasionally, the window type reveals more specific information about certain windows. The window type and window class are the same if no more specific information is available. For example, the window class and window type of an edit box are exactly the same.

You can use the window type to differentiate between a checkbox and a radio button. You use the function GetWindowType() to retrieve the Window Type. The GetWindowType() function returns the string of "unknown window type" when the application programmer used a custom window class to define the window. The Window Type is always in English and is not very useful for those using JAWS in other languages.

An example of how the GetWindowType() function is used follows:

Script RetrieveWindowType ()
Var
    String sTheType
Let sTheType = GetWindowType (GetFocus ())
If sTheType == "Edit" Then
    SayFormattedMessage (OT_MESSAGE, "The focus is in an edit box")
Else
    SayFormattedMessage ("OT_MESSAGE, The focus is Not in an edit box.") ; a window type other than edit was found
EndIf
EndScript

::: {#window-type-code}

Window Type Code

:::

The window type code is a numeric value instead of a string. This number is translated into a recognizable string by constant definitions found in the file, HJConst.jsh. For example, in this file you can find lines such as WT_BUTTON=1, WT_COMBOBOX=2, WT_EDIT=3, WT_LISTBOX=4, and WT_SCROLLBAR=5. The WT prefix of the constant indicates that this is a constant that refers to a window type code.

While the window type code does not provide any more information than the window type, it does have the advantage of being language independent. You retrieve the window type code with the function, GetWindowTypeCode().

An example of how the GetWindowTypeCode() function is used follows:

Script RetrieveWindowTypeCode ()
Var
    Int iTheTypeCode
Let iTheTypeCode = GetWindowTypeCode (GetFocus ())
If iTheTypeCode == WT_Edit Then
    SayFormattedMessage (OT_MESSAGE, "The focus is in an edit box.")
Else
    SayFormattedMessage (OT_MESSAGE, "The focus is Not in an edit box.")
EndIf
EndScript

::: {#window-subtype-code}

Window Subtype Code

:::

Like the window type code, the window subtype code is also a numeric value. However, the window subtype code may provide more detailed information about a window. If no subtype code is available for the window, then the window type code and window subtype code are identical. You should use the window sub type code as it generally provides more specific information about a window than does the window type code. You can use the same constant definitions to refer to window subtype codes as you can for window type codes in your scripts and functions. For example, a radio button has a window type code of 1 (WT_Button) but a subtype code of 19 (WT_RadioButton).

Window subtype codes are also language independent. You use the function, GetWindowSubTypeCode(), to retrieve the window subtype code for a given window.

An example of the use of the GetWindowSubTypeCode() function follows:

Script RetrieveWindowSubTypeCode ()
Var
    Handle hWnd,
    Int iTheSubTypeCode,
    Int iTheTypeCode
Let hWnd = GetFocus ()
Let iTheTypeCode = GetWindowTypeCode (hWnd)
Let iTheSubTypeCode = GetWindowSubTypeCode (hWnd)
If iTheTypeCode == WT_Button Then
    If iTheSubTypeCode == WT_RadioButton Then
        SayFormattedMessage (OT_MESSAGE, "The active window is a radio button.")
    Else
        SayFormattedMessage (OT_MESSAGE, "The active window is Not a radio button.")
    EndIf
Else
    SayFormattedMessage (OT_MESSAGE, "The active window is Not a button.")
EndIf
EndScript

::: {#window-control-id}

Window Control ID

:::

The control ID is a number that is assigned by the programmer to each window during application development. The control ID, unlike the window class, has no special meaning, but you can use it to refer to a particular window. Ideally, no two windows in a program have the same control ID, but they sometimes do. If you know how to access the control ID, and, if it is unique within the application, you can tell JAWS to do certain things if you are focused on the window with the control ID you have identified.

One example where the use of control ID's are extremely useful is in applications where the buttons are labeled with bit map drawings instead of text labels. Normally, JAWS speaks the text label of a button when you move to it. If the label is a drawing, there is no name to be spoken. By determining the control ID numbers of the various bit map buttons, you can write a script that speaks the name of a button when the focus moves to a button with a particular control ID.

In most cases, the control ID is defined during application development and can be relied upon to uniquely identify a specific window. However, you may find cases where control ID's have not been assigned by the application developer. In these cases, you will find that each window in a given application have control ID values of 0. You must then rely on other window identifiers along with the window's hierarchical position to uniquely identify it.

You may also find that the control ID's in a given application are dynamically assigned. This means that each time an application window or any of it's child windows are created, the control ID's are assigned and do not remain constant. In these cases, you will find that you need to use the other windows identifiers and the window hierarchical position to uniquely identify the window.

You can determine if control ID's are dynamically assigned by running the application, noting the control ID values of some of it's child windows, then restarting the application and looking at those same control ID values. If they have changed, then you will know that the ID's are dynamically assigned. You use the function, GetControlID(), to retrieve the control ID for a given window.

An example of how the GetControlID function is used follows:

Script IdentifyWindow ()
Var
    iControlID
Let iControlID = GetControlID (GetFocus ())
If iControlID == 1100 Then
    SayFormattedMessage (OT_MESSAGE, "This is the file name edit box")
Else
    SayFormattedMessage (OT_MESSAGE, "This is Not the file name edit box.")
EndIf
EndScript

Reassigning Window Classes

There is a standard list of window classes used by most programmers during the development of windows applications. The scripts and user-defined functions found in the default script file contain the necessary logic to allow proper speaking of these standard classes. However, application programmers do not always use standard window classes during application development. Many times, a programmer creates custom window classes that are non-standard. JAWS is unable to recognize the custom class and speak the window correctly.

You use the Configuration Manager to equate the unknown class to a standard class to allow JAWS to process the window correctly. This process is called reassigning the window class. Once you have reassigned a custom window class, JAWS is able to identify the window and speak it correctly. During window reassignment, you may need to try more than one class to determine what standard class works best.

To reassign a window class, you can use the JAWS Cursor, Invisible Cursor or PC Cursor to locate the window. To reassign a window class, do the following:

  • Move the JAWS Cursor, Invisible Cursor or PC Cursor to the window with the non-standard class.

  • Press JAWSKEY + F2 to activate the Run JAWS Manager dialog.

  • Press JAWS Cursor, Invisible Cursor or W to move to the JAWS Cursor, Invisible Cursor or Window Class Reassign item.

  • Press ENTER to start the Configuration Manager and display the Window Classes dialog. The New Class edit box is the active control. The non-standard window class is shown in this edit box.

  • Press TAB to move to the Assign To list box. This list box contains all of the standard window classes JAWS recognizes.

  • Use your ARROW KEYS to move through the list. Select the window class you think best suits the non-standard window class.

  • Press TAB to move to the Add Class button. Press SPACEBAR to activate this button. You can also press ENTER from the Assign To list box to activate the add Class button.

  • Press the SPACEBAR to activate the OK button to close the Window Classes dialog. The Configuration Manager will also close.



Exploring Applications with the Utility Functions

JAWS provides you with a powerful set of utilities to quickly analyze an unknown application. These utilities are called the Script Utility Mode. When the Script Utilities are activated, the keyboard is placed in a shifted state. These utilities give you access to system level window information that you can use when scripting an unknown application. You can determine parent-child relationships, windows identifiers, and retrieve information about MSAA objects1.

Press CONTROL + WINDOWS + HYPHEN to turn on the Script Utilities. Press CONTROL + WINDOWS + HYPHEN a second time to turn off the Script Utilities.

Speaking Window Information

After activating the Script Utilities, you can speak various types of information about the active window. Press F1 to speak information about the window. By default, the window and related text are spoken when the utilities are activated for the first time.

You can cycle through the different pieces of information spoken by pressing F3. The pieces of information spoken are referred to as output modes. Each time you press F3 followed by F1, a different output mode is spoken.

Output modes include:

  • window type

  • window text

  • focus

  • control ID

  • class

  • type

  • subtype

  • real name

As you cycle through the various output modes, you can press F1 to hear JAWS speak the current output mode. Pressing JAWSKEY + HOME on the number pad will reset the output mode to say type and text. After the keystroke is pressed, JAWS announces "output mode is type and text." This keystroke eliminates the need to press F3 to return to the say type and text output mode.

You can also copy the spoken information to the clipboard. Press CONTROL + F1 to copy the spoken information to the clipboard. You can paste this information into your favorite text editor for review. Press JAWSKEY + F1 to have JAWS place the information in the virtual viewer.

Moving to Windows

In the windows program structure, there is a parent-child relationship between all windows contained within an application. A parent window can have several child windows. All child windows of a specific parent window are siblings of each other and said to be on the same logical level. Using the Script Utilities , you can access each of these windows and speak information about them.

::: {#moving-across-the-windows-hierarchy}

Moving Across the Windows Hierarchy

:::

Using the Script Utilities , you can access windows even if they are not accessible through the TAB and SHIFT + TAB keys when Script is turned off. Press TAB to move to the next window on the same level. You can continue to press TAB until JAWS speaks "No next window." This message indicates you have reached the last window on the same logical level.

You can move to the prior window on the same level by pressing SHIFT + TAB. You can continue to press SHIFT + TAB until JAWS speaks "No prior window." This message indicates you reached the first child window on the same level.

As you press TAB or SHIFT + TAB to move through the windows, JAWS automatically speaks the selected output mode. You can press JAWSKEY + TAB to hear the window type and text spoken by JAWS for the active window. If you are not sure where you began, press F5 to return the Script Utilities to the location of the PC Cursor.

::: {#moving-up-and-down-the-windows-hierarchy}

Moving Up and Down the Windows Hierarchy

:::

You can use the Script Utilities to move up and down the windows hierarchy. This functionality gives you the ability to determine if the window with focus has any child windows associated with it. It also gives you the ability to move to the parent of the active child window.

Press F2 to determine if the active window has any associated child windows. When a child window is found, the focus is moved to the child window and JAWS speaks the output mode information about the child window. You can continue to press F2 until JAWS speaks "Child window not found." This message indicates you are at the bottom of the windows hierarchy and no more child windows are present. Press TAB and SHIFT + TAB to determine if there are other child windows on the same logical level.

Press SHIFT + F2 to determine if a child window has an associated parent window. You can continue to press SHIFT + F2 until JAWS speaks "Parent window not found." This message indicates you have reached the top of the windows hierarchy. After you have reached a parent window, press TAB and SHIFT + TAB to determine if there are other windows on the same logical level. Remember that a parent cannot only have child windows, but it can be the child of another parent window. After reviewing the parent-child relationships, you can press F5 to route the Script Utilities to the active window. This essentially takes you back to the starting point from which you activated the Script Utilities.

::: {#determining-window-visibility}

Determining Window Visibility

:::

As you move across, up, and down the windows hierarchy you are moving to windows that may or may not be visible on the screen. You can use the Script Utilities to identify the windows that are visible and those that are not. Press F6 to hear the visibility status of the current window announced automatically by JAWS. Each time you move from window to window with this option turned on, JAWS will announce the visibility of the window immediately following the output mode information. You can turn this feature off by pressing F6 a second time. You can also announce the visibility status of the current window by pressing F7. This will announce the visibility status regardless of the state of the F6 visibility status toggle.

Searching for Text Attributes

Many applications use text attributes to convey important information. You can search for attributes such as: highlight, bold, underline, italic, and strikethrough using the Script Utilities . To select the text attribute for which to search, press F4. Each time you press this keystroke, JAWS announces the text attribute. Pressing F4 repeatedly will cycle through all text attributes. Once you have selected the text attribute, press GRAVE ACCENT () to begin the search. If the search finds text on the screen with the selected attribute, the JAWS cursor is placed on the text and it is announced. If the attribute is not found, then JAWS speaks "Next attribute not found". This indicates there is no text with the selected attribute. Pressing GRAVE ACCENT () subsequent times will move the JAWS cursor to the next occurrence of the attribute and announce the text. Pressing SHIFT + GRAVE ACCENT () will move the JAWS cursor to the prior occurrence of the attribute and announce the text.

As you press GRAVE ACCENT or SHIFT + GRAVE ACCENT, the JAWS cursor moves to the next or prior occurrence of the attribute, but will not stop at the last or first occurrence. Instead, the search begins over again and JAWS will not announce, "Next attribute not found."

You can press CONTROL + GRAVE ACCENT to immediately move the JAWS cursor to the location of the first occurrence of the selected attribute. You can also press SHIFT + CONTROL + GRAVE ACCENT to move to the location of the last occurrence of the selected attribute.

Retrieving MSAA Information

When the active cursor is on an MSAA object, you can use the Script Utilities to provide information about the object. However, you cannot navigate through MSAA objects using the Script Utilities. If you need to retrieve information on an object you must first activate that object by moving to it with either the JAWS Cursor or PC Cursor.

Press F9 to speak information about the object. By default, the object name is spoken when the utilities are activated for the first time. You can move to the next output mode by pressing F10. You can move to the prior output mode by pressing SHIFT + F10. Each time you press either F10 or SHIFT + F10 followed by F9, a different output mode is spoken. Output modes include: name, type, and subtype.

You can also copy the output mode information about the active object to the clipboard by pressing CONTROL + F9. You can then paste the information into a text editor for review after you complete your analysis of the application.

Script Utilities Keystroke Summary

The following utilities are helpful in finding all the information you need to know about controls, parent/child relationships, and text attributes.

::: {#tblr:table11-1}

KeystrokeDescription
JAWSKEY + HSpeak JAWS hot key shortcuts for the Script Utilities
F1Speak the selected mode of information.
F1, F1 (pressed twice in succession).Spell the selected mode of information.
JAWSKEY + F1Display output mode information in the virtual viewer.
CONTROL + F1Copy output mode information to the clipboard.
JAWSKEY + CONTROL + F1Output Window Technical Info in the virtual viewer (You do not have to be in Script mode to use this command)
CONTROL + ALT + ENTERActivates node capture and places all window information into the virtual Viewer
CONTROL + ALT + SHIFT + ENTERActivates tree capture and places all the window information for child or parent windows into the virtual viewer
F2Move to the first child of the current active window and speak output mode information.
SHIFT + F2Move to the parent of the current active window and speak output mode information.
F3Select the next output mode.
SHIFT + F3Select the previous output mode.
F4Select the attribute search mode. Attributes include bold, italic, underline, highlight, and strikeout.
F5Initialize the Home-Row utilities to the window containing the active cursor.
F6Toggle auto speaking of window visibility status. When this option is turned on, the window's visible status is spoken as you move to it.
F7Speak the visibility status of the window currently referenced by the Home-Row utilities.
F8Speak the contents of the window currently referenced by the Home-Row utilities.
F9Speak the MSAA Object output mode information. The active object is indicated by the position of the active cursor.
JAWSKEY + F9Display the MSAA object output mode information in the virtual viewer. This is not available on output modes that return integers.
CONTROL + F9Copy requested MSAA object output mode information to the clipboard.
F10Select the next MSAA object mode.
F11Speak current output mode.
F12Speak current MSAA object output mode.
TABMove to next window and speak output mode information.
SHIFT + TABMove to prior window and speak output mode information.
JAWSKEY + TABSpeak the window prompt and text for the window currently referenced by the Home-Row.
JAWSKEY + NUMPAD HOMESet output mode to SayTypeAndText.
JAWSKEY + 7Activate the window-reclassification dialog.
JAWSKEY + NUMPAD MINUSRoute the Jaws or Invisible cursor to the window currently indicated by the Home-Row if it is visible on the screen.
GRAVE ACCENTMove to the next text attribute.
SHIFT + GRAVE ACCENTMove to the prior text attribute.
CONTROL + GRAVE ACCENTMove to the first text attribute.
SHIFT + CONTROL + GRAVE ACCENTMove to the last text attribute.
LEFT or RIGHT ARROW KEYSChanges the value of pixel movement performed by the MouseLeft and MouseRight functions
UP or DOWN ARROW KEYSChanges the settings for which special characters are spoken

: Script Utility Keystrokes :::

1

Microsoft Active Accessibility (MSAA): A legacy Windows accessibility API that exposes UI element information (role, name, state, value, parent/child relationships) to assistive technologies. MSAA lets screen readers and other tools query and interact with application UI elements so they can present or manipulate those elements for users with disabilities.



Customizing an Unknown Application

Many questions should be answered about a new application to determine what customization is necessary. Before you write your first script, you should determine how JAWS® works with the application without any customization.

The Main Application Window

The first place you should start your analysis is the main application window. Begin by activating the menu bar using the ALT key. Explore the main application window to determine if any of the controls can be accessed using TAB or SHIFT + TAB. Note any areas within the main application window that contain static text. You will also need to determine if any of the options in the menu or tool bars offer keyboard access. The following checklist gives you some initial areas to assess how well JAWS performs:

  • Do menu bars speak automatically when activated?

  • Do menu options speak automatically when the arrow keys are used to move from option to option?

  • Can all controls on the main application window be accessed?

  • Is there keyboard access to menu or toolbar items?

  • Are there areas of the screen that contain static text that provides useful information during application execution?

  • If there is static text within the main application window, can the user quickly locate the text?

  • Are the tool bars and other important graphics labeled?

  • What information should be shown on the Braille display for quick access?

The above list gives you suggestions for reviewing the main application window of a new and unknown application. You may find that there are other items to check that are not contained on the list.

Dialog Boxes

After reviewing the main application window, you should then check each of the dialog boxes contained within the application. When the dialog box first opens, does JAWS speak the name and active control automatically? Note whether or not the TAB and SHIFT + TAB keystrokes move the focus from control to control. You should also note any areas within each dialog box that contain static text. You can use the following check list to assess the amount of information spoken by JAWS within dialog boxes:

  • Does each text label speak?

  • Does JAWS announce control types correctly?

  • Can all controls be accessed while moving through the dialog box with TAB and SHIFT + TAB?

  • Is each control its own window?

  • Can static text contained within the dialog box be quickly located?

Application Structure and Windows Identifiers

After you have made an initial assessment of the application, you will need to look at information for each of the windows contained within. You can use the Script utilities to determine things such as parent-child relationships, control ID values, window classes and more. You should review the main application window and each subsequent dialog box in much the same way as before. However, you will need to note window identification information for each control or window. The following checklist can help you review the application using the Script utilities:

  • Are control ID's defined?

  • If the control ID's have been assigned, are they dynamic or constant?

  • Does each window have standard window classes?

  • Review the parent-child relationships in the main application window and each dialog box.

Beginning the Customization

After you have completed a thorough review of the application, you can now begin to think about how best to customize JAWS to work with it. If you found non-standard window classes, you should go back through the application and reassign each non-standard window class to a class that JAWS recognizes. Keep in mind that once you reassign a non-standard class, that reassignment is used for each occurrence of the non-standard window class throughout the application. Many times, reclassifying non-standard window classes significantly improves the ability of JAWS to read window information automatically using the default settings.

Before you create scripts to read areas of static text within any of the application windows, try creating frames around the text first. Creating frames around static text that is not contained within it's own window keeps from having to write scripts to access the information. You can then add frame events to monitor for changes within the boundaries of the frame and speak new text automatically when it appears. You can also attach a keystroke to the frame surrounding the text that will allow you to quickly read the information.

::: {#customizing-jaws-with-scripts}

Customizing JAWS with Scripts

:::

After you have tried frames and reclassifying non-standard window classes, you may find that you still need to create scripts for the application. Before you begin to look at the built-in functions used to create your scripts, there are a few things you should do.

Begin by using pseudo-code to list the steps your script should take to reach the desired outcome. Pseudo-code is nothing more than writing down the steps in short phrases that your script will need to complete the desired action. Write each step of the script down in a list. After you have written down the initial steps the script will need to execute, try to recreate those same steps with JAWS commands using the keyboard. You should also review the notes you made previously when you used the Script utilities. You may be able to take advantage of the relationships between parent and child windows to access information within the application.

After you have either tried recreating the steps using the keyboard or reviewed the program structure, note any additional steps you had to take that are not listed in your pseudo code. Now you can begin to look at the built-in functions you will need to use to create the script and achieve the desired outcome. You can follow this procedure for each script you need to write to customize JAWS to work with the application.

Passing Keystrokes and Typing Text with Scripts Exercises

The following exercises give you practice creating scripts that pass keystrokes, access menu options that do not have shortcut keys and type text into the active document window. These chapter exercises do not walk you through the steps needed to create the script. Instead, the goal of the script is shown first, the script documentation second and the code of the script third. If you need to review the steps used to create a script or add functions to the script, refer to chapters 1 through 9 for information on the steps needed to start the Script Manager and the use of the New Script dialog.

Creating a Pass-Through Script

The objective of this exercise is to create a pass-through script that takes an existing application keystroke and enhances its functionality. Within Internet Explorer, you can press, ALT + HOME, to move immediately to your HOME. page. When you press this keystroke, Internet Explorer does not indicate audibly that you are going back to your HOME. page. Create this script within the script file for Internet Explorer, Internet Explorer.jss. . Your script should begin by passing the ALT + HOME keystroke through to Internet Explorer. Before the script completes, JAWS should speak an informational message advising you that you are now going back to your HOME. page. After you have compiled the script, you can test the script by going to a Web page other than your HOME. page and pressing ALT + HOME. After you hear JAWS speak the informational message, your HOME. page should begin loading into Internet Explorer. If you find that your HOME. page is loaded into Internet Explorer, then you can confirm the action was successful.

Script Documentation:

  1. Script Name: GoToHomePage

  2. Attach to Key: Checked

  3. Synopsis: Loads your home page.

  4. Description: Passes ALT + HOME to Internet Explorer to load your home page and announces it.

  5. Category: Keyboard

  6. Assign To: ALT + HOME

    Script GoToHomePage ()
            TypeKey (\enquote{ALT + HOME})
            SayFormattedMessage (OT_STATUS, \enquote{Go To HOME. page.}, cMsgSilent)
            EndScript
    

Additional Practice: Create a small suite of pass-through scripts for common browser actions (Back, Forward, Refresh, Focus Address Bar), each with a concise status message. How would you organize and document them to keep assignments discoverable?

You can add the messages JAWS speaks to a JAWS header or message file and then include that file within the script file for Internet Explorer. See 8.0 Creating and Speaking Messages for more information on creating JAWS message files and adding messages to the file. :::

.exercise

Typing Text with a Script

The objective of this exercise is to create a script that types your e-mail signature in any active application window. You can use this script in your e-mail application, any text editor, or a word processor. You can use a series of TypeString functions to type the text of your signature. Between each call to the TypeString function, be sure to insert calls to the EnterKey function. After you have typed all the necessary text for your signature, JAWS should speak a message informing you the signature was added. Script Documentation:

  1. Script Name: TypeSignature

  2. Can be Attached to Key: Checked

  3. Synopsis: Types an e-mail signature in any application.

  4. Description: Types an e-mail signature in any application using the TypeString function.

  5. Category: Keyboard

  6. Assign To: CONTROL + SHIFT + W

Script TypeSignature ()
    TypeString (\enquote{Training Department})
    EnterKey ()
    TypeString (\enquote{Freedom Scientific Inc.})
    EnterKey ()
    TypeString (\enquote{11800 31st CT. N})
    EnterKey ()
    TypeString (\enquote{St. Petersburg, FL 33716})
    EnterKey ()
    TypeString (\enquote{PH: (800) 444-4443})
    EnterKey ()
    TypeString (\enquote{FAX: (727) 471-7927})
    EnterKey ()
    TypeString (\enquote{training_info@FreedomScientific.com})
    EnterKey ()
    SayFormattedMessage (OT_STATUS, \enquote{Signature added})
    EndScript

Additional Practice: Turn this signature into a reusable snippet system: prompt for recipient or context and insert different templates across editors (for example, Notepad, email, Word). How would you detect the host application and pick the right snippet?

:::



Output Types

Correct Use of Output Modes

Prior to JAWS 6.01, Output Modes (or Output types) were used as a means of controlling information spoken at each verbosity level. With the introduction of Braille Flash Messages in JAWS 6.0, Output Modes are also now used to control which messages are sent as Flash messages to the display. It is thus vital to ensure that correct use of Output Modes is made during scripting to avoid unnecessary Flash messages appearing in Braille. This document outlines the use of Output Modes.

It is very important that correct Output Modes be used not only because of Flash Messages but because JAWS uses the Output Mode in conjunction with all of the JCF options and the Speech and Sounds Scheme in use to determine how text should be spoken. For example, if OT_SPELL is used, JAWS will spell rather than speak the text using the voice alias defined for spelling. Similarly, text spoken using OT_KEYBOARD will honour the current Typing Echo settings. Not all Output Modes are relevant for Braille. Generally, text which is rendered on the display by means of Line or Structured modes does not need to be sent as a Flash Message. For this reason, many of the Output Modes are disabled for Braille altogether. The relevant Output Modes which are configurable for Braille are listed at the end of this document.

::: {#ot_no_disable}

OT_NO_DISABLE

:::

This output Mode should be used very sparingly as messages spoken using it cannot be suppressed and will generate Flash messages.

::: {#ot_help}

OT_HELP

:::

This Output Mode Should be used to speak all Screen Sensitive, Hotkey, Keyboard or other help messages when these messages are not being displayed in the virtual viewer.

::: {#ot_app_start}

OT_APP_START

:::

This Output Mode should only be used to speak messages generated when an application first starts (and only once per JAWS session).

::: {#ot_jaws_message}

OT_JAWS_MESSAGE

:::

This Output Mode should be used to speak messages originating from JAWS, for example when the information is originating from JAWS rather than the application. For example, JAWS for Windows is Ready, JAWS is running in demo mode, or when the user presses a keystroke assigned to a JAWS function, to announce the function name.

::: {#ot_screen_message}

OT_SCREEN_MESSAGE

:::

This Output Mode should be used to speak screen text from application instructions or help messages not considered dialog text. It would typically be spoken via the SayNonHighlightedTextEvent. For example, if a window contains added information about how to interact with the application, but is not essential for interaction with the application. It could be considered supplemental information which the user would perhaps want to hear once but not each time they ran the program. Note that this Output Mode should only be used when the window is automatically spoken. If the user specifically requests the help text via a keystroke, the OT_USER_REQUESTED_INFORMATION Output Mode should be used instead.

OT_CONTROL_GROUP_NAME

This Output Mode should be used to speak the name of a group box surrounding a set of controls. For example, the title of a group of checkboxes. Note that this Output Mode should only be used when the group or a control within the group gains focus or is automatically spoken. If the user specifically requests the control group's title via a keystroke, the OT_USER_REQUESTED_INFORMATION Output Mode should be used instead.

::: {#ot_control_name}

OT_CONTROL_NAME

:::

This Output Mode should be used to speak the prompt of a control. For example, the text to the right of an edit or the label of a button. It should not be used to speak type information nor should it be used to speak the control's contents such as the text in an edit. Note that this Output Mode should only be used when the control gains focus or is automatically spoken. If the user specifically requests the control's prompt via a keystroke, the OT_USER_REQUESTED_INFORMATION Output Mode should be used instead.

::: {#ot_control_type}

OT_CONTROL_TYPE

:::

This Output Mode should be used to speak type information about the focused control. For example, if scripts are written to support a custom control, the description of the control should be spoken with this Mode. An example might be a new Grid control. The word Grid would be spoken using this Output Mode. Note that this Output Mode should only be used when the control is automatically spoken. If the user specifically requests the control's type via a keystroke, the OT_USER_REQUESTED_INFORMATION Output Mode should be used instead.

::: {#ot_dialog_name}

OT_DIALOG_NAME

:::

This Output Mode should only be used to speak the title of a dialog (when a dialog is invoked by the user or application). It should not be used when the user specifically asks for the dialog's title.

::: {#ot_dialog_text}

OT_DIALOG_TEXT

:::

This Output Mode should be used to speak descriptive dialog text essential for correct use of the dialog controls. dialog text is text not part of a control's prompt within the bounds of the current dialog. Note that this Output Mode should only be used when the dialog is automatically spoken. If the user specifically requests the dialog text via a keystroke, the OT_USER_REQUESTED_INFORMATION Output Mode should be used instead.

::: {#ot_document_name}

OT_DOCUMENT_NAME

:::

This Output Mode should be used to speak a document's title when a document window gains focus. If the user specifically requests the document title via a keystroke, the OT_USER_REQUESTED_INFORMATION Output Mode should be used instead.

::: {#ot_item_state}

OT_ITEM_STATE

:::

This Output Mode should be used to speak the state of a control, for example, checked or not checked. It should only be used when the state is toggled or changed, not when the state is specifically requested by the user via a keystroke.

::: {#ot_position}

OT_POSITION

OT_POSITION :::

This Output Mode should be used to speak the position of an item relative to others in its container. For example, the current item in a list, the current node in a tree. It should only be used when the position information is spoken automatically, not when it is specifically requested by the user via a keystroke.

::: {#ot_error}

OT_ERROR

:::

This Output Mode should be used to speak error messages generated as a result of the user performing an inappropriate action. For example, trying to invoke the ListOfLinks in a context where no links maybe listed. It is for JAWS user errors, not application errors.

::: {#ot_tool_tip}

OT_TOOL_TIP

:::

This Output Mode should be used to speak tooltips generated by the operating system or application. A tooltip is a small bubble which appears as a result of moving the mouse pointer over a graphical object.

::: {#ot_help_balloon}

OT_HELP_BALLOON

:::

This Output Mode is used to speak Help Balloons generated by the Aplication or operating system. a Help Balloon differs from a tooltip in that it is generated as a result of user action or when the application or operating system wants to inform the user without the use of a dialog.

::: {#ot_status}

OT_STATUS

:::

This Output Mode is used to speak status messages, for example, when the user presses a keystroke which toggles a JAWS setting on or off. The state of the setting is spoken using this output mode whereas the setting's name itself should be spoken using OT_JAWS_MESSAGE.

::: {#ot_smart_help}

OT_SMART_HELP

:::

This Output Mode should be used for supplemental help given by JAWS for efficient use of an application (text which is not on screen). This does not include Screen Sensitive, Keyboard or Hotkey help, these should be spoken using OT_HELP.

::: {#ot_select}

OT_SELECT

:::

This Output Mode should be used to speak the message preceding or following the act of selecting text in an editor.

::: {#ot_tutor}

OT_TUTOR

:::

This Output Mode should be used to speak tutor information when a control gains focus, for example, "Press Enter to activate" or "Type in text".

::: {#ot_access_key}

OT_ACCESS_KEY

:::

This Output Mode should be used to speak the Access Key (underlined character) in a menu or control's prompt. An access key represents the key to press as a short cut to invoking the action described by the prompt of the control. For example, in an Edit Menu, the E maybe underlined which means that the user needs to press E to select that item directly without having to arrow to that item and press Enter.

::: {#ot_user_requested_information}

OT_USER_REQUESTED_INFORMATION

:::

This Output Mode should be used whenever a user requests information to be spoken via a keystroke. For example, if the user presses JAWSKEY + F12 to hear the time, JAWSKEY + T for the window title, etc.

Special Uses

The following Output Modes have special uses:

::: {#ot_blank_line_count}

OT_BLANK_LINE_COUNT

:::

Use this when a script is controlling SayAll to speak the number of blank lines.

::: {#ot_user_buffer}

OT_USER_BUFFER

:::

Use this to redirect the text to the virtual viewer rather than speaking it directly.

::: {#ot_phonetic_char}

OT_PHONETIC_CHAR

OT_PHONETIC_CHAR :::

Use this to cause the string to be expanded to its phonetic rendering. For example, say("a", OT_PHONETIC_CHAR) would say "alpha". If the string contains more than one character, the string will be spelled phonetically.

::: {#ot_braille_message}

OT_BRAILLE_MESSAGE

:::

This Output Mode should be used for messages specifically for Braille which won't ever be spoken. This could be used for displaying a dot pattern which represents some graphical layout information which has no speech equivalent.

::: {#ot_highlighted_screen_text-and-ot_nonhighlighted_screen_text}

OT_HIGHLIGHTED_SCREEN_TEXT and OT_NONHIGHLIGHTED_SCREEN_TEXT

:::

These two Output Modes should be used to speak text from the SayHighlightedText and SayNonHighlightedText functions.

::: {#ot_keyboard}

OT_KEYBOARD

:::

This Output Mode should be used to speak key labels as keys are pressed on either the main keyboard or Braille keyboard.

::: {#ot_spell}

OT_SPELL

:::

When text is spoken using this Output Mode, it is spelled rather than spoken. If a voice alias has been chosen for spelled text, this voice alias will be used as the text is spelled.

::: {#ot_sayall}

OT_SAYALL

:::

This Output Mode should be used when scripts are used to control a SayAll during the speaking of the units of text.

::: {#internal-output-modes}

Internal Output Modes

:::

The following Output Modes are used internally by JAWS and should only be used when the intent is to override default JAWS behaviour in an equivalent situation. For example, the SayWord function is overridden, the text spoken by that function should use OT_WORD. etc. Another example might be a function which automatically speaks a graphic when it appears on the screen, OT_GRAPHIC should be used:

  • OT_STRING

  • OT_GRAPHIC

  • OT_CHAR

  • OT_WORD

  • OT_FIELD

  • OT_CHUNK

  • OT_LINE

  • OT_TEXT

  • OT_FONT

  • OT_CURSOR.

::: {#braille-specific-output-modes}

Braille Specific Output Modes

:::

The Output Modes which are relevant to Braille are as follows:

  • OT_NO_DISABLE

  • OT_HELP

  • OT_APP_START

  • OT_JAWS_MESSAGE

  • OT_ERROR

  • OT_TOOL_TIP

  • OT_STATUS

  • OT_SMART_HELP

  • OT_TUTOR

  • OT_HELP_BALLOON

  • OT_BRAILLE_MESSAGE.

The only one of this list which is not configurable is OT_NO_DISABLE.

The JAWS Message Format

The JAWS message format allows you to create messages just as if you were typing the text of the message in a text editor or word processor. You no longer have to use string concatenation to produce speech output. The message format also gives you the ability to dynamically add information to your messages through the use of embedded place holders.

Using the message format, someone who is not a programmer can also edit the text of existing messages. You can type any character within the body of your message. JAWS can then speak the text or display the text of your message in the virtual viewer with a single function call to either the SayMessage or SayFormattedMessage function.

Although you can declare messages using the message format within a script source file (.jss), it is best to declare those messages within a script message file (.jsm). You then include the message file within your script file using the "Include" statement discussed earlier.

Message Format

The JAWS message format consists of several key words:

  • Messages

  • @MsgName

  • @@

  • EndMessages

::: {#messages-keyword}

Messages

:::

The Messages keyword indicates the beginning of the message block. It tells the compiler that everything between this line and the EndMessages line is written in the message format. You can place as many messages as you wish within a message block. You should only place this keyword once at the top of your message file following any comments. You do not need to include the Messages keyword for every individual message you create.

::: {#msgname}

@MsgName

:::

The @MsgName statement indicates the beginning of an individual message. The at symbol ("@") indicates the beginning of an individual message. The "MsgName" portion of this statement is the actual name of the message that you designate. You should follow the same rules for naming messages as you do variables, scripts and user-defined functions. You should use no spaces, capitalize the first letter of each word and no punctuation except for the underline character ("_"). You will use the string of text less the at symbol ("@"), to refer to this message in your scripts and functions that speak the message.

All text following the "@MsgName" statement is part of the message body. All characters typed in the message body are literal, meaning that all characters are part of the individual message. You no longer need to use the backslash ("") character in front of any special characters that previously required it for translation. When you want a new line in your message, you can insert it by pressing ENTER.

You can also use placeholders within the body of your message. These placeholders give you the ability to place information gathered during script or function execution into your message. You can use up to nine placeholders within the body of the message. To add a placeholder in the message, you precede the number of the placeholder with the percent sign ("%").

In addition to placeholders, you can use the KeyFor function to display keystrokes within the body of your message. This functionality is available only when displaying messages within the virtual viewer. When the KeyFor function is used, the keystroke is shown in the virtual viewer as a link. The keystroke can be activated by navigating to the link and pressing ENTER.

To add the KeyFor() function to the body of your message, you must precede the name of the function with the percent sign (%). This indicates the point in your message in which JAWS places the desired keystroke. The KeyFor function requires a single parameter: the name of the script for which the keystroke will be displayed. To add the KeyFor function to the body of any message, use the following syntax:

::: {#statement}

@@ Statement

:::

The "@@" statement indicates the end of an individual message. Each @MsgName must be followed by the @@ statement. There are no spaces between the 2 @ symbols.

::: {#endmessages}

EndMessages

:::

The EndMessages key word indicates the end of the Messages block. Each Messages statement must have a corresponding EndMessages statement. You only need to include this key word once in your message file and usually at the bottom of the file.

::: {#example-message-formats}

Example Message Formats

:::

Messages
@MsgTest
This is a test message.
Note that the text is formatted as you would type it or see it in a dialog box.
@@
EndMessages

The above example contains only one individual message within the message block.

Messages
@MsgTest
This is a test message.
Note that the text is formatted, as you would type it or see it in a dialog box.
@@
@MsgTest2
This is a second message.
Note that multiple Messages can be contained within the message block.
@@
EndMessages

The above example contains two individual messages.

You can find many of these messages in the file Common.jsm. It is recommended you include this file in all your script files, as all messages and string constants contained in it begin with the letter "c" or "sc" to avoid conflicts with your existing definitions. The Default.jsm file is still included to support any legacy code that uses the old JAWS system. If you need to copy some of your own scripts into the default file, just include the default.jsm file if you are using constants from there.

The FormatString Function

The FormatString function gives you the ability to dynamically replace text within the individual message using placeholders. As stated earlier, the placeholder uses the percent sign (%) followed by a number. These placeholders can be placed throughout the individual message.

The FormatString function formats the string containing the message and replaces any placeholders with strings of text. the FormatString function then returns the formatted string to the calling script or function. The syntax of the FormatString function is as follows:

Let sMessage = FormatString (MsgName, sString1, sString2, sString3)

The MsgName variable is the individual message declared within the messages block. The parameters listed next are used to replace their respective placeholders within the message.

When you use the FormatString function and do not use all parameters, you must be sure to remove all commas following the last actual parameter used. For example, if you are using the FormatString function to add text to three place holders within a message called MsgText, the line inserted in your script by the Insert Function dialog looks like the following:

Let sMessage = FormatString (MsgText, sText1, sText2, sText3, , , , , , , )

If you use the arrow keys to review the line above, you will notice seven pairs of commas and spaces between the sText3 parameter and the right parenthesis. To ensure no errors are encountered at the time you try to compile the script containing this statement, you must remove the seven pairs of commas and spaces. Failure to do so will result in a "incorrect parameter format" error message when you try to compile the script or function containing the line above.

Let sMessage = FormatString (MsgText, sText1, sText2, sText3) ; removed extra commas and spaces

The number of comma and space pairs may vary based on the number of parameters used to format the message referenced in parameter one. :::

{#formatstring-examples} ### FormatString Examples: :::

The following examples illustrate the use of the FormatString function within a basic "Hello World" script.

::: {#test.jsm}

Test.jsm

:::

; test file containing message statements
Messages
; For msgHello, %1= the first name, %2 = The Last Name
@msgHello
HELLO WORLD! My name is %1 %2.
@@
EndMessages

::: {#test.jss}

Test.jss

:::

; test file To demonstrate the Use of the message format and FormatString Function
Include "HjConst.jsh"; default constants
Include "common.jsm"; default message file
Include "test.jsm"; test message file created above

Script HelloWorld ()
Var
    String sMessage
Let sMessage = FormatString (msgHello, "John", "  "," Doe")
SayFormattedMessage (OT_MESSAGE, sMessage)
EndScript

The spoken output from the above script is:

::: leftbar "HELLO WORLD! My name is John Doe" :::

The SayFormattedMessage Function

In the previous example showing the use of the FormatString function, the SayFormattedMessage function is used to output the text to the synthesizer. The benefit of using the SayFormattedMessage function is that it does a final format of the message in order to account for the %KeyFor() placeholder. The SayFormattedMessage function also gives you the ability to use short and long messages. This added functionality lets you account for the message length option in the Verbosity Options section of the Configuration Manager. You can choose to use short or long messages depending on your verbosity setting and preference.

The SayFormattedMessage function is called using the following syntax:

SayFormattedMessage (OutputMode Constant, LongMessage, ShortMessage)

If you are not using both short and long messages, then you will only need the output mode and long message parameters.

Creating and Speaking Messages Exercises

The following exercises give you practice in creating messages. You will also use the FormatString and SayFormattedMessage built-in functions in these exercises.

Creating a Message File and Adding Messages

The objective of this exercise is to give you practice creating a new message file and adding messages to the file. You will use Notepad for the active application. You will add two messages to the notepad.jsm file. After you have created the messages, you will create a script that speaks those messages.

  1. Activate Notepad from your Start Menu | Accessories group.

  2. From within Notepad, press JAWSKEY + F2 to activate the Run JAWS Managers dialog. Press S followed by ENTER to start the Script Manager.

  3. You need to create a message file for Notepad as it does not have a message file by default. Press CONTROL + N to activate the New File dialog. You are placed in the New list box. The list box contains five entries for creating files. You can use this list box to create a new source file, header file, documentation file, message file, or key map file.

  4. Press M. to select the Messages file (jsm) list item followed by ENTER to create the new message file. When the New File dialog closes, your insertion point is placed in a new untitled message file.

  5. Press CONTROL + S to save the file. This action causes the Script Manager to display the Save As dialog. The focus is in the File Name edit box. Give the new file the name of Notepad. You do not need to include the file extension as the script Manager does that automatically for you.

  6. After the Save As dialog closes, press JAWSKEY + T to read the title bar of the Script Manager. Did you hear the file name of Notepad.jsm?

    When you create script message or header files, give them the same name as the executable file name for the application. This makes it easier for you to locate the message file for a given application should you decide to share the file with someone else. If you are creating a generic message or header file, one not tied to a specific application, you can give it any name you want

  7. You are now ready to add a comment to the top of the file along with the key word used to indicate the beginning of your messages block. Type the following text into your message file:

    ; Message file For Notepad
    Messages
    
  8. Next, you need to add a long message to the message file. If the insertion point is still on the line containing the key word "messages," press ENTER to create a new blank line. Type the following text:

    @MSGText_L
    This is an example of a long message. This message is only spoken by JAWS when the beginner verbosity setting is in Use.
    @@
    
  9. Press ENTER twice on the line containing the two @ symbols. This will create a blank line to separate your long message from your short message.

  10. The short message is next. Type the following text:

    @MsgText_S
    This is an example of a short message.
    @@
    
  11. Press ENTER once to create a new blank line following your short message. Type the following text: "EndMessages"

  12. Press CONTROL + S to save your message file.

    JAWS does not speak "Compile complete." The Script Manager does not compile message files only script source files.

  13. After following the steps above, you should have the following text in the Notepad message file:

    ; Message file For Notepad
    Messages
    @MSGText_L
    This is an example of a long message. This message is only spoken by JAWS when the beginner verbosity setting is in Use.
    @@
    @MsgText_S
    This is an example of a short message.
    @@
    EndMessages
    
  14. Next, you need to create a script that uses the messages you just created. Press CONTROL + TAB to move back to the Notepad.jss script source file.

    You can have more than one file open in the Script Manager at a time. Press CONTROL + TAB to move between the files.

  15. Press CONTROL + HOME to move to the top of the Notepad script source file. You need to include the new message file. Press DOWN ARROW until you reach the blank line following the include statement for the hjconst.jsh file. Type the following text: "Include 'Notepad.jsm' "

  16. After you have typed the text, press ENTER twice to create a new blank line.

  17. Press CONTROL + END to move the insertion point to the bottom of the script file. Press ENTER twice to create a blank line between the last script in the file and your new script.

  18. Press CONTROL + E to activate the New Script dialog and ENTER the following information in the fields in the dialog:

    1. Script Name: SpeakMessage

    2. Can be Attached to Key: checked

    3. Synopsis: Speaks long and short messages in notepad.

    4. Description: Speaks long and short messages in Notepad using the SayFormattedMessage function.

    5. Category: none

    6. Assign to: CONTROL + 3

  19. After you have entered all the information above, press ENTER to close the dialog.

  20. Press UP ARROW to move to the first blank line in the body of the SpeakMessage script.

  21. Press CONTROL + I to activate the InsertFunction dialog. The focus is placed in the Function Name edit box. Look for the built-in function SayFormattedMessage. When you find the function, press ENTER. JAWS prompts you for the first parameter, output type. Type the following text: "OT_MESSAGE"

  22. Press ENTER. JAWS prompts you for the second parameter, the long message. Type the following text in the Parameter 2 edit box: "MsgText_l"

  23. Press ENTER. JAWS prompts you for the third parameter, the short message. Type the following text in the Parameter 3 edit box: "MsgText_s"

  24. You do not need to ENTER any information for the remaining parameters after the short message name. Press TAB to move to the Finish button and press ENTER to close the InsertFunction dialog. Make sure to remove the extra commas and spaces before the right parenthesis

  25. Press DOWN ARROW to move to the next line. Press DELETE. repeatedly until you have removed all blank lines from the script. After you have completed the previous steps, your script should look like the following:

    Script SpeakMessage ()
    SayFormattedMessage (OT_MESSAGE, MsgText_l, MsgText_S)
    EndScript
    
  26. Press CONTROL + S to compile the Notepad script source file. If you hear JAWS speak, compile complete, switch to Notepad and test your script. If you encountered syntax errors, compare your script to the one shown above. Continue to compile your script until you hear JAWS speak compile complete.

  27. To test your script, use the Adjust JAWS Options dialog to change your verbosity setting from beginner to intermediate to advanced. You can access the Adjust JAWS Options dialog by pressing JAWSKEY + V. After you have opened the Adjust JAWS Options dialog, press U. to move to the User Verbosity option. Press SPACEBAR to cycle through the options. When you have selected the desired option, press ENTER to close the dialog and save the verbosity setting change. Each time you switch the verbosity setting, test your script. JAWS should only speak the long message when you are using the beginner verbosity setting. JAWS should speak the short message when you use either intermediate or advanced verbosity setting.

Additional Practice: Extend your Notepad message file with an additional message and modify your script to choose which message to speak based on context (for example, active window title, selection state, or a user setting). What conditions would you check, and how would you structure the code to keep it maintainable?

Using Placeholders

The objective of this exercise is to give you practice using placeholders in your messages, formatting your messages, and speaking those messages. This exercise should be completed in the Notepad script source and message files. If you do not have Notepad or the Script Manager running, refer to steps 1 and 2 in the previous exercise to get started.

  1. Within the script Manager, press CONTROL + TAB until you reach the notepad.jsm message file.

  2. Press CONTROL + END to move to the bottom of the file.

  3. Press UP ARROW until you reach the line containing "EndMessages." Press HOME. to move the insertion point to the beginning of the line.

  4. Press ENTER twice to create a blank line between the last individual message in the messages block and your new message.

  5. Type the following text in the notepad message file:

    @MsgMyName
    Hello, my name is %1 %2. You can just call me %1.
    @@
    
  6. Press CONTROL + S to save the changes to the Notepad message file.

  7. Press CONTROL + TAB to move to the Notepad script source file, Notepad.jss.

  8. Press CONTROL + END to move to the bottom of the file. Press ENTER twice to create a blank line between your last script and the new script.

  9. Press CONTROL + E to activate the New Script dialog. Type the following information into each control within the dialog:

    1. Script Name: SpeakMyName

    2. Can be Attached to Key: checked

    3. Synopsis: Speaks a message containing my name.

    4. Description: Speaks a message containing my name in Notepad. The message uses placeholders.

    5. Category: none

    6. Assign to: CONTROL + SHIFT + N

  10. After you have filled in all of the fields, press ENTER to close the New Script dialog.

  11. Press UP ARROW to move the insertion point to the first blank line in the body of the script. You need to create a local variable declaration section here. Type the following text:

    Var
        String sMessage
    
  12. After you have typed in the variable declaration statement for sMessage, press ENTER to move the insertion point to a new blank line. Type the following text:

    Let sMessage =
    

    Be sure to type a space after the equals sign. This allows for proper spacing when you insert the next function.

  13. Press CONTROL + I to activate the InsertFunction dialog. You need to find the built-in function, FormatString. Once you have located the function, press ENTER to begin adding the parameters.

  14. The first parameter the function requires is the name of the message that contains the text and placeholders. Type the following text: "MsgMyName"

  15. Press ENTER. JAWS accepts the first parameter and then prompts you for the second parameter.

  16. The second parameter is the information that replaces the first placeholder in your message. Type your first name surrounded in quotation marks, for example "John."

  17. Press ENTER to accept the parameter. JAWS prompts you for the third parameter. This parameter is the information that replaces the second placeholder within your message. Type your last name surrounded by quotation marks. For example, "Doe."

  18. Instead of pressing ENTER to accept this parameter, move to and activate the Finish button. The finish button tells JAWS you are finished entering parameters for the function. After the InsertFunction dialog closes, your insertion point is at the end of the line you just entered. Read the line with JAWSKEY + UPARROW. JAWS should speak the following text: "let sMessage = FormatString (MsgMyName, 'John', 'Doe', , , , , , , , )"

  19. You need to remove all the commas and spaces following the quotation mark following your last name. Press LEFT ARROW until you reach the comma immediately following the quotation mark. Press DELETE. repeatedly to remove all commas and spaces until you reach the right parenthesis. The line should look like the following:

    Let sMessage = FormatString (MsgMyName, "John", "Doe")
    
  20. Press END. to move to the character following the right parenthesis. Press ENTER to complete the line. Your Insertion point is now on a new blank line.

  21. Press CONTROL + I to activate the InsertFunction dialog. You are looking for the built-in function, SayFormattedMessage. Once you have located the function, press ENTER.

  22. JAWS prompts you for the first parameter for the SayFormattedMessage function. This parameter is the output mode. Type the following text: "OT_MESSAGE"

  23. Press ENTER to accept the parameter. JAWS prompts you for the next parameter, the long message.

  24. This parameter is the return value from the call to the FormatString function, sMessage. This is the message that has been formatted with your name replacing the placeholders. Type the following text: "sMessage"

  25. Press ENTER to accept the parameter. JAWS then prompts you for the third parameter. This is the short message. You do not need this parameter or any of the remaining parameters; so, activate the Finish button to close the InsertFunction dialog.

  26. Your Insertion point is at the end of the line. Press JAWSKEY + UPARROW to read the current line. JAWS should speak: "SayFormattedMessage (OT_MESSAGE, sMessage, , , , , , , , , , )"

  27. You need to remove the commas immediately following the sMessage parameter. Press LEFT ARROW until you reach a comma. Press DELETE. until you remove the commas and spaces. The line should now look like the following:

    SayFormattedMessage (OT_MESSAGE, sMessage)
    
  28. Press DOWN ARROW once to move to the next line. If this line is blank, press DELETE. to remove it and any other blank lines.

  29. After following the steps above, your script should look like the following:

    Script SayMyName ()
    Var
    String sMessage
    Let sMessage = FormatString (MsgMyName, "John", "Doe")
    SayFormattedMessage (OT_MESSAGE, sMessage)
    EndScript
    
  30. Press CONTROL + S to compile the Notepad script source file. If you did not hear JAWS speak "Compile Complete," return to your script. Correct the error the Script Manager noted and try compiling your script again. Continue this process until you hear "Compile complete."

    When the Script Manager encounters an error, the line containing the error is highlighted.

  31. Return to Notepad and test your script. Did JAWS speak the message?

Using the SayFormattedMessage Function to Substitute Placeholders

New to JAWS 12 update 1, is the ability to replace placeholder values directly in the SayFormattedMessage function rather than having to use the FormatString function to do so. This eliminates the need for the sMessage variable and the FormatString function. If using this method, the script would look like the following.

Script SayMyName ()
SayFormattedMessage (OT_MESSAGE, MsgMyName, MsgMyName, "John", "Doe")
EndScript

Additional Practice: Refactor your message to support additional placeholders (for example, title, greeting, time of day) and experiment with filling them using both FormatString and direct SayFormattedMessage substitution. Which approach is clearer and less error-prone as messages grow?

Adding An InputBox Function

The objective of this exercise is to modify the script created from exercise 8.2 above. Instead of using quoted strings of text as parameters for the FormatString function, use a built-in function to prompt for the first and last name values. You can use the built-in function, InputBox, to accomplish this task. The function displays a dialog box using the title and prompt you specify. When you type information into the edit box contained in the dialog and activate the Ok button, the function returns the text as a string. The InputBox function uses three parameters:

  1. string of text for the dialog prompt

  2. string of text for the title of the dialog box

  3. variable to contain the text typed in the dialog

You should create two additional local variables. The first variable should store the first name. The second variable should contain the last name. When you have made the modifications to the script, it should look like the following:

Script SpeakMyName ()
Var
    sMessage,
    String sFirstName,
    String sLastName
InputBox ("Enter your first name:", "First Name Entry", sFirstName)
InputBox ("Enter your last name:", "Last Name Entry", sLastName)
Let sMessage = FormatString (MsgMyName, sFirstName, sLastName)
SayFormattedMessage (OT_MESSAGE, sMessage)
EndScript

After you have modified the script, compile the script. When you hear the "Compile complete" message, return to Notepad, and test the script.

Additional Practice: Expand the script to prompt for a middle name and nickname, validate empty input or cancellation, and fall back to sensible defaults. How will you handle user cancellation gracefully while keeping the flow simple?

::: .hint For more information on the InputBox function, open the builtin.jsd script documentation file within the Script Manager. :::

1

Released 2005



The Virtual Viewer

In previous versions of JAWS, the virtual viewer was only used in applications such as Internet Explorer and Microsoft Outlook Express. When you pressed JAWSKEY + H to review the list of JAWS hot keys for a given application, the keystrokes were spoken and you had no way of reviewing the list without pressing JAWSKEY + H a second time. This functionality, at times, made it difficult to get the desired hot key for the application.

JAWS now displays all help messages such as those created for the hot key help script performed by pressing JAWSKEY + H, the JAWSKEY + W, and JAWSKEY + F1 in the virtual viewer. When JAWS displays the information in the virtual viewer, the virtual cursor is active. You can use the normal navigation keystrokes to read, select, and copy the selected text to your favorite text editor.

You can use this same functionality in your scripts to display help information. From a script development standpoint, the virtual viewer is a Virtual Buffer created using the JAWS Scripting Language as the interface. The virtual viewer is also known as the user buffer.

The JAWS message format gives you greater flexibility when displaying text in the virtual viewer. You can format the text using spaces, carriage returns, tab stops, etc. After formatting your message, JAWS displays the text in the virtual viewer with the same look and feel as text found in a text editor or word processor. By default, JAWS displays all text in the virtual viewer in black on a white background (except for links). The text also has a font type of Arial, and a point size of 12.

Displaying Text in the Virtual Viewer

Before you display text in the virtual viewer, you should check the status of the virtual viewer to make sure it is not currently being displayed. You can use the built-in function, UserBufferIsActive, to check the status of the virtual viewer. The function returns a value of 1 when the virtual viewer is active or displayed and a value of 0 when the viewer is not being displayed. When the virtual viewer is active, you can use the built-in function, UserBufferDeactivate, to close the virtual viewer prior to redisplaying text. Deactivating the virtual viewer before JAWS displays new information prevents the user buffer text from running together.

The following code example illustrates the use of the UserBufferIsActive() and UserBufferDeactivate() functions. You should place these statements before the virtual viewer is activated by either the SayMessage or SayFormattedMessage functions.

If UserBufferIsActive () Then
    UserBufferDeactivate () ; closes the virtual viewer
EndIf

You can use either the SayMessage and SayFormattedMessage functions to display information in the virtual viewer. You pass the output type of OT_User_Buffer as the first parameter in either function to tell JAWS to display the message in the virtual viewer. Each function also accepts two additional parameters. The second parameter is the long message. This is the text of your message and can be in the form of a message contained in a message file, a string of text or a string variable containing the message. The third parameter contains the short message. Like the long message, the short message can be a message contained in a message file, a string of text or a string variable containing the message. If you are displaying information in the virtual viewer, JAWS ignores this parameter. Therefore, it is not necessary to pass any information in this parameter.

You can call either function using the following syntax:

SayMessage (OT_USER_BUFFER, "This text is being displayed in the virtual viewer")
; OR
SayFormattedMessage (OT_USER_BUFFER, "This text is being displayed in the virtual viewer.")

You can also create keystroke links in the virtual viewer by using the %KeyFor function. The %KeyFor function replaces the older use of the GetScriptKeyName function. Using the older method of speaking or displaying messages, you had to concatenate the string using the GetScriptKeyName function. Using the new message format, you can insert the script name directly into your message by adding the following line:

The percent sign preceding the function name acts as a placeholder for the keystroke. When the message is displayed in the virtual viewer, the function retrieves the keystroke for the script named in the functions parameter. The keystroke is displayed as a link that can be activated by pressing ENTER on the line containing the keystroke.

Inserting a space between the %KeyFor and the left parenthesis will display the keystroke as normal text and not as a link. :::

{#example-of-displaying-text-in-the-virtual-viewer} ### Example of Displaying Text in the Virtual Viewer :::

The following script and message file additions illustrate the use of the JAWS message format to display text in the virtual viewer:

::: {#test.jsm-1}

Test.jsm

:::

Const ; Strings For edit prompt:
    sDlgName = "Enter Name",
    sFirstPrompt = "First Name: ",
    sLastPrompt = "Last Name: "

Messages
; For msgHello, %1= the first name, %2 = The Last Name
@MsgHello
HELLO WORLD! My name is %1 %2.
Press, %KeyFor(HelloWorld), To redisplay this message.
Press ESCAPE To close this message.
@@
EndMessages

::: {#test.jss-1}

Test.jss

:::

Include "HjConst.jsh"; default constant definitions
Include "HjGlobal.jsh"; default global variable definitions
Include "common.jsm"; default virtual viewer constants and Messages
Include "test.jsm"; test message file

Script HelloWorld ()
Var
    String sFirstName,
    String sLastName,
    String sMessage
If UserBufferIsActive () Then; determine If user buffer is active
    UserBufferDeactivate (); close or deactivate the virtual buffer
EndIf
InputBox (sFirstPrompt, sDlgName, sFirstName) ; prompt For the first name
InputBox (sLastPrompt, sDlgName, sLastName) ; prompt For the last ;name
Let sMessage = FormatString (MsgHello, sFirstName, sLastName)
; replace the % place holders with data
SayFormattedMessage (OT_USER_BUFFER, sMessage) ; display the message in the user buffer
EndScript

In the above example, the script begins by checking the status of the virtual viewer. If the viewer is active, then JAWS deactivates it before the script continues processing. The two InputBox statements retrieve the first and last names from user input. The FormatString function then takes the first and last name information and combines it with the message to create a final version of the message. The message is then displayed in the virtual viewer using the SayFormattedMessage function.

If you create the script above, assign it to CONTROL + 1 and you enter "John" for the first name and "Doe" for the last name, JAWS displays the following text in the virtual viewer:

::: leftbar "HELLO WORLD! My name is John Doe. Press, CONTROL + 1, to redisplay this message. Press ESCAPE to close this message." :::

Using the Virtual Viewer Exercises

The following exercises give you practice creating and using messages in the virtual viewer. Before you start these exercises, make sure you have the Notepad.jss script file open within the Script Manager. This file should contain any practice scripts from earlier chapters of this manual. If you run Script Manager from within Notepad and a blank file is opened, type the following lines at the top of the file:

; Script file For Notepad
; JAWS version 12.0
Include "hjconst.jsh"
Include "common.jsm"

Displaying a Message in the Virtual Viewer

The objective of this exercise is to create a message and display it in the virtual viewer. You should start Notepad and run the Script Manager from within Notepad for this exercise. Before you write your script, you need to create the message used by your script in the Notepad.jsm message file. You can open the file within the Script Manager and add your message. If you already have a Notepad.jsm message file, do the following to open the file in the Script Manager:

  1. Press CONTROL + O to display the Open File dialog.

  2. Type Notepad.jsm in the File Name edit box and press ENTER.

  3. If you have not previously created the Notepad message file, perform the following:

    1. Press CONTROL + N to display the New File dialog.

    2. The active control is a list of file types. Press M. to select Messages followed by ENTER. This will open an untitled message file in the Script Manager.

    3. Type the following text in the file:

      ; Message file For Notepad
      Messages
      EndMessages
      
  4. Press CONTROL + S to save the file. JAWS prompts you for the filename. Type Notepad in the File Name Edit box followed by ENTER.

Now you are ready to insert the individual message in the Notepad.jsm message file. To add the individual message, perform the following:

  1. Press UP ARROW until you reach the line entitled "Messages."

  2. Press END. to move to the end of the line.

  3. Press ENTER twice to create two blank lines.

  4. Type the following message:

    @MsgVirtualViewer
    This text is being displayed in the virtual viewer. You can Use the virtual viewer To display helpful Messages and other information.
    Press ESCAPE. To close this message.
    @@
    
  5. Press CONTROL + S to save the file.

  6. Press CONTROL + TAB to move back to the Notepad.jss script source file.

    After you have moved back to the Notepad.jss script file, be sure to include the Notepad.jsm file. Failure to do so will result in errors at the time of compilation. For more information on the include statement see 5.0 Creating Scripts.

After you have added the message to the Notepad.jsm message file, you are ready to create the script. Your script should begin by determining if the virtual viewer is currently being displayed. If it is, then use the UserBufferDeactivate function to close the viewer before displaying the new message. After you have determined if the viewer is active and closed it if necessary, you should use the SayFormattedMessage function to display the message in the virtual viewer.

DisplayVirtualViewer Script Documentation:

  1. Script Name: DisplayVirtualViewer

  2. Can be Attached to Key: checked

  3. Synopsis: Displays a message in the virtual viewer.

  4. Description: Displays a message in the virtual viewer using the SayFormattedMessage function.

  5. Category: None

  6. Assign to: CONTROL + SHIFT + V


Script DisplayVirtualViewer ()
If UserBufferIsActive () Then
    UserBufferDeactivate ()
EndIf
SayFormattedMessage (OT_USER_BUFFER, MsgVirtualViewer)
EndScript

Additional Practice: Display context-sensitive help in the virtual viewer based on the active control (for example, edit field vs. button). What heuristics or APIs would you use to choose and update the content?

Displaying Keystrokes in the Virtual Viewer

The objective of this exercise is to take the previous exercise and add a keystroke link to the message JAWS displays in the virtual viewer. To add a keystroke to the message, you need only modify the message, save the message file and recompile the Notepad.jss script file. Start by performing the following steps to modify the message from the previous exercise:

  1. Press CONTROL + TAB until you reach the Notepad.jsm file.

  2. Press CONTROL + END to move the Insertion point to the bottom of the file.

  3. Press UP ARROW until you reach the line containing the text of "Press ESCAPE. to close this message."

  4. Press HOME. to move to the beginning of the line followed by ENTER twice. This will insert two blank lines above the current line of text.

  5. Press UP ARROW to move to one of the blank lines.

  6. Type the following text on this line:

    Press %KeyFor(DisplayVirtualViewer) To redisplay this message
    
  7. Follow this text by pressing ENTER twice.

  8. After you complete the above steps, your message should look like the following:

    @MsgVirtualViewer
    This text is being displayed in the virtual viewer. You can Use the virtual viewer To display helpful Messages and other information.
    Press %KeyFor(DisplayVirtualViewer) To redisplay this message.
    Press ESCAPE. To close this message.
    @@
    
  9. After you have modified the individual message, press CONTROL + S to save the message file. You then need to recompile the Notepad script file.

When you receive the "compile complete" message, you can move back to Notepad. Test the script by pressing the keystroke to activate the script. Your message should be displayed in the virtual viewer. Use the arrow keys to move through the message. Did you hear JAWS speak the keystroke as a link? If so, then press ENTER on the link to redisplay the message. If not, then return to the Script Manager and make sure your message is identical to the message shown above.

Additional Practice: Add multiple keystroke links (for example, open settings, toggle verbosity, show help) and implement link activation handlers. How will you ensure the viewer content stays synchronized with actual key bindings?



JAWS and Braille

When you use a Braille display in structured mode, you can control the order and type of information shown on the display. There are several parts of JAWS that work together to place the desired information on the display. These areas include:

  • JAWS user interface

  • Configuration Manager

  • JAWS Braille structured file

  • Default Braille functions

The JAWS user interface and Configuration Manager are used to customize the information shown on your display. The Braille structured file contains settings used by JAWS to determine the type and order of information shown on the display. The default Braille functions are called internally from within JAWS to place the desired information on your display.

JAWS User Interface and Configuration Manager

You can access the Braille Options section of Configuration Manager in one of two ways. To reach the Braille Options section through the JAWS user interface, do the following:

  • Press JAWSKEY + J to activate the JAWS user interface.

  • Press ALT + O to open the Options menu.

  • Press L to open the Braille Basic settings dialog.

  • Press ALT + A to activate the Advanced... button.

  • You are placed in the Braille Options section of the default configuration file, Default.jcf, within Configuration manager.

To reach the Braille Options section through the Configuration Manager, do the following:

  • Press JAWSKEY + F2 to display the JAWS managers list.

  • Press ENTER on Configuration Manager. This is the first item in the list so you will need to type C to reach the item.

  • Press ALT + S to open the Set Options menu.

  • Press B to open the Braille Options dialog.

When running Configuration Manager, the file being modified will depend on the active application when Configuration Manager is run. :::

The JAWS Braille Structured File

The JAWS Braille structured or .jbs file contains settings used by JAWS to determine what is shown on a Braille display. Changes made to the type or order of information shown on the display are stored in these files. The .jbs file is an .ini style file that contains section names, keys, and key values.

The default version of the .jbs file, Default.jbs, contains the settings used by JAWS to display information throughout the operating system. Application specific .jbs files are used to store settings changes for specific applications.

The Default Braille Functions

The functions used internally by JAWS to place information on a Braille display are contained in the Braille.jss script source file. All functions that begin with BrailleAddObject place a specific piece of information on your Braille display. For example, the BrailleAddObjectName function adds the name of an object to the Braille display. This name is the name of the active item whether it is a combobox, listbox, or an edit box.

Section 2: Changing Structured Components

As you use your Braille display in structured mode, you can control the order and type of information shown on the display. Each time you make changes in the Braille Options section of configuration manager, those changes are reflected in either the default JAWS Braille structured or application specific JAWS Braille structured file.

When you choose the Braille Options item from the Configuration Manager, the Braille Options dialog box is displayed. This dialog box contains all the settings you can use to customize your Braille display.

When you activate the Define Structured Mode... button from within the Braille Options dialog, the Control Type Options dialog is displayed. This dialog is a multi page dialog and consists of the Control Properties and State Properties pages.

Control Type Properties Page

This page is the active page of the Control Type Options multi page dialog when the Modify Structured Mode... button is activated. This page allows you to change the type and order of components shown on your Braille display for the selected control.

{#control-types-list-box} ### Control Types List Box :::

This list box contains all the control types JAWS shows on the Braille display. The list box has 2 columns. The first column contains the actual control name such as button or checkbox. The second column contains the symbol for the control that is shown on the Braille display. For example, a button has an entry in the list box of: button btn

::: {#modify-control-button}

Modify Control... Button

:::

The modify control button, when activated, lets you change the type and order of information shown on the Braille display. When this button is activated, the define properties dialog for the highlighted item in the control types list is displayed. The focus is placed in the Show on Display Combo box. This combo box lists all the components that are shown on the Braille display for the selected control. You can think of a component as a piece of information shown on your Braille display about the highlighted control. Examples of components are name, type, state, and value.

You can use the Remove button to remove the highlighted component from the list, or use one of the movement buttons to change the order of components shown on the display. For example, when the control type of button is highlighted, the Show On Display combo box lists name, type, and state in this order.

When you remove a component from the list, the component is shown in the Available Items to Add list box. Once you have removed a component, the add button is available. If you decide at a later date that you want that component shown on the display, the Add button is used to place the removed component back into the Show On Display combo box.

::: {#modify-braille-symbol-button}

Modify Braille Symbol... Button

:::

When you activate this button, the Control Properties dialog box is displayed. The focus is placed in an edit box containing the current symbol for the highlighted component in the control types list. This is the symbol that is shown on the Braille display and represents the component. You can change the characters used to represent the component by typing a new value. For example, when the control type of button is highlighted, the Braille symbol shown in this dialog is btn. You can change the symbol from btn to bt or another value of your choice.

State Properties Page

When this page of the Control Type Options dialog is active, the focus is placed in a list box containing the various states used to show control states on your Braille display. Examples of entries found in this list box are:

  • Unchecked < >

  • PartiallyChecked <->

  • checked <X>

The above examples are all used on a Braille display to represent the checked, partially checked, and unchecked states of a check box. You can modify the characters used to represent the states of various controls by pressing TAB to the Modify Braille Representation button, or, by pressing F2.

Section 3: The JAWS Braille Structured File

When you modify structured mode, those changes are stored in a JAWS Braille structured or jbs file. The jbs file is an ini style file consisting of a variety of sections and keys. You can modify structured mode so that the changes take effect across the entire operating system or in a specific application. When you make changes globally, those changes are stored in the default JAWS Braille structured file, default.jbs. If the changes you have made to structured mode are application specific, then those changes are stored in the jbs file for the active application.

Some of the sections found in the default jbs file, default.jbs, include control type, component aliases, state aliases, and control states. Each of these sections is used internally by JAWS to determine what is shown on a Braille display.

Component Aliases Section

This section defines component aliases used internally by JAWS to display information on your Braille display. It is also used to display component information in the Braille Options Control Options Control Properties dialog in Configuration Manager. Component aliases make the connection to the components contained in the jbs file and the information shown in the Control Options Control Properties dialog.

A component alias consists of an ini style key and it's corresponding value. The key is used within the jbs file to determine what is shown on a Braille display and in what order. The key value is more descriptive and used within the Control Options Control Properties dialog. An example of a component alias follows:

dlgTEXT=Dialog Text

In the above example the key, dlgTEXT, is used within the jbs file. This key value tells JAWS to display dialog text on your Braille display. The key value, dialog text, is what you see in the Control Options Control Properties dialog.

State Aliases and Control States Sections

The state aliases section is used to determine what is shown in the Control Options State Properties dialog for control states. Some of the controls that can have various states are buttons, checkboxes, and tree views.

Each item listed in this section consists of an ini style key and it's corresponding value. The key is used internally by JAWS to indicate the state of a control such as a checkbox or a button. The corresponding key value is used within the Control Options State Properties dialog as an English representation of the state. An example of a state alias follows:

csChecked=Checked

In the above example the key, csChecked, is used internally by JAWS to show a checked state for a checkbox. The key value, checked, is listed in the Control Options State Properties dialog.

The control state section of the default jbs file consists of key and key values that determine what characters are shown on a Braille display for a given control state. The key is used by JAWS to display the control state on your display. The corresponding key value is the actual characters that are used to show the state on the display. An example of a control state is: csChecked=<X>

In the above example the key, csChecked, is used internally by JAWS to show a checked state for a checkbox on a Braille display. The key value, <X>, are the characters actually displayed on the display when a checkbox has a checked state.

Both of these sections work together to create a link between the information shown in the Control Options State Properties dialog and the characters shown on a display for a given control state. It is the key values in both examples that are displayed in the Control Options State Properties dialog. The key value is the link between both sections. The entry in the user interface for a checked control state is: Checked <X>

The key value, csChecked, makes the link between the state alias of "Checked" and the control state of "<X>". When you make a change to the state shown on your display for a checkbox that is checked, it is the Control State entry that is modified. For example, you decide to change the checked state representation of <X> to <Y> for a checkbox. After you make the change in the Control Options State Properties dialog, the control state key value is modified in the jbs file and looks like: csChecked=<Y>

Control Type Section

Each standard windows control has a section located in the default jbs file. This section tells JAWS what components to show on the Braille display, what order they are to be shown, and the Braille symbol to be used for the control. The control type section uses the subtype code of each window JAWS recognizes as part of the section name. In the default jbs file, you will find sections for control types such as button, combo box, list box, and so on.

Each control type section contains 4 keys with their respective values. The names of these keys are:

  • components

  • type

  • removed

  • displayname

An example of a control type section follows:

; Section For checkbox
{[}SubtypeCode20{]}
components=name,state,type
type=chk
removed=
displayname=

::: {#components-key}

Components Key

:::

The components key and its respective value tell JAWS what to show on your display and in what order. The key value consists of components found in the components aliases section discussed earlier. When you modify the order or components shown on your display from the Control Options dialog found in the Braille Options section of Configuration Manager, the changes are saved in this key for the control you are modifying.

Using the control type section for a checkbox from above, the components key has a value of name, type, value. The key value tells JAWS to display the name of the checkbox first, the type of control second, and the state of the checkbox third.

::: {#type-key}

Type Key

:::

The type key contains the characters used by JAWS to display the type of control on your display. The type key is used within the components key to display the control type. From the control type section for a checkbox from above, the characters shown on your display for a checkbox are chk.

When you make changes to the Braille symbol used to show the control type on your display, the change is stored in this key. For example, you decide that you want to change the chk used to show the checkbox control type. If you change the symbol to ck, the type key entry for a checkbox would look like: type=ck

::: {#removed-key}

Removed Key

:::

The removed key and its corresponding value list any components that have been removed from within the user interface. For example, if you decide to remove the state component from the components key for a checkbox then the removed key looks like: removed=state

After the modification, the components key looks like: components=name,type

::: {#display-name-key}

Display Name Key

:::

The displayname key and its corresponding value contain the display name of the control in the JAWS user interface. This line is normally used for custom controls which do not have a SubTypeCode associated with them.

Section 4: Adding Custom Components

When the default Braille support within JAWS does not show the correct information on a Braille display, it may be necessary to modify the components shown. For example, you may be working with an application that does not show the dialog box name on the Braille display. In this instance, it may be difficult to easily identify what dialog box is active based solely on the information shown on the Braille display.

You can find a good example of default functionality not displaying all relevant control information in the Microsoft Outlook 2003 email application. When you choose to display the Navigation Pane by pressing ALT + F1, the application displays a tree view containing all of your e-mail folders on your system. The application also displays the total of unread messages for each folder to the right of the folder name. By default, JAWS does not show this extra information on your Braille display. Thus, the following information is shown for the Inbox folder:

::: {#tv-inbox}

Tv Inbox

:::

This information tells you that the active control is a tree view, and the folder name is Inbox. However, the total number of unread messages is not shown. If you were only using Braille without speech, then you would not have this additional piece of information available to you.

In order to provide the equivalent information in both speech and Braille, the script developers at Freedom Scientific had to alter the way in which information is shown on your Braille display for tree views. In addition to the default information, the script developers added the additional unread message information through additions to the Braille structured file for Microsoft Outlook 2003, Microsoft Outlook 2003.jbs. IN addition to these changes, additional functionality was added to the Microsoft Outlook 2003 script file to allow JAWS to correctly show this information on your display.

By making these changes, complete information about the active tree view item is shown. Now in addition to the name, type, level and other information relating to a tree view item, the number of unread messages is also shown. So, now the following is shown on your Braille display for a tree view item that has unread messages:

::: leftbar Tv 8 unread Inbox :::

Adding extra information on a Braille display involves two procedures:

  • Modifying the application specific .jbs file

  • Creating an application version of a Braille function

After these two procedures are completed, complete information is shown on the Braille display.

Modifying the Application Specific .JBS File

The first step to adding information to a Braille display involves creating a component alias in the application specific .jbs file. The component alias is then used in the section of the control for which the extra information is to be displayed.

Using the Outlook 2003 example from above, the component aliases and dialog control sections of the Microsoft Outlook 2003.jbs file look like the following:

{[}Component Aliases{]}
UnreadMessageCount=Number of Unread Messages
; Section For treeview.
{[}SubtypeCode31{]}
components=ContextHelp, name, type, level, value, state, position, UnreadMessageCount
type=tv
removed=
displayname=

The string of text to the left of the = sign in the line, "UnreadMessageCount=Number of Unread Messages," is used in the "components=" line of the tree view control section, [SubTypeCode41], to list the additional component information on the Braille display. The string of text to the right of the = sign is displayed in the Control Type Properties Define Control dialog.

Creating an Application Specific Version of a Braille Function

In order to show the custom component on the Braille display, you should create an application specific version of one of the BrailleAddObject... functions. The function to be created depends on the component you wish to show on the Braille display. Using the Microsoft Outlook 2003 example from above, an application specific version of any the BrailleAddObject... function should be created in the Microsoft Outlook 2003.jss file. For our purposes here, we will use the default version of the BrailleAddObjectName function. The code of the function follows:

Int Function BrailleAddObjectName(Int nSubtypeCode)
Return False
EndFunction

The code of an application specific version of the BrailleAddObject... function follows:

Void Function BrailleAddObjectUnreadMessageCount (Int nSubTypeCode)
Var
    Int nAttribBits
Let nAttribBits = GetCharacterAttributes()
If GetCurrentControlID() ==ciFolderTreeView Then
    If !StringIsBlank (gsUnRedMsgs) Then
        BrailleAddString (gsUnRedMsgs,0,0,nAttribBits)
        Return True
    EndIf
EndIf
Return False
EndFunction

Both functions require the subtype code to be passed as a single parameter and return an integer value. It is important to note the difference between the default and application specific versions of this function. The default function name ends with the word "Name", while the application specific version of the function has the string, "UnreadMessageCount ", before the "BrailleAddObject" contained within the function name. The "UnreadMessageCount " portion of the function name tells JAWS to add the component, UnreadMessageCount to the Braille display.



Web Scripting

Placemarkers

PlaceMarkers allow you to quickly and easily navigate to commonly used areas of your favorite Web pages or HTML documents. You can use PlaceMarkers to jump between certain areas of a page, mark important sections of an HTML document, or indicate key form elements. For example, you could use PlaceMarkers to move to required fields in a complicated form or specific paragraphs in a long HTML document.

There are two types of PlaceMarkers, fixed and temporary. Only one Temporary PlaceMarker can exist at a time but you can move it simply by dropping it in a new location. You drop the Temporary PlaceMarker by pressing CONTROL + WINDOWS + K. If you then move to some other place and press the same keystroke again, it will remove the Temporary PlaceMarker from the previous location and place it at the current location. The Temporary PlaceMarker, if assigned, will also appear in the List of PlaceMarkers discussed below.

When you open a Web page press textcolorbbeK to move to the next PlaceMarker, or press SHIFT + K to move to the prior PlaceMarker. Press CONTROL + SHIFT + K to display a list of all PlaceMarkers on the current page. Use the UP/DOWN ARROW keys to select a PlaceMarker in the list. Then press ENTER to activate the Move To button. You can also press TAB to move to the Move To button and press SPACEBAR on it or press ALT + M to activate it and move your cursor to the PlaceMarker's location on the page.

Adding PlaceMarkers Move your cursor to the location on the page where you want to put the PlaceMarker Press CONTROL + SHIFT + K Press SPACEBAR on the Add button or press ALT + A. JAWS suggests a name for the PlaceMarker based on the text present at your cursor's current location. You can ENTER a new name if necessary Press SPACEBAR on the OK button to add the PlaceMarker to this page NOTE: Use the Anchor to Text checkbox in the Add Placemarker dialog box to tie a placemarker to a specific word or phrase. This will keep the placemarker in the proper place even if the location of the text changes on the page.

Putting a placemarker at the beginning of the search results in Google. The Custom page Summary Use the Custom Page Summary to have JAWS read the contents of placemarkers on a page when the page loads. The information can either be spoken or placed in the virtual viewer for reading. To temporarily turn on the Custom Page Summary, press JAWSKEY + V and modify the Custom Page Summary option found in the list. Follow the steps below to permanently change the setting.

  1. In Internet Explorer, press JAWSKEY + F2.

  2. Select Settings Center, and press ENTER.

  3. Focus is in the Search edit box. Type in "Summary" without the quotes.

  4. Press DOWN ARROW to move to "Custom PlaceMarker Page Summary" in the filtered results of the tree view in Settings Center.

  5. Press SPACEBAR to choose to speak, list, or ignore PlaceMarkers. If you choose List PlaceMarkers in virtual viewer on page load, JAWS reads the custom PlaceMarker page summary and displays the information in the virtual viewer.

  6. Press TAB to move to the OK button and activate it with the SPACEBAR. The changes are made and saved. Settings Center closes.

Additional Practice: Design a custom page summary template that adapts per site (for example, news site vs. portal). What rules and data would you include, and how would you maintain them over time?

Custom Labels

JAWS allows you to assign custom text labels to almost any HTML element that you can move to by pressing the TAB key in Internet Explorer and Web-based documents. These elements include text links, graphic links, form fields, and buttons. You can also label images on Web pages. JAWS reads these custom labels instead of the identifying text assigned to the elements by the Web page author. JAWS also uses custom labels to identify elements when they appear in lists, such as the list of form fields that displays when you press JAWSKEY + F5. You can use this feature to customize the elements of any Web page to help you navigate the page, reduce verbosity, compensate for incomplete or poorly labeled elements, and similar functions.

You can also use this feature to label form fields in Microsoft Word and Adobe Acrobat or Reader.

JAWS saves the labels you assign to a Web page so they are available each time you use that page. In addition, the labels you create are applied to identical elements any time they appear in that page's domain. For example, if you assign a label to a button, JAWS reads that label any time you encounter the button on any Web page within that domain. Custom labels are saved in JSI files in the Settings\Enu\PersonalizedSettings folder.

Perform the following steps to add a custom label to an item on a web page.

  1. Move the JAWS virtual cursor to the element you wish to label.

  2. Press JAWSKEY + F2 to open the list of JAWS managers.

  3. Activate the Custom Label item in the list.

  4. Type the text of the new label and press ENTER to activate the OK button.

Additional Practice: Create a labeling pass for a complex site: identify poorly labeled controls and assign consistent custom labels. How will you export or import labels across profiles or machines?

Before we explore some of the scripts and functions designed to work in the HTML environment, we first need to create a test script we can use in Internet Explorer. Perform the following steps to create this script.

Open Internet Explorer and open the JAWS Script Manager.

  1. Press CONTROL + HOME to move to the bottom of the script file and press ENTER to create a new line.

  2. Press CONTROL + E to activate the New Script dialog.

  3. Give the script a name of TestBed and assign it to the keystroke CONTROL + SHIFT + T.

  4. We can now use this script as a testing ground for some of the HTML related scripts and functions found in the FSDN.

Additional Practice: Build a minimal labelling toolbox using the TestBed script (for example, quick actions to list headings, form fields, ARIA roles). How could you make it discoverable and low-friction?

DisplayBasicElementInfo Script The DisplayBasicElementInfo script displays a description of the current HTML element the cursor is on, along with a description of its parent elements. This script can be useful in examining the structure of a HTML document. The text is displayed in the virtual viewer. Insert the following statement into the body of the TestBed script and press CONTROL + S to compile it.

PerformScript DisplayBasicElementInfo ()

You can now move to any HTML element on a web page and press CONTROL + SHIFT + S to find out information on its attributes.

GetElementDescription The GetElementDescription function is similar to the DisplayBasicElementInfo script accept that it returns a string with the text rather than displaying it in the virtual viewer. Since the function returns a string, it can be used as a parameter to one of the speaking functions such as SayString. Use the two parameters of the function to determine if you want ancestor information and values for the attributes spoken.

DocumentLoadedEvent The DocumentLoadedEvent function fires each time a web page loads. This may be useful if you want to run script code when a page loads (before the user presses any keystrokes). For example, you could modify the DocumentLoadedEvent function to speak a message with specific navigation tips when a web page first loads. There is a custom version of DocumentLoadedEvent found in the Internet Explorer script file.

IsEmptyEditFormField This function returns true if the form field that has focus is empty of text. If there is text in the form field, this function returns false. Note that forms mode does not have to be on for this function to work properly but the virtual cursor must be placed on an edit field when the function is called.

MoveToFormField This function can move the cursor to the first, last, next, or previous form field on a web page. The function requires a parameter indicating in which direction to look for the next field. This can be useful if your script is designed to automatically input information into a form.

MoveToHeading This function can move the cursor to the first, last, next, or previous heading on a web page. You can also specify which level of heading to move to (i.e. one through six). The function returns true if the heading was found or false otherwise.

TurnOnFormsMode This function turns on forms mode just as if the user pressed ENTER. This function is especially useful when automatically filling out forms with a script.

ExitFormsMode Script This script does the necessary processing to exit forms mode. Use the PerformScript statement to call this script. This script is especially useful when automatically filling out forms with a script.

Additional Practice: Compose a composite script that speaks and/or copies key attributes (role, name, value, index) and optionally copies them to the clipboard. Which functions would you combine and why?

Automatically Filling Out Form Information

Scripting can be used to automatically fill out information in a form. This can save users a great deal of time when there is a need to fill out repetetive pieces of information. The following web page will be used for this example Web track sample form on Surf's Up.

The purpose of this script is to automatically fill out two pieces of information in the Web Track sample form. Before writing the script it is important to examine the layout and order of the form. In our script we want JAWS to automatically ENTER the name and phone number and then activate the Mailing Address button. Although there are many other form fields available on the form, for the purpose of this script we will stick with just the name and phone number boxes.

The following is a list of some of the functions and scripts we will use in this exercise.

  1. ExitFormsMode: Script that performs all actions related to exiting forms mode

  2. MoveToFormField: Depending on the value of the SearchOption parameter, positions to the first, last, next, or prior form field on the current web page

  3. MoveToFormFieldByIndex: Moves to a specific form field based on the index provided

  4. TurnOnFormsMode: Turns on forms mode

  5. Delay: Lets the script pause for a specified number of milliseconds

  6. GetDocumentPath: Returns the URL of the current document

  7. TypeString: Types a string of text just as if it were entered from the keyboard

  8. TypeKey: Simulates a keyboard command

Creating the Script

We start by creating a blank script with the name FormFiller and assigning it to the keystroke CONTROL + SHIFT + F. Be sure to add an appropriate synopsis and description.

Writing the Script The first thing our script needs to do is move the virtual cursor to the first form field on the page. This is accomplished using the MoveToFormField function. In order to tell JAWS we want to move to the first field on the page, we pass the S_Top constant as the first parameter to the function.

Once the cursor is located on the edit field we use the TurnOnFormsMode function to activate forms mode. We can then use TypeString to type some text into the edit box.

Before moving the cursor to the next form field to ENTER the phone number, we must first exit out of forms mode in order to reactivate the virtual cursor. This is done by using the PerformScript statement to call the ExitFormsMode script. Depending on the speed of the computer your script is running on it may be necessary to use the Delay function to let the script pause for a couple of milliseconds after the TypeString function and before exiting forms mode. If you're unsure as to whether or not a delay is needed you can try it without a delay and see if it works. It may also be necessary to insert another delay after the ExitFormsMode script is run. This gives the computer time to perform the actions needed to exit forms mode and reactivate the virtual cursor.

We can now use the MoveToFormFieldByIndex function to move the cursor to the phone number edit box. Pass the number 2 as the parameter to MoveToFormFieldByIndex to tell JAWS to move to the second form field on the page. This is the phone number edit box. Note that it may be necessary again to call the Delay function in order to give the computer time to keep up with your script.

After activating forms mode again you can use the TypeString function to type out the phone number. You can then use several of the steps above to delay the script and then exit forms mode.

Finally, you use the MoveToFormFieldByIndex function again to jump directly to the Mailing Address button. The index of the button is 7 which you can determine by counting the number of fields on the page. For example, the first field has an index of 1, the second has an index of 2 and so on. Once the cursor is positioned on the button you can use the TypeKey function and pass the string "SPACEBAR" to have your script simulate a SPACEBAR press.

Identifying the Document URL

The script that we have written is only going to work if we are on the page with the Web Track sample form. If we are on any other page there could be unintended consequences or errors. We can use the GetDocumentPath function to determine if we are on the correct page before we execute any of the steps in our script. If we are not on the correct page, we can alert the user and exit the script.

Enhancing the Script

You may notice that JAWS speaks extra information while the script is running. JAWS automatically speaks because the script is causing various events to fire that cause messages to be spoken. You can use the SpeechOff function to turn off speech while JAWS is moving to the form fields and then use SpeechOn to turn it back on again.

The Script Code

The following is the script in its entirety.

Script FormFieldEntry () ; Assign To CONTROL + SHIFT + F
If GetDocumentPath () != "http://www.freedomscientific.com/Training/Surfs-Up/WebTrack.htm" Then
    SayFormattedMessage (OT_Message, "This Script is only available On the Web Track sample form", "Not available")
    Return
EndIf
SpeechOff (False)
MoveToFormField (s_top)
TurnOnFormsMode ()
TypeString ("Ryan Jones")
Delay(2)
PerformScript ExitFormsMode ()
Delay (2)
MoveToFormFieldByIndex (2)
Delay(2)
TurnOnFormsMode ()
Delay(2)
TypeString ("800-444-4443")
PerformScript ExitFormsMode ()
Delay(1)
MoveToFormFieldByIndex (7)
SpeechOn ()
TypeKey ("SPACEBAR")
EndScript

Additional Practice: Generalize the form filler to load field values from a configuration file and handle field order changes. How would you detect failures and recover gracefully during automation?

Automatically moving to a Placemarker When a Page Loads

The purpose of this exercise is to have JAWS automatically move the cursor to the location of a placemarker each time the page loads. This benefits the user in that there is no need to press a keystroke to move the cursor to the placemarker. We will use the Freedom Scientific HOME. page for this exercise.

  1. We first need to put a placemarker at the spot we want the cursor to jump to each time. On the Freedom Scientific HOME. page, move to the level two heading called "Latest news" and add a temporary placemarker by pressing CONTROL + WINDOWS + K.

  2. In order to make JAWS move to the placemarker automatically, we need to modify the DocumentLoadedEvent. This is a default event function that fires each time a web page is loaded. A custom version of DocumentLoadedEvent is located in Internet Explorer.jss so we can simply modify this event function and add our own statements at the end.

  3. Locate DocumentLoadedEvent and insert a blank line right before the EndFunction statement. This is where we will add our own statements so as not to interfere with the default processing of the function.

    As with the previous exercise it is important to insure our statements only run on one particular page and not on every page we open. We can use the GetDocumentPath function in an If-Then statement to insure we are on the page http://www.freedomscientific.com/default.asp.

  4. We can now use the MoveToPlaceMarker script and pass it the number one to tell JAWS to move to the first placemarker on the page. Because MoveToPlaceMarkerN is a script and not a function, we use the PerformScript statement to call it.

The Script Code The additional code added at the bottom of Documentat LoadedEvent in Internet Explorer.jss should look like the following:

If GetDocumentPath () == "http://www.freedomscientific.com/default.asp" Then
    PerformScript MoveToPlaceMarkerN (1)
EndIf

One added bonus to using a temporary placemarker verses a permanent one is that if we move the placemarker on the page, JAWS will then jump to that spot each time the page loads. This prevents you from having to modify the script if you want JAWS to automatically move to a new spot when the page loads.

Additional Practice: Extend this behavior to multiple pages with different targets; design a mapping of URL patterns to placemarker indices or names. How would you implement and maintain this mapping?



Further Reading

For more information on JAWS scripting and resources I have used to generate this manual, refer to the following resources:

{{#cite freedomscientific:basicsscripting}} {{#cite freedomscientific:FSDN}} {{#cite freedomscientific:JAWSUIA}} {{#cite freedomscientific:JAWSdocumentation}} {{#cite freedomscientific:trainingportal}} {{#cite freedomscientific:JAWSgettingstarted}} {{#cite springer:IntroJAWSscripting}} {{#cite vandyke:SecureCRTJAWSscripts}} {{#cite stackoverflow:JAWSscriptDOM}} {{#cite github:jamalmazrui:JAWSscripts}} {{#cite github:travisroth:VSCodeJAWSScripts}} {{#cite gould2000_jawsscripting}} {{#cite fs_intro_jaws_scripting}} {{#cite fs_fsdn_support}} {{#cite fs_uia_script_api}} {{#cite hartgenconsultancy_jawsscripting}} {{#cite hartgen_org_jawsscripting_archive}} {{#cite freedomscientific:JAWS-ARIA-support}} {{#cite freedomscientific:JAWS-ARIA-roles}} {{#cite freedomscientific:JAWS-ARIA-doc-index}} {{#cite freedomscientific:JAWS-UIA-API}} {{#cite freedomscientific:ScriptUtilityMode-MSAA}} {{#cite freedomscientific:JAWSscripts-MSAA}} {{#cite microsoft:UIA-spec}} {{#cite microsoft:MSAA-spec}} {{#cite linuxfoundation:IAccessible2-spec}} {{#cite w3c:WAI-ARIA}} {{#cite github:campg2j003:AudacityJAWS}} {{#cite github:raisedbar:SibeliusJAWS}} {{#cite github:munawarb:NotepadPPJAWS}} {{#cite dlee:scripteconomy}} {{#cite dlee:projects}} {{#cite snowmanradio:scripts}} {{#cite snowmanradio:tutorial}} {{#cite snowmanradio:reaper}} {{#cite gist:beastlytheos:JAWSscriptexample}} {{#cite dlee:codecommon}} {{#cite microsoft:dynamics365JAWS}}



JAWS UIA Script API

JAWS UIA Script API

Introduction

The JAWS UIA Script API provides access to Microsoft's User Interface Automation (UIA) infrastructure via the JAWS script language. You can find detailed information about UIA on the Microsoft web site. This document describes the objects, methods, properties, and events available through the JAWS UIA Script API.

Supported Versions

With each version of Windows®, Microsoft extends the features provided by UI Automation. Many of the methods and properties described in this document are supported in Windows 7, most in Windows 8 and Windows 8.1, and all in Windows 10. Please consult the Microsoft documentation to find out which UIA interfaces, methods, and properties are supported in which versions of Windows.

All the objects, methods, properties, and events described in this document are available as of JAWS 18.0.2530.

Getting the FSUIA Object

The primary object in the JAWS UIA script API is FSUIA. Using this object, you can get other objects that represent UIA elements, get tree walkers which will allow you to traverse the tree of UIA elements, register for UIA events, and more.

To get an FSUIA object in scripts, use the JAWS built-in Function CreateObjectEx as follows:

Var 
	Object omyObject 
omyObject = CreateObjectEx ("FreedomSci.UIA", False, "UIAScriptAPI.x.manifest");

You can create as many FSUIA objects as you like, although you probably won't need that many.

Properties

In the UIA Script API, all properties are get-only, except those for which "get/put" is explicitly declared in this document.

Caching

Those familiar with UIA will know that clients may request element and pattern data be cached in order to improve system performance. The JAWS UIA Script API handles UIA's caching mechanism internally. Several of the most commonly requested element and pattern properties are requested to be cached; and the cached values are always checked before the uncached values. Using this approach should make most situations efficient while keeping the API as simple as possible.

The "Bool" Type

At present, the JAWS script language has no Boolean type. The term "bool" is used throughout the remainder of this document to indicate an integer value where zero (0) represents a Boolean value of false and any non-zero value represents a Boolean value of true.

The "Variant" Type

In the JAWS script language, a "variant" is a variable whose type is unknown at compile-time. Variants may be an int, string, handle, or object, and they can be used like any of these types. You can use the JAWS built-in script function GetVariantType to determine the type of a variant, although you may already know the underlying type based on the context. For example, if you request the name property of a UIA element and the return type is a variant, the underlying type will almost certainly be a string. If you happen to know the type of a given variant, you can declare the variable as the known type in the scripts. For example: if the GetProperty function returns a variant, but you know the type of the property returned will be a string, you can assign the return value directly to a string variable, rather than having to declare a variant. But even if you don't know that a variant is a certain type like a string, you can still pass it to functions which take the string type.

Special Integer Types

There are several sets of pre-defined integer values used by UI Automation methods and properties. These represent various element types, property types, pattern identifiers, and so on. For JAWS scripters, these types are declared in the file UIA.jsh. In the file, each of the types listed below is preceded by a comment containing the name of the type in order to make them easy to reference from this document. These types are used to indicate the intended values of certain parameter, return, and property types from here on.

  • AnnotationTypeID

  • ControlTypeID

  • DockPosition

  • Endpoint

  • EventID

  • ExpandCollapseState

  • LandmarkTypeID

  • LegacySelectionFlags

  • LiveSetting

  • OrientationTypeID

  • PropertyID

  • RowOrColumnMajor

  • ScrollAmountID

  • StructureChangeTypeID

  • StyleID

  • SupportedTextSelectionID

  • SynchronizedInputType

  • TextAttributeID

  • TextEditChangeType

  • TextUnit

  • ToggleState

  • TreeScope

  • WindowInteractionState

  • WindowVisualState

  • ZoomUnit

Parameters by Reference

When a parameter is passed to a function "by reference", the value of the parameter is not only passed to the function, but also returned from the function. Therefore, after calling a function that takes a parameter by reference, the value of the parameter may have changed. This is a way of returning multiple pieces of information from a single function call. Throughout this document, the term "ByRef" is used to indicate those parameters which need to be passed to a function by reference.

In the JAWS script language, When a parameter is passed by reference, it must be done using a call to one of the reference functions: IntRef, StringRef, or IDispatchRef.

This last function is used when the variable type is object. For example:

Var 
    Int x;
    Int y;
element.GetClickablePoint(IntRef(x), IntRef(y));

When this function returns, the values of x and y will be populated with the coordinates of the clickable point.

Arrays

The table below lists the types of arrays provided by the UIA Script API. Although the types of items contained in each array are different, all arrays behave the same way.

To get the number of items in an array, use its Count property, for instance, myArray.Count.

To access a specific item in an array by index, include the index in parentheses after the array name, for instance, myArray(5).

Indexes are zero-based.

Finally, arrays may be used in ForEach loops as follows

Var 
    String s;
ForEach s in myArray
    ; do something with s
EndForEach
ArrayItem Type
FSUIAElementArrayFSUIAElement
FSUIAIntArrayint
FSUIARectArrayFSUIARect
FSUIAStringArraystring
FSUIATextRangeArrayFSUIATextRange

: UIA array types and corresponding item types (e.g. FSUIAElementArray FSUIAElement; FSUIAIntArray int).

Objects

FSUIA : Methods

NameDescription
bool AddAutomationEventHandler( EventID, FSUIAElement, TreeScope );Registers a method that handles Microsoft UI Automation events. See the Events section of this document for further details.
bool AddFocusChangedEventHandler();Registers a method that handles focus-changed events. See the Events section of this document for further details.
bool AddPropertyChangedEventHandler( PropertyID, FSUIAElement, TreeScope );Registers a method that handles property-changed events. See the Events section of this document for further details.
bool AddStructureChangedEventHandler( FSUIAElement, TreeScope );Registers a method that handles structure-changed events. See the Events section of this document for further details.
bool AddTextEditTextChangedEventHandler ( FSUIAElement, TreeScope, TextEditChangeType);Registers a method that handles programmatic text-edit events. See the Events section of this document for further details.
bool CheckNotSupported(variant );Checks a provided VARIANT to see if it contains the Not Supported identifier.
bool CompareElements( FSUIAElement, FSUIAElement );Compares two UI Automation elements to determine whether they represent the same underlying UI element.
bool CompareRuntimeIds( FSUIAIntArray, FSUIAIntArray );Compares two integer arrays containing run-time identifiers (IDs) to determine whether their content is the same and they belong to the same UI element.
FSUIACondition CreateAndCondition( FSUIACondition, FSUIACondition );Creates a condition that selects elements that match both of two conditions.
FSUIACondition CreateBoolPropertyCondition( PropertyID, bool );Creates a condition for a Boolean property.
FSUIACondition CreateFalseCondition();Creates a condition that is always false.
FSUIACondition CreateIntPropertyCondition( PropertyID, int );Creates a condition for an integer property.
FSUIACondition CreateNotCondition( FSUIACondition );Creates a condition that is the negative of a specified condition.
FSUIACondition CreateOrCondition( FSUIACondition, FSUIACondition );Creates a combination of two conditions where a match exists if either of the conditions is true.
FSUIACondition CreateStringPropertyCondition( PropertyID, string );Creates a condition for a string property.
FSUIATreeWalker CreateTreeWalker( FSUIACondition );Retrieves an IUIAutomationTreeWalker interface that can be used to traverse the UI Automation tree. Elements in the tree match the provided condition.
FSUIACondition CreateTrueCondition();Retrieves a predefined condition that selects all elements.
FSUIAElement GetElementFromHandle( handle );Retrieves a UI Automation element for the specified window.
FSUIAElement GetElementFromIAccessible(object, int );Retrieves a UI Automation element for the specified accessible object from a Microsoft Active Accessibility server. Parameter 2 is the MSAA child ID of the desired object.
FSUIAElement GetElementFromPoint( int, int );Retrieves the FSUIAElement interface for the UI element at the specified point on the desktop. Parameter 1 is the x coordinate of the point. Parameter 2 is the y coordinate.
FSUIAElement GetFocusedElement();Retrieves the UI Automation element that has the input focus.
string GetPatternProgramaticName( PatternID );Retrieves the registered programmatic name of a control pattern.
string GetPropertyProgramaticName( PropertyID );Retrieves the registered programmatic name of a property.
FSUIAElement GetRootElement();Retrieves the UI Automation element that represents the desktop.
bool PollForPotentialSupportedPatterns( FSUIAElement, ByRef FSUIAIntArray, ByRef FSUIAStringArray );Retrieves the control patterns that might be supported on a UI Automation element. Parameter 2 is an array of PatternIDs. Parameter 3 is an array of localized pattern name strings.
bool PollForPotentialSupportedProperties( FSUIAElement, ByRef FSUIAIntArray, ByRef FSUIAStringArray );Retrieves the properties that might be supported on a UI Automation element. Parameter 2 is an array of PropertyIDs. Parameter 3 is an array of localized property name strings.

: FSUIA object methods: signatures and brief usage notes (e.g. AddAutomationEventHandler, GetElementFromPoint, GetFocusedElement).

FSUIA : Properties

TypeNameDescription
boolAutoSetFocusSpecifies whether calls to UI Automation control pattern methods automatically set focus to the target element. (get/put)
intConnectionTimeoutSpecifies the length of time, in milliseconds, that UI Automation will wait for a provider to respond to a client request for an automation element. (get/put)
FSUIAConditionContentViewConditionRetrieves a predefined condition object that selects content elements.
FSUIATreeWalkerContentViewWalkerRetrieves an IUIAutomationTreeWalker interface used to discover content elements.
FSUIAConditionControlViewConditionRetrieves a predefined condition interface that selects control elements.
FSUIATreeWalkerControlViewWalkerRetrieves an IUIAutomationTreeWalker interface used to discover control elements.
FSUIAConditionRawViewConditionRetrieves a condition interface for a predefined condition that selects all UI elements in an unfiltered view.
FSUIATreeWalkerRawViewWalkerRetrieves an IUIAutomationTreeWalker interface used to traverse an unfiltered view of the UI Automation tree.
intTransactionTimeoutSpecifies the length of time, in Milliseconds, that UI Automation will wait for a provider to respond to a client request for information about an automation element. (get/put)

: FSUIA object properties: type, name and short description (e.g. AutoSetFocus, ConnectionTimeout, RawViewWalker).

FSUIAAnnotation: Properties

TypeNameDescription
stringAuthorRetrieves the name of the annotation author.
stringDateTimeRetrieves the date and time that this annotation was created.
FSUIAElementTargetRetrieves the element that is being annotated.
AnnotationTypeIDTypeIDRetrieves a value that identifies the annotation's type.
stringTypeNameRetrieves the localized name of this annotation's type.

: FSUIAAnnotation properties: Author, DateTime, Target, TypeID, TypeName --- annotation metadata and meanings.

FSUIACondition

The FSUIACondition object has no script-accessible members.

FSUIADock: Methods

NameDescription
bool SetPosition(DockPosition );Sets the dock position of this element.

: FSUIADock methods: dock-related actions (e.g. SetPosition(DockPosition) --- set dock position).

FSUIADock: Properties

TypeNameDescription
DockPositionPositionRetrieves the dock position of this element within its docking container.

: FSUIADock properties: Position --- dock position of an element within its container and related meanings.

FSUIADrag: Methods

NameDescription
FSUIAElementArray GetGrabbedItems();Retrieves a collection of elements that represent the full set of items that the user is dragging as part of a drag operation.

: FSUIADrag methods: drag operations and examples (e.g. GetGrabbedItems returns elements being dragged).

FSUIADrag: Properties

TypeNameDescription
stringDropEffectRetrieves a localized string that indicates what happens when the user drops this element as part of a drag-drop operation.
FSUIAStringArrayDropEffectsRetrieves an array of localized strings that enumerate the full set of effects that can happen when this element as part of a drag-and-drop operation.
boolIsGrabbedIndicates whether the user has grabbed this element as part of a drag-and-drop operation.

: FSUIADrag properties: DropEffect, DropEffects, IsGrabbed --- drag/drop state and descriptive fields.

FSUIADropTarget: Properties

TypeNameDescription
stringEffectRetrieves a localized string that describes what happens when the user drops the grabbed element on this drop target.
FSUIAStringArrayEffectsRetrieves an array of localized strings that enumerate the full set of effects that can happen when the user drops a grabbed element on this drop target as part of a drag-and-drop operation.

: FSUIADropTarget properties: Effect and Effects --- descriptions of drop-target behavior and possible effects.

FSUIAElement: Methods

NameDescription
FSUIAElement BuildUpdatedCache();Retrieves a new FSUIAElement interface with an updated cache.
FSUIAElementArray FindAll( TreeScope, FSUIACondition );Returns all UI Automation elements that satisfy the specified condition.
FSUIAElement FindFirst( TreeScope, FSUIACondition );Retrieves the first child or descendant element that matches the specified condition.
FSUIAAnnotation GetAnnotationPattern();Returns a pattern object if the pattern is available.
bool GetClickablePoint( ByRef int, ByRef int );Retrieves a point on the element that can be clicked. The first parameter is the x coordinate. The second parameter is the y coordinate.
FSUIADock GetDockPattern();Returns a pattern object if the pattern is available.
FSUIADrag GetDragPattern();Returns a pattern object if the pattern is available.
FSUIADropTarget GetDropTargetPattern();Returns a pattern object if the pattern is available.
FSUIAExpandCollapse GetExpandCollapsePattern();Returns a pattern object if the pattern is available.
FSUIAGridItem GetGridItemPattern();Returns a pattern object if the pattern is available.
FSUIAGrid GetGridPattern();Returns a pattern object if the pattern is available.
FSUIAInvoke GetInvokePattern();Returns a pattern object if the pattern is available.
FSUIAItemContainer GetItemContainerPattern();Returns a pattern object if the pattern is available.
FSUIALegacyIAccessible GetLegacyIAccessiblePattern();Returns a pattern object if the pattern is available.
FSUIAMultipleView GetMultipleViewPattern();Returns a pattern object if the pattern is available.
variant GetPropertyValue(PropertyID );Retrieves the value of a property for this UI Automation element.
FSUIARangeValue GetRangeValuePattern();Returns a pattern object if the pattern is available.
FSUIAIntArray GetRuntimeID();Retrieves the unique identifier assigned to the UI element.
FSUIAScrollItem GetScrollItemPattern();Returns a pattern object if the pattern is available.
FSUIAScroll GetScrollPattern();Returns a pattern object if the pattern is available.
FSUIASelectionItem GetSelectionItemPattern();Returns a pattern object if the pattern is available.
FSUIASelection GetSelectionPattern();Returns a pattern object if the pattern is available.
FSUIASpreadsheetItem GetSpreadsheetItemPattern();Returns a pattern object if the pattern is available.
FSUIASpreadsheet GetSpreadsheetPattern();Returns a pattern object if the pattern is available.
FSUIAStyles GetStylesPattern();Returns a pattern object if the pattern is available.
FSUIASynchronizedInput GetSynchronizedInputPattern();Returns a pattern object if the pattern is available.
FSUIATableItem GetTableItemPattern();Returns a pattern object if the pattern is available.
FSUIATable GetTablePattern();Returns a pattern object if the pattern is available.
FSUIATextChild GetTextChildPattern();Returns a pattern object if the pattern is available.
FSUIATextEdit GetTextEditPattern();Returns a pattern object if the pattern is available.
FSUIAText GetTextPattern();Returns a pattern object if the pattern is available.
FSUIAToggle GetTogglePattern();Returns a pattern object if the pattern is available.
FSUIATransform GetTransformPattern();Returns a pattern object if the pattern is available.
FSUIAValue GetValuePattern();Returns a pattern object if the pattern is available.
FSUIAVirtualizedItem GetVirtualizedItemPattern();Returns a pattern object if the pattern is available.
FSUIAWindow GetWindowPattern();Returns a pattern object if the pattern is available.
bool SetFocus();Sets the keyboard focus to this UI Automation element.
bool ShowContextMenu();Programmatically invokes a context menu on the target element.

: FSUIAElement methods: element operations (FindAll, FindFirst, GetPropertyValue, SetFocus, ShowContextMenu) with brief purposes.

FSUIAElement: Properties

TypeNameDescription
stringAcceleratorKeyRetrieves the accelerator key for the element.
stringAccessKeyRetrieves the access key character for the element.
FSUIAElementArrayAnnotation ObjectsRetrieves an array of elements representing the annotations associated with this element.
FSUIAIntArrayAnnotation TypesRetrieves an array of annotation type identifiers indicating the types of annotations that are associated with this element.
stringAriaPropertiesRetrieves the value of the ARIA properties of the element.
stringAriaRoleRetrieves the ARIA role of the element.
stringAutomationIdRetrieves the UI Automation identifier of the element.
FSUIARectBoundingRectangleRetrieves the coordinates of the rectangle that completely encloses the element.
stringClassNameRetrieves the class name of the element.
FSUIAElementArrayControllerForRetrieves an array of elements for which this element serves as the controller.
intControlTypeRetrieves the control type of the element.
intCultureRetrieves the culture identifier for the element.
FSUIAElementArrayDescribedByRetrieves an array of elements that describe this element.
FSUIAElementArrayFlowsFromRetrieves an array of elements that indicates the reading order before the current element.
FSUIAElementArrayFlowsToRetrieves an array of elements whose order suggests the reading order after the current element.
stringFrameworkIDRetrieves the name of the underlying UI framework.
stringFullDescriptionReturns a localized string which can contain extended description text for an element.
boolHasKeyboardFocusRetrieves a value that indicates whether the element has keyboard focus.
stringHelpTextRetrieves the help text for the element.
boolIsContentElementRetrieves a value that indicates whether the element is a content element.
boolIsControlElementRetrieves a value indicating whether the UI element is a control.
boolIsDataValidForFormRetrieves a value that indicates whether the element contains valid data for the form.
boolIsEnabledRetrieves a value that indicates whether the UI Automation element is enabled.
boolIsKeyboardFocusableRetrieves a value that indicates whether the UI Automation element can accept keyboard focus.
boolIsOffscreenRetrieves a value that indicates whether the element is off screen.
boolIsPasswordRetrieves a value that indicates whether the element contains a disguised password.
boolIsPeripheralRetrieves the peripheral UI indicator for the element.
boolIsRequiredForFormRetrieves a value that indicates whether the element is required to be filled out on a form.
stringItemStatusRetrieves a description of the status of an item within an element.
stringItemTypeRetrieves a string describing the type of the item represented by a UI element.
FSUIAElementLabeledByRetrieves the element that contains the text label for this element.
LandmarkTypeIDLandmarkTypeReturns the landmark type identifier associated with an element.
intLevelReturns the 1-based integer for the level in the hierarchical or broken hierarchical structure for the element.
LiveSettingLiveSettingIndicates the type of notifications, if any, that the element sends when the content of the element changes.
stringLocalizedControlTypeRetrieves a localized description of the UI element's control type.
stringLocalizedLandmarkTypeReturns a text string describing the type of landmark that the element represents.
stringNameRetrieves the name of the UI element.
handleNativeWindowHandleRetrieves the window handle of the element.
boolOptimizeForVisualContentIndicates whether the provider exposes only elements that are visible.
OrientationTypeIDOrientationRetrieves the orientation of the element.
intPositionInSetReturns the 1-based integer for the ordinal position in the set for the element.
intProcessIdRetrieves the ID of the process that hosts the element.
stringProviderDescriptionRetrieves a description of the UI Automation provider for this element.
intSizeOfSetReturns the 1-based integer for the size of the set where the element is located.

: FSUIAElement properties: common element properties and explanations (Name, ClassName, BoundingRectangle, HelpText, IsEnabled, etc.).

FSUIAExpandCollapse: Methods

NameDescription
void Collapse();Hides all child nodes, controls, or content of the element.
void Expand();Displays all child nodes, controls, or content of the element.

: FSUIAExpandCollapse methods: Expand() and Collapse() --- control expansion and collapse actions.

FSUIAExpandCOllapse: Properties

TypeNameDescription
ExpandCollapseStateExpandCollapseStateRetrieves a value that indicates the state, expanded or collapsed, of the element.

: FSUIAExpandCollapse properties: ExpandCollapseState --- indicates whether an element is expanded or collapsed.

FSUIAGrid: Methods

NameDescription
FSUIAElement GetItem( int, int );Retrieves a UI Automation element representing an item in the grid. Parameter 1 is the zero-based index of a row, Parameter 2 is the zero-based index of a column.

: FSUIAGrid methods/properties: grid operations and attributes (GetItem(row,col) to access grid cells).

FSUIAGrid: Properties

TypeNameDescription
intColumnCountThe number of columns in the grid.
intRowCountRetrieves the number of rows in the grid.

: FSUIAGrid properties: ColumnCount and RowCount --- grid size attributes.

FSUIAGridItem: Properties

TypeNameDescription
intColumnRetrieves the zero-based index of the column that contains the item.
intColumnSpanRetrieves the number of columns spanned by the grid item.
FSUIAElementContainingGridRetrieves the element that contains the grid item.
intRowRetrieves the zero-based index of the row that contains the grid item.
intRowSpanRetrieves the number of rows spanned by the grid item.

: FSUIAGridItem properties: Column, Row, ColumnSpan, RowSpan, ContainingGrid --- indices and containment info for grid items.

FSUIAInvoke: Methods

TypeNameDescription
boolInvoke();Invokes the action of a control, such as a button click.

: FSUIAInvoke methods: Invoke() --- programmatically invoke control actions (e.g., simulate button click).

FSUIAItemContainer: Methods

NameDescription
FSUIAElement FindItemByProperty( FSUIAElement, PropertyID, variant );Retrieves an element within a containing element, based on a specified property value.

: FSUIAItemContainer methods: item location operations (FindItemByProperty to locate child elements by property).

FSUIALegacyIAccessible: Methods

NameDescription
void DoDefaultAction();Performs the Microsoft Active Accessibility default action for the element.
object GetIAccessible();Retrieves an IAccessible object that corresponds to the UI Automation element.
FSUIAElementArray GetSelection();Retrieves the Microsoft Active Accessibility property that identifies the selected children of this element.
bool Select(LegacySelectionFlags );Performs a Microsoft Active Accessibility selection.
bool SetValue( string );Sets the Microsoft Active Accessibility value property for the element.

: FSUIALegacyIAccessible methods: DoDefaultAction, GetIAccessible, GetSelection, Select, SetValue --- MSAA interoperability methods.

FSUILegacyIAccesible: Properties

TypeNameDescription
intChildIDRetrieves the Microsoft Active Accessibility child identifier for the element.
stringDefaultActionRetrieves the Microsoft Active Accessibility default action for the element.
stringDescriptionRetrieves the Microsoft Active Accessibility description of the element.
stringHelpRetrieves the Microsoft Active Accessibility help string for the element.
stringKeyboardShortcutRetrieves the Microsoft Active Accessibility keyboard shortcut property for the element.
stringNameRetrieves the Microsoft Active Accessibility name property of the element.
intRoleRetrieves the Microsoft Active Accessibility role identifier of the element.
intStateRetrieves the Microsoft Active Accessibility state identifier for the element.
stringValueRetrieves the Microsoft Active Accessibility value property.

: FSUILegacyIAccessible properties: ChildID, DefaultAction, Name, Role, State, Value --- MSAA property mappings.

FSUIAMultipleView: Methods

TypeNameDescription
FSUIAIntArrayGetSupportedViews();Retrieves a collection of control-specific view identifiers.
stringGetViewName( int );Retrieves the name of a control-specific view.
boolSetCurrentView( int );Sets the view of the control.

: FSUIAMultipleView methods: GetSupportedViews, GetViewName, SetCurrentView --- control-specific view management.

FSUIAMultipleView: : Properties

TypeNameDescription
intCurrentViewRetrieves the control-specific identifier of the current view of the control.

: FSUIAMultipleView properties: CurrentView --- the control-specific identifier for the active view.

FSUIARangeValue: Methods

NameDescription
bool SetValue( int );Sets the value of the control.

: FSUIARangeValue methods: SetValue(int) --- programmatically set control value.

FSUIARangeValue: Properties

TypeNameDescription
boolIsReadOnlyIndicates whether the value of the element can be changed.
intLargeChangeRetrieves the value that is added to or subtracted from the value of the control when a large change is made, such as when the PAGE DOWN key is pressed.
intMaximumRetrieves the maximum value of the control.
intMinimumRetrieves the minimum value of the control.
intSmallChangeRetrieves the value that is added to or subtracted from the value of the control when a small change is made, such as when an ARROW key is pressed.
intValueRetrieves the value of the control.

: FSUIARangeValue properties: IsReadOnly, LargeChange, Minimum, Maximum, SmallChange, Value --- range value details.

FSUIARect: Properties

TypeNameDescription
intBottomThe bottom edge of the rectangle.
intLeftThe left edge of the rectangle.
intRightThe right edge of the rectangle.
intTopThe top edge of the rectangle.

: FSUIARect properties: Bottom, Left, Right, Top --- rectangle edge coordinates.

FSUIAScroll: Methods

NameDescription
bool Scroll(ScrollAmountID, ScrollAmountID );Scrolls the visible region of the content area horizontally and vertically. Parameter 1 is horizontal. Parameter 2 is vertical.
bool SetScrollPercent( int, int );Sets the horizontal and vertical scroll positions as a percentage of the total content area within the UI Automation element. Parameter 1 is horizontal. Parameter 2 is vertical.

: FSUIAScroll methods: Scroll and SetScrollPercent --- scroll content horizontally/vertically; parameters described.

FSUIAScroll: Properties

TypeNameDescription
boolHorizontallyScrollableIndicates whether the element can scroll horizontally.
intHorizontalScrollPercentRetrieves the horizontal scroll position.
intHorizontalViewSizeRetrieves the horizontal size of the viewable region of a scrollable element, expressed as a percentage of the total content area within the element.
boolVerticallyScrollableIndicates whether the element can scroll vertically.
intVerticalScrollPercentRetrieves the vertical scroll position.
intVerticalViewSizeRetrieves the vertical size of the viewable region of a scrollable element, expressed as a percentage of the total content area within the element.

: FSUIAScroll properties: horizontal/vertical scroll flags and percentages (HorizontallyScrollable, HorizontalScrollPercent, VerticalScrollPercent, etc.).

FSUIAScrollItem: Methods

NameDescription
void ScrollIntoView();Scrolls the content area of a container object to display the UI Automation element within the visible region (viewport) of the container.

: FSUIAScrollItem methods: ScrollIntoView() --- scroll container to display the item in the viewport.

FSUIASelection: Methods

NameDescription
FSUIAElementArray GetSelection();Retrieves the selected elements in the container.

: FSUIASelection methods: GetSelection() --- retrieve the selected elements in a container.

FSUIASelection: Properties

TypeNameDescription
boolCanSelectMultipleIndicates whether more than one item in the container can be selected at one time.
boolIsSelectionRequiredIndicates whether at least one item must be selected at all times.

: FSUIASelection properties: CanSelectMultiple, IsSelectionRequired --- selection capabilities of a container.

FSUIASelectionItem: Methods

NameDescription
bool AddToSelection();Adds the current element to the collection of selected items.
bool RemoveFromSelection();Removes this element from the selection.
void Select();Clears any selected items and then selects the current element.

: FSUIASelectionItem methods: AddToSelection, RemoveFromSelection, Select --- selection manipulation for an item.

FSUIASelectionItem: Properties

TypeNameDescription
boolIsSelectedIndicates whether this item is selected.
FSUIAElementSelectionContainerRetrieves the element that supports IUIAutomationSelectionPattern and acts as the container for this item.

: FSUIASelectionItem properties: IsSelected, SelectionContainer --- selection state and container reference.

FSUIASpreadsheet: Methods

NameDescription
FSUIAElement GetItemByName( string );Retrieves a UI Automation element that represents the spreadsheet cell that has the specified name, for instance, "A1".

: FSUIASpreadsheet methods: GetItemByName(string) --- access spreadsheet cells by name (e.g. "A1").

FSUIASpreadsheetItem: Methods

NameDescription
FSUIAElementArray GetAnnotationObjects();Retrieves an array of elements representing the annotations associated with this spreadsheet cell.
FSUIAIntArray GetAnnotationTypes();Retrieves an array of annotation type identifiers indicating the types of annotations that are associated with this spreadsheet cell.

: FSUIASpreadsheetItem methods: GetAnnotationObjects, GetAnnotationTypes --- retrieve annotations associated with a spreadsheet cell.

FSUIASpreadsheetItem: Properties

TypeNameDescription
stringFormulaRetrieves the formula for this cell.

: FSUIASpreadsheetItem properties: Formula --- cell formula text and related metadata.

FSUIAStyles: Properties

TypeNameDescription
stringExtendedPropertiesRetrieves a localized string that contains the list of extended properties for an element in a document.
intFillColorRetrieves the fill color of an element in a document.
intFillPatternColorRetrieves the color of the pattern used to fill an element in a document.
stringShapeRetrieves the shape of an element in a document.
StyleIDStyleIDRetrieves the identifier of the visual style associated with an element in a document.
stringStyleNameRetrieves the name of the visual style associated with an element in a document.

: FSUIAStyles properties: ExtendedProperties, FillColor, Shape, StyleName --- document style attributes.

FSUIASynchronizedInput: Methods

NameDescription
bool Cancel();Causes the UI Automation provider to stop listening for mouse or keyboard input.
bool StartListening(SynchronizedInputType );Causes the UI Automation provider to start listening for mouse or keyboard input.

: FSUIASynchronizedInput methods: StartListening and Cancel --- manage provider listening for mouse/keyboard input.

FSUIATable: Methods

NameDescription
FSUIAElementArray GetColumnHeaders();Retrieves a collection of UI Automation elements representing all the column headers in a table.
FSUIAElementArray GetRowHeaders();Retrieves a collection of UI Automation elements representing all the row headers in a table.

: FSUIATable methods: GetColumnHeaders and GetRowHeaders --- retrieve header elements for a table.

FSUIATable: Properties

TypeNameDescription
RowOrColumnMajorRowOrColumnMajorRetrieves the primary direction of traversal for the table.

: FSUIATable properties: RowOrColumnMajor --- primary traversal direction of the table.

FSUIATableItem: Methods

NameDescription
FSUIAElementArray GetColumnHeaderItems();Retrieves the column headers associated with a table item or cell.
FSUIAElementArray GetRowHeaderItems();Retrieves the row headers associated with a table item or cell.

: FSUIATableItem methods: GetColumnHeaderItems, GetRowHeaderItems --- header associations for a table cell.

FSUIAText: Methods

NameDescription
FSUIATextRange GetCaretRange( ByRef int );Retrieves a zero-length text range at the location of the caret that belongs to the text-based control. Parameter 1 is a reference to an int that indicates whether the text-based control that contains the caret has keyboard focus; 0 is false, otherwise true.
FSUIATextRangeArray GetSelection();Retrieves a collection of text ranges that represents the currently selected text in a text-based control.
FSUIATextRangeArray GetVisibleRanges();Retrieves an array of disjoint text ranges from a text-based control where each text range represents a contiguous span of visible text.
FSUIATextRange RangeFromAnnotation( FSUIAElement );Retrieves a text range containing the text that is the target of the annotation associated with the specified annotation element.
FSUIATextRange RangeFromChild( FSUIAElement );Retrieves a text range enclosing a child element such as an image, hyperlink, Microsoft Excel spreadsheet, or other embedded object.
FSUIATextRange RangeFromPoint( int, int );Retrieves the degenerate (empty) text range nearest to the specified screen coordinates. Parameter 1 is the x coordinate. Parameter 2 is the y coordinate.

: FSUIAText methods: text-range and selection helpers (GetCaretRange, GetSelection, RangeFromPoint, RangeFromChild).

FSUIAText: Properties

TypeNameDescription
FSUIATextRangeDocumentRangeRetrieves a text range that encloses the main text of a document.
SupportedTextSelectionIDSupportedTextSelectionRetrieves a value that specifies the type of text selection that is supported by the control.

: FSUIAText properties: DocumentRange and SupportedTextSelection --- document text range and selection support.

FSUIATextChild: Properties

TypeNameDescription
FSUIAElementTextContainerRetrieves this element's nearest ancestor element that supports the Text control pattern.
FSUIATextRangeTextRangeRetrieves a text range that encloses this child element.

: FSUIATextChild properties: TextContainer and TextRange --- child text container and its range.

FSUIATextEdit: Methods

NameDescription
FSUIAElement GetActiveComposition();Returns the active composition.
FSUIATextRange GetConversionTarget();Returns the current conversion target range.

: FSUIATextEdit methods: GetActiveComposition and GetConversionTarget --- IME composition-related operations.

FSUIATextRange: Methods

NameDescription
bool AddToSelection();Adds the text range to the collection of selected text ranges in a control that supports multiple, disjoint spans of selected text.
FSUIATextRange Clone();Retrieves a new IUIAutomationTextRange identical to the original and inheriting all properties of the original.
bool Compare( FSUIATextRange );Retrieves a value that specifies whether this text range has the same endpoints as another text range.
int CompareEndPoints( Endpoint, FSUIATextRange, Endpoint );Retrieves a value that specifies whether the start or end endpoint of this text range is the same as the start or end endpoint of another text range.
bool ExpandToEnclosingUnit( TextUnit );Normalizes the text range by the specified text unit. The range is expanded if it is smaller than the specified unit, or shortened if it is longer than the specified unit.
FSUIATextRange FindAttribute( TextAttributeID, variant, bool );Retrieves a text range subset that has the specified text attribute value. Parameter 3 should be set to true if the search is to be done backward; otherwise false.
FSUIATextRange FindText( string, bool, bool );Retrieves a text range subset that contains the specified text. Parameter 2 should be set to true if the search is to be done backward; otherwise false. Parameter 3 should be set to true if the search is to be case-insensitive; otherwise false.
variant GetAttributeValue( TextAttributeID );Retrieves the value of the specified text attribute across the entire text range.
FSUIARectArray GetBoundingRectangles();Retrieves a collection of bounding rectangles for each fully or partially visible line of text in a text range.
FSUIAElementArray GetChildren();Retrieves a collection of all embedded objects that fall within the text range.
FSUIAElement GetEnclosingElement();Returns the innermost UI Automation element that encloses the text range.
string GetText( int );Returns the plain text of the text range. Parameter 2 is the maximum length in characters of the text to retrieve.
int Move( TextUnit, int );Moves the text range forward or backward by the specified number of text units. Negative values for parameter 2 will move the range backward. Returns the number of units actually moved.
bool MoveEndpointByRange( Endpoint, FSUIATextRange, Endpoint );Moves one endpoint of the current text range to the specified endpoint of a second text range.
int MoveEndpointByUnit( Endpoint, TextUnit, int );Moves one endpoint of the text range the specified number of text units within the document range. Negative values for parameter 3 will move the range backward. Returns the number of units actually moved.
bool RemoveFromSelection();Removes the text range from an existing collection of selected text in a text container that supports multiple, disjoint selections.
bool ScrollIntoView( bool );Causes the text control to scroll until the text range is visible in the viewport. Parameter 1 should be true if the text control should be scrolled so that the text range is flush with the top of the viewport; false if it should be flush with the bottom of the viewport.
bool Select();Selects the span of text that corresponds to this text range, and removes any previous selection.
bool ShowContextMenu();Programmatically invokes a context menu on the target element.

: FSUIATextRange methods: Clone, FindText, GetText, Move, Select, ScrollIntoView --- text-range operations and utilities.

FSUIAToggle: Methods

NameDescription
void Toggle();Cycles through the toggle states of the control.

: FSUIAToggle methods: Toggle() --- cycle control toggle states.

FSUIAToggle: Properties

TypeNameDescription
ToggleStateToggleStateRetrieves the toggled state of the control.

: FSUIAToggle properties: ToggleState --- current state of a toggle control.

FSUIATransform: Methods

NameDescription
bool Move( int, int );Moves the UI Automation element. Parameter 1 is the screen coordinates of the left side of the control. Parameter 2 is the screen coordinates of the top of the control.
bool Resize( int, int );Resizes the UI Automation element. Parameter 1 is the new width of the window, in pixels. Parameter 2 is the new height of the window, in pixels.
bool Rotate( int );Rotates the UI Automation element. Parameter 1 is the number of degrees to rotate the element. A positive number rotates clockwise; a negative number rotates counterclockwise.
bool Zoom( int );Zooms the viewport of the control. Parameter 1 is the amount to zoom the viewport, specified as a percentage. Positive values increase the zoom level, and negative values decrease it. The control zooms its viewport to the nearest supported value.
bool ZoomByUnit(ZoomUnit );Zooms the viewport of the control by the specified unit.

: FSUIATransform methods: Move(x,y), Resize(w,h), Rotate(deg), Zoom(percent) --- transform operations for movable/resizable elements.

FSUIATransform: Properties

TypeNameDescription
boolCanMoveIndicates whether the element can be moved.
boolCanResizeIndicates whether the element can be moved.
boolCanRotateIndicates whether the element can be rotated.
boolCanZoomIndicates whether the control supports zooming of its viewport.
intZoomLevelRetrieves the zoom level of the control's viewport.
intZoomMaximumRetrieves the maximum zoom level of the control's viewport.
intZoomMinimumRetrieves the minimum zoom level of the control's viewport.

: FSUIATransform properties: CanMove, CanResize, CanRotate, CanZoom, ZoomLevel/ZoomMaximum/ZoomMinimum --- transform capabilities and limits.

FSUIATreeWalker: Methods

NameDescription
bool GoToFirstChild();Moves the current element to its first child. Returns true if the move succeeded. Otherwise false.
bool GoToNextSibling();Moves the current element to its next sibling. Returns true if the move succeeded. Otherwise false.
bool GoToParent();Moves the current element to its parent. Returns true if the move succeeded. Otherwise false.
bool GoToPriorSibling();Moves the current element to its prior sibling. Returns true if the move succeeded. Otherwise false.

: FSUIATreeWalker methods: navigation helpers (GoToFirstChild, GoToNextSibling, GoToParent, GoToPriorSibling).

FSUIATreeWalker: Properties

TypeNameDescription
FSUIAConditionConditionRetrieves the condition that specifies items to walk in the tree.
FSUIAElementCurrentElementAn element in the UIA tree. (get/put)

: FSUIATreeWalker properties: Condition and CurrentElement --- tree-walking condition and current element reference.

FSUIAValue: Methods

NameDescription
bool SetValue( string );Sets the value of an element.

: FSUIAValue methods: SetValue(string) --- set an element's value programmatically.

FSUIAValue: Properties

TypeNameDescription
boolIsReadOnlyIndicates whether the value of the element is read-only.
stringValueRetrieves the value of the element.

: FSUIAValue properties: IsReadOnly and Value --- value access and mutability.

FSUIAVirtualizedItem: Methods

NameDescription
bool Realize();Creates a full UI Automation element for a virtualized item.

: FSUIAVirtualizedItem methods: Realize() --- materialize a virtualized item into a full UIA element.

FSUIAWindow: Methods

NameDescription
bool Close();Closes the window.
bool SetWindowVisualState(WindowVisualState );Minimizes, maximizes, or restores the window.
bool WaitForInputIdle( int );Causes the calling code to block for the specified time or until the associated process enters an idle state, whichever completes first.

: FSUIAWindow methods: Close, SetWindowVisualState, WaitForInputIdle --- window management operations.

FSUIAWindow: Properties

TypeNameDescription
boolCanMaximizeIndicates whether the window can be maximized.
boolCanMinimizeIndicates whether the window can be minimized.
WindowInteractionStateInteractionStateRetrieves the current state of the window for the purposes of user interaction.
boolIsModalIndicates whether the window is modal.
boolIsTopmostIndicates whether the window is the topmost element in the z-order.
WindowVisualStateVisualStateRetrieves the visual state of the window; that is, whether it is in the normal, maximized, or minimized state.

: FSUIAWindow properties: CanMaximize, CanMinimize, InteractionState, IsModal, IsTopmost, VisualState --- window capabilities and state.

Events

Scripts may register to receive UIA events by calling one of the add-event-handler methods on an FSUIA object.

Var Object events = CreateObjectEx ("FreedomSci.UIA", False,
"UIAScriptAPI.x.manifest" );\
Var Object element = events.GetFocusedElement();\
events.AddPropertyChangedEventHandler(UIA\_NamePropertyId, element,
TreeScope\_Element \textbar{} TreeScope\_Descendants )

The same FSUIA object must then be passed to the JAWS built-in Function ComAttachEvents:

Note the second parameter below. This string will be prepended to the event callback function in the scripts.

ComAttachEvents( events, "UIA\_" );

Now, when a UIA property changed event occurs for the name property, the function UIA_PropertyChangedEvent in the JAWS scripts will be called.

Finally, to stop receiving events, the FSUIA object must be set to a null object.

Var Object nullObject;
events = nullObject;

In the examples above, the FSUIA object named events would typically be declared as a global variable. If it were declared inside a function, when the function ended, the object would automatically be set to null, and any previously registered events would be unregistered before JAWS ever had a chance to receive them.

Event callback functions

The following table gives the names and parameter types of the available event callback functions.

NameDescription
AutomationEvent( FSUIAElement, EventID );The automation event callback. Parameter 1 is the element for which the event occurred. Parameter 2 is the EventID.
FocusChangedEvent(FSUIAElement );The focus changed event callback. Parameter 1 is the new element with focus.
PropertyChangedEvent( FSUIAElement, PropertyID, variant );The property changed event callback. Parameter 1 is the element for which the event occurred. Parameter 2 is the property ID for the property that changed. Parameter 3 is the new value for the specified property.
StructureChangedEvent( FSUIAElement, StructureChangeTypeID, FSUIAIntArray );The structure changed event callback. Parameter 1 is the element for which the event occurred. Parameter 2 is the type of structure change. Parameter 3 is the runtime ID of the element that changes. Parameter 3 is only valid when the StructureTypeID in parameter 2 is StructureChangeType_ChildRemoved.
TextEditTextChangedEvent(FSUIAElement, TextEditChangeType, FSUIAStringArray);The text edit changed event callback. Parameter 1 is the element for which the event occurred. Parameter 2 is the type of text-edit change that occurred. Parameter 3 is the event data passed by the event. Parameter 3 contains different payloads for each text-edit change type. For the TextEditChangeType_AutoCorrect, the data is the new corrected string. For the TextEditChangeType_Composition, the data is the updated string in the composition (only the part that changed). For the TextEditChangeType_CompositionFinalized, the data is the finalized string of the completed composition (this may be empty if composition was canceled or deleted).

: Event callback functions: names, parameter types, and short descriptions (AutomationEvent, FocusChangedEvent, PropertyChangedEvent, StructureChangedEvent, TextEditTextChangedEvent).



Constants

Unlike variables, constants do not change value. They are most useful for hard-to-remember strings of characters or long numbers. Constants should have mnemonic names since it is easier to remember a name than a number or long string of characters.

The Freedom Scientific Scripting language has no restrictions as to how many constant names you assign to a particular value. For example, in the default JAWS constants file, HJConst.jsh, there are constants named True and On -- both of which hold the value 1. It is more intuitive to understand a code statement that checks a condition for values of True or On than a code statement that checks for the integer 1. Once you declare the constants, JAWS recognizes all of the constant names with the same value.

If the string of characters being stored in a constant includes Unicode characters, ensure that the script files where the constants are declared and utilized are formatted properly for UTF-8. For more information on UTF-8, see Formatting Script Files for UTF-8.

Advantages of Using Constants

There are several advantages to using constants in scripts:

It is easier to remember a constant name than its value. And it is more intuitive when the constant name is a readable word like "True" or "on".

It is much easier to maintain code when constant names are used rather than hard-coded strings of characters or hard-coded integer values.

Changing the value of a string of characters or an integer that is used throughout code is much easier to maintain if that value is stored in a constant. The change is made just in one place. In other words, simply changing the constant declaration affects the code wherever that constant is applied.

The Freedom Scientific Scripting language does not support direct declaration of a negative integer constant, as in "VBTrue = -1". However, it does support using hexadecimal representation of any integer, including negative integers, as in "VBTrue = 0xffffffff". Note: This is because the Scripting language uses four bytes to store numbers, and if the highest bit is a 1, the numbers are signed so that they are negative.

Declaring Constants

You may declare constants anywhere outside of a script or function, but conventionally, they are declared at the beginning of a script source (.jss) file or in a header (.jsh or .jsm) file. Begin declaration of constants either with the keyword, Const for simple constants, or with the keyword pattern that generates a block of message constants. A message block of constants begins with the keyword, Messages, and ends with the keyword, EndMessages.

Simple Constants

For simple constants, place each constant declaration on a separate line followed by a comma, except for the last one. For example:

Const
    True = 1,
    False = 0,
    On = 1,
    Off = 0,
    FS = "Freedom Scientific",
    FSZipCode = "33764" ; since this is used as a String, Not For computing

Formatted Message Constants

Although you may declare string constants such as for window names, window classes, and so on, it is much more practical to declare message constants as formatted strings. This ensures that when JAWS processes message constants, they are indicated properly in speech, Braille, and in the virtual viewer, if applicable. Furthermore, formatted message constant declarations may include replaceable parameters so that varied information may populate messages when JAWS processes them, depending on conditions you determine through scripts and functions or through events. When declaring and using message constants, especially those you wish to format with replaceable parameters in them, be sure to:

  • Populate the message constant with text (it can be long and have multiple paragraphs), including spaces, tabs, and hard returns.

  • If desired, create the text of the message constant with the "%" character followed by a number to indicate a replaceable parameter within the message. You may use multiple replaceable parameters in the same message.

  • Use the FormatString function in order to populate the message with appropriate replacement strings for the replaceable parameters in the message constant. The FormatString function returns a string that is already formatted properly for you to pass to a function that outputs formatted strings .

  • Utilize only functions that process formatted strings correctly, or enclose the string parameters in a call to the FormatString function. For example, if you pass the SayMessage function a formatted string, it cannot process any replaceable parameters; so the output may yield unexpected results. Instead, use one of the functions that processes formatted strings. These include:

    • SayFormattedMessage ()

    • SayFormattedMessageWithVoice ()

    • UserBufferAddFormattedMessage ()

For a complete list of formatting functions, see the String Functions category page of the Reference Guide called Strings Functions and Text Format Functions.

Syntax of Formatted Messages

Use the following format for message constants:

The keyword, "Messages"

On a new line, the name of the constant beginning with the "at" ("@") symbol.

As many lines as necessary for the content of the message, including hard returns, to generate multiple paragraphs, even replaceable parameters.

On a new line, a double "at" ("@@") symbol to end the constant declaration.

On a new line, the keyword, "endMessages" to end the block of message constants.

You may repeat the pattern for as many message constants as you wish of "@" followed by message constant name, constant message itself, and a double "@" symbol to complete each message constant within the block beginning and ending with the keywords, Messages and EndMessages. It is good practice to begin the names message constants with the letters "msg" to distinguish them from other types of string constants. Also, if the constant takes replaceable parameters, place a comment above each message constant declaration explaining the purpose of the replaceable parameter.

Messages
@msgFSHeadquarters
11800 31st CT North
St. Petersburg, FL
@@
@msgFSPhoneNumbers
800-444-4443
or
727-803-8000
@@
;For msgMyWorkplace, %1 is the name of the workplace.
@msgMyWorkplace
I work at %1.
@@
EndMessages

Using a Header File to Store Constants

Unless the constants you are declaring apply only to the current script source file, it is more practical to declare constants in a script header file. Typically, a header file has an extension of .jsh or .jsm. When you use a header file to declare constants, you must refer to that header file with an "Include" statement in the script source file where you want to use the constants. For examples, see the script source file that ships with the JAWS Shared user\settings(Language) folder. One of the "include" statements for this file is "hjconst.jsh". Another is "common.jsm". Since the constants declared in these header files are in the default script source file, it means that you can use all of them in any of the default scripts and user-defined functions.

If you add an "Include" statement for the HJConst.jsh file within an application-specific script source file, for example, those constants become available to that script source file.



Collection Type Variables

Description

Collection New

A collection is a data type that may contain members of any type, and whose members are accessed by means of a key. Members of a collection need not be of the same data type as each other. After declaring a collection, create it using the keyword, "New"

Items of a collection spring into existence the first time they are assigned. Assigning a collection member to a value makes that member's type the type of the value being assigned. Each member in a collection has a key of type string, and each member can contain a value of any data type.

You may access members of a collection by using the dot operator followed by the key name, or by the key as a string enclosed in square brackets.

Syntax

Var 
	Collection col
Let col = New Collection
Let col.item = value
  • Col is a collection variable being declared and created.

  • Item is the name (or key) of a member in the collection being created.

  • Value is the value being assigned to a member of the collection.

Remarks

Declaring a collection does not create it. You must create the collection by means of the New statement.

Collection members are stored in alphabetical order of the member keys. If you know the name (or key) of a member in a collection, you can assign or retrieve that name (or key) using the dot operator. If the name (or key) of a collection member is enclosed in quotes or is contained in a variable, you must access that member using the variable name or quoted string enclosed inside square brackets instead of using the dot operator.

Collections are always passed to functions by reference.

::: .hint Assigning one collection to another results in two variables referring to the same collection. When retrieving a collection member into another variable, the script code must ensure that the value retrieved is stored in the appropriate type of variable. Retrieving a nonexistent item does not generate an error. :::

Code Sample

Script TestCollections ()
	CollectionOfFruitCollections()
EndScript

Void Function FRTINIT(Collection Frt, String Type, String Prep, String Cut)
Let Frt.Type = Type
Let Frt.Prep = Prep
Let Frt.Cut = Cut
EndFunction

Void Function CollectionOfFruitCollections()
Var
    Collection Fruit,
    Collection frt,
    String key,
    String sMsgFruitInfo
    sMsgFruitInfo = "%2 and %3 the %1."
Let Fruit = New Collection
Let frt = New Collection
FRTINIT(frt,"Bananas","peel","slice")
Let Fruit.Bananas = frt
Let frt = New Collection
FRTINIT(frt,"Apples","core","slice")
Let Fruit.Apples = frt
Let frt = New Collection
FRTINIT(frt,"Strawberries","sugar","halve")
Let Fruit.Strawberries = frt
Let frt = New Collection
FRTINIT(frt,"Oranges","peel","section")
Let Fruit.Oranges = frt
Let frt = New Collection
FRTINIT(frt,"Pears","peel","slice")
Let Fruit.Pears = frt
Let frt = New Collection
FRTINIT(frt,"Cherries","hull","chop")
Let Fruit.Cherries = frt
Let frt = New Collection
ForEach key in Fruit
    SayFormattedMessage(ot_line,
    FormatString(sMsgFruitInfo,
    Fruit[key].Type,
    Fruit[key].Prep,
    Fruit[key].Cut))
EndForEach
EndFunction


Strings Functions

A String function provides, processes, or returns information about a string of characters. One common use for these functions is to manipulate a string of characters in some way: chopping characters from the beginning or the end of a string, comparing two strings, parsing a string from a delimited list of strings, etc. JAWS uses this information to determine what to speak and display in Braille, for comparison purposes, and so on. The Freedom Scientific Scripting language is rich with Strings functions for you to utilize in conjunction with many of the Say functions, such as SayFormattedMessage, for example. String functions may also be used to read from or write to an INI-style file. Some examples of String functions include:

  • FindString

  • FormatString

  • IntToString

  • StringToInt

  • StringSegment

  • StringCompare

  • StringTrimCommon

For a complete listing of Strings functions, see the topics in this category book of the Reference Guide. Code Sample Often, string functions are used for comparing window classes, window names, etc. For instance, you may obtain the window title with a command to JAWS, Insert + t. But what if you just want the name of the document without the application name. In the below code sample, the script manipulates some string functions to obtain the title of an existing Notepad document without speaking or flashing in Braille the name of the application. There are numerous ways to accomplish this. The code sample is just meant to show how you might utilize string functions to obtain a simple piece of information.

It is assumed that the script is being processed in the Notepad.jss script source file and compiled in the Notepad.jsb script binary file.

To set up the example, open Notepad into an existing document. then run the script from the document window of Notepad.

Script MyStringTest ()
Var
    Handle hReal,
    String sRealName,
    Int iRealLength,
    String sTitle
hReal = GetRealWindow (GetFocus ())
sRealName = GetWindowName (hReal)
iRealLength = StringLength (sRealName) ; the length of the entire real window name
; The next statement uses a combination of String functions:
; The StringContains Function returns an integer representing the location where the real window name and the name of the application begin To match.
; For sample purposes only, the part of the String that represents the application name is hard-coded here.
; But hard-coding strings is typically Not recommended because it is hard To maintain.
; In order To chop Off the application name from the entire real window name, we must take the lenth of the window name and subtract the integer that StringContains returns from it.
; Then we can chop this number Off from the real window name, and place the remaining String into the variable, sTitle.
sTitle = StringChopRight (sRealName, (iRealLength - StringContains (sRealName, " - Notepad")))
SayMessage (ot_JAWS_message, sTitle)
EndScript


Text Format Functions

A Text Format script or function provides or returns information about Text Format activities caused by user interaction or automatically updated by an event. JAWS uses this information to determine whether to speak and display Text Format information in Braille, for comparison purposes, and so on.

Text Format information may be about the font name, point size, or attributes of a character, about the attributes of a control, whether the text is intended to be read right to left instead of left to right, etc.

Some scripts that ship with JAWS fall into the category of Text Format, such as the script for SayFont, for example. However, the focus of the present discussion is on functions related to Text Format that you may call from your own scripts or that you may overwrite from those in default.jss or from the built-in functions.

Some examples of Text Format functions include:

  • AttributesChanged

  • IntToAttribName

  • AttributeEnumerate

  • GetCharacterAttributes

  • IsRtlChar

For a complete listing of Text Format functions, see the topics in this category book of the Reference Guide.

Code Sample

In the below code sample, the script finds the first character in the text that is bolded.

To set up the example, simply type some text into the Wordpad document window. Using the Font options in the Home ribbon, change some text, not at the very top of the file, to be in bold. Then move to the top of the file and run the script. If bold text is found, the JAWS cursor moves to it, and the PC cursor is routed to the position and reactivated. Then the script confirms the font and speaks the current line where the bold text begins.

Take care when working with the Wordpad.jss script source file because it already contains scripts and functions by default that ship with JAWS. Place your sample code at the very bottom of the file. And make sure to remove this overwritten Wordpad.jss and its associated overwritten Wordpad.jsb and Wordpad.jkm files from your user Settings(language) folder when done testing. It is assumed that the script is being processed in the Wordpad.jss script source file and compiled in the Wordpad.jsb script binary file.

Script MyAttributesTest ()
Var
    Int attributes
If GetWindowClass (GetFocus ()) == cwc_RichEdit50W && ! DialogActive () ; This is the Wordpad document window.
    If FindFirstAttribute (attrib_bold,True) ; Restrict the search To the document window.
        RoutePCToJAWS ()
        PCCursor ()
        SayFont ()
        SayLine()
    EndIf
EndIf
EndScript


Array Type Variables

Keywords:

  • IntArray

  • StringArray

  • HandleArray

  • ObjectArray

  • VariantArray

  • New

Description

An array is a data type that contains a fixed number of elements, and whose elements are accessed by means of an integer index. Arrays are created to hold the data type for which they are intended. For example, IntArrays hold integers, StringArrays hold strings, etc. A VariantArray holds data of type variant, which means that it may hold any data type.

After declaring an array, create it and specify the size of the array using the keyword, New. The array is fixed to be the size specified at the time it is created. Multiple dimensions may be created, and can be separated with a comma.

You may access elements in an array by means of indices enclosed in square brackets.

Syntax

Var
    TypeArray xArray
Let xArray = New TypeArray(size)
Let xArray[i] = value
Var
    TypeArray xyArray
Let xyArray = New TypeArray(sizeX,sizeY)
Let xyArray[i,j] = value
  • TypeArray is any of the types of arrays that may be created-IntArray, StringArray, HandleArray, ObjectArray, or VariantArray.

  • XArray is an array variable being declared and created. It is a one-dimensional array.

  • Size is the number of elements in the one-dimensional array xArray.

  • XyArray is an array variable being declared and created. It is a one-dimensional array.

  • SizeX is the number of elements in the first dimension of the one-dimentional array xyArray.

  • SizeY is the number of elements in the second dimension of the one-dimensional array xyArray.

  • I is an index into the array.

  • J is an index into the second dimension of the one-dimensional array.

  • Value is a value assigned to an element of the array.

Remarks

Declaring the array does not create it. Creation of the array must be done by means of the New statement.

A VariantArray can contain items of any type. Collections can be elements of an array if that array is of type VariantArray. The script code should take care to manage the types of data in variant arrays appropriately.

Arrays are always passed to functions by reference.

Assigning one array to another will result in two variables referring to the same array.

There is no compile-time error if the wrong number of index expressions is specified for an array, or if an index attempts to access outside the bounds of the array.

There is also no runtime error notification, but the error may cause JAWS to lock. Therefore, take care to avoid illegal index references.

Code Sample

The below nonsense example shows the power of arrays and in fact of the VariantArray type.

Messages
;For sMsgGemInfo, %1 is the gem type, %2 the jewelry, %3 the occasion, %4 the number, and %5 the shape
@sMsgGemInfo
%5 %1 %2s For the %4 %3s
@@
EndMessages

Script TestArrays ()
	ArrayOfGemsCollections()
EndScript

Void Function GmsInit(Collection Gms, String Name, String Type, String Occasion, Int Number, String Shape)
Let Gms.Name = Name
Let Gms.Type = Type
Let Gms.Occasion = Occasion
Let Gms.Number = Number
Let Gms.Shape = Shape
EndFunction

Void Function ArrayOfGemsCollections()
Var
    VariantArray Gems,
    Collection gms,
    Int i,
    String sMessage
Let Gems = New VariantArray[5]
Let gms = New Collection
gmsInit(gms,"emerald","pendant","birthday",6,"oval")
Let Gems[1] = gms
Let gms = New Collection
GMSInit(gms,"diamond","ring","engagement",7,"square-cut")
Let Gems[2] = gms
Let gms = New Collection
GMSInit(gms,"sapphire","bracelet","anniversary",9,"round")
Let Gems[3] = gms
Let gms = New Collection
GMSInit(gms,"ruby","pairs of earring","graduation",8,"tear-drop")
Let Gems[4] = gms
Let gms = New Collection
GMSInit(gms,"pearl","necklace","wedding",20,"cultured")
Let Gems[5] = gms
Let gms = New Collection
For i = 1 To 5
    SayFormattedMessage(ot_line,
    FormatString(sMsgGemInfo,
    Gems[i].name,
    Gems[i].type,
    Gems[i].occasion,
    Gems[i].Number,
    Gems[i].Shape)
    )
EndFor
For i = 1 To 5
    Let sMessage = FormatString(sMsgGemInfo,
    Gems[i].name,
    Gems[i].type,
    Gems[i].occasion,
    Gems[i].Number,
    Gems[i].Shape)
    TypeString (sMessage + cscBufferNewLine)
EndFor
EndFunction


Operators

The Freedom Scientific Scripting language supports the use of many operators. Operators are grouped by usage at heading level 2 elements, and each operator within that group is at a heading level 3 element along with its relevant descriptive information. Where the name of the operator is a punctuation character symbol or group of characters, it is spelled out in parentheses after the character or group of characters.

Unless otherwise specified, the version where the operator was first made available to the Scripting language was JAWS 4.5.

Arithmetic Operators

Operator: + (plus) Use the + (plus) operator in equations to indicate addition or to concatenate strings enclosed in quotation marks.

Operator: - (minus) Use the - (dash) minus operator in equations to indicate subtraction.

Operator: * (asterisk) Use the * (asterisk) operator in equations to indicate multiplication.

Operator: / (slash) The / slash operator is used in equations to indicate division.

Operator: % (percent) The result of the modulus operator (%) is the remainder when the first operand is divided by the second.

Comparison Operators

Operator: == (double equal) The == (double equal) operator asks whether the first condition is equal to the second condition.

Operator: != (is not equal to) The != (exclamation mark equal to) operator asks whether the first condition is not equal to the second condition.

Operator: >= (greater than or equal to) The >= (greater than or equal to) operator asks whether the first condition is greater than or equal to the second condition.

Operator: > (greater) The > (greater than) operator asks whether the first condition is greater than the second condition.

Operator: <= (less than or equal to) The <= (less than or equal to) operator asks whether the first condition is less than or equal to the second condition.

Operator: < (less than) The < (less than) operator asks whether the first condition is less than the second condition. Logical Operators

Operator: && (double ampersand) The && (double ampersand) operator asks whether the first condition is true, and additionally whether the second condition is true.

Operator: || (double vertical bar) The || (double vertical bar) operator asks whether the first condition is true, or if the second condition is true. If the first condition is true, the second condition is not evaluated. It does not matter which condition is true

Operator: ! (Exclamation point) The ! (exclamation mark) operator negates the expression to which it is applied. It is equivalent to the "not" keyword.

Bitwise Operators

Operator: & (ampersand) The & (ampersand) bitwise operator compares each bit of its first operand to the corresponding bit of its second operand. If both bits are 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.

The best example of how to use this operator is in the NewTextEvent function in default.jss. In this function, it is used for a binary comparison of two binary numerical values. The value of nAttibutes is a multiple digit binary numerical value that indicates all the attributes applying to the buffer string. Each attribute is indicated by whether a certain bit in the byte is turned on. The & operator returns all values that exist in both numerical values. For example, if the value of nAttributes is 01001010, then the seventh bit in the result byte of nAttributes & ATTRIB_HIGHLIGHT is set to 1 (ATTRIB_HIGHLIGHT = 64 or 01000000 binary). The second bit in the result byte of nAttributes & ATTRIB_BOLD is set to 1 (ATTRIB_BOLD = 2 or 00000010 binary). The fourth bit in the result byte of nAttributes & ATTRIB_UNDERLINE is set to 1 (ATTRIB_UNDERLINE = 8 or 00001000 binary). But the third bit in the result byte of nAttributes & ATTRIB_ITALIC is set to 0 since ATTRIB_ITALIC is 4 or 00000100 binary and the third bit in the nAttributes byte is 0.

Operator: | (vertical bar) The | (bitwise vertical bar) operator compares each bit of its first operand to the corresponding bit of its second operand. If either bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.

This operator does a bit-by-bit comparison of two numerical values which is similar to that of the & operator. For example, the statement 00100110 | 11000000 returns 11100110.

Operator: ~(tilde) Use the ~(tilde) operator with & and | (the "and" and "vertical bar") bitwise operators to mask off or exclude a bit from being processed. A good example is in default.jss in the ObjStateChangedEvent function in the following statement:

IndicateControlState(iObjType,nState& (CTRL_CHECKED|CTRL_UNCHECKED))

The statement ensures that if the control is partially checked, the unchecked and checked states are not processed and therefore not indicated by JAWS.

Operator: << (less than less than) Bitwise left shift. Use to shift the bits in a bitwise pattern left. Often, this is done to move a bit to a specific position in a bit set before performing some other bitwise operation.

Operator >> (greater than greater than) Bitwise right shift. Use to shift the bits in a bitwise pattern right. Often, this is done to move a bit to a specific position in a bit set before performing some other bitwise operation.

Miscellaneous Operators

Operator: = (equals) Use this operator to assign a value to a variable.

Operator: . (dot) Use the dot operator to assign or retrieve the name of an item in a collection when the name of the item is known. For example, you can use Months.January to access the item called January in the Months collection. But you may not use The dot operator to access the name of the item if the name of the item is enclosed in quotes, contained in a variable, or is returned by a function call.

Version: This operator is available as of JAWS 11.

Operator: New Use the New operator to create an instance of an array of collection. You must specify the size and dimensions of the array when creating a new array and when creating an instance of the array.

Version: This operator is available as of JAWS 11.

Operator: [] (left bracket, right bracket) Use brackets to specify the size of an array when creating the array . Also, you may use them to access elements of an array. If the array is multi-dimensional, you must separate the index for each dimension by commas. For example, [3,5] specifies the element on the third row and fifth column of the array.

Additionally, use brackets to assign or retrieve the name of an item in a collection if the name of the item is enclosed in quotes, contained in a variable, or is returned by a function call.

Version: This operator is available as of JAWS 11.

Operator: () (left-parenthesis right-parenthesis)

Use to enclose a parameter list for a function call, or to establish order of precedence.



Event Function Reference

This reference gives you basic information about event functions utilized by JAWS, MAGic and PAC Mate Omni. Most of these functions can be found in the default script file, Default.jss. You can view the code of each function by opening the default script file within the Script Manager.

AppWillNotSpeakEvent

Description This function is performed when an unauthorized application is opened in restricted mode. The function produces the "Cannot speak in Restricted Mode" message when authorization is either not found or inaccurate.

Syntax AppWillNotSpeakEvent (strApp)

Parameters strApp - String; the name of the application that will not speak in restricted mode

Returns None

Category Application info

AutoFinishEvent

Description This event Function is performed when the application is closed. The function is also performed when the application is switched from or looses focus, as with ALT + TAB.

Syntax AutoFinishEvent ()

Parameters None

Returns None

Category Application info

AutoStartEvent

Description This event Function is performed when the application is started. This function is also performed when the application is switched to or gets focus, as with ALT + TAB.

Syntax AutoStartEvent ()

Parameters None

Returns None

Category Application info

BottomEdgeEvent

Description This function is performed when the active cursor attempts to move beyond the bottom edge of the active window. The function receives the window handle as a parameter.

Syntax BottomEdgeEvent (WinHandle)

Parameters WinHandle - handle; handle of the window whose bottom edged was reached

Returns None

Category Cursors

CellChangedEvent

Description This function is performed when the cursor moves from one cell in a table to a new cell in either the same table, a nested table or parent table.

Syntax CellChangedEvent (nNewCol, nNewRow, nNewNesting, nNewRowColCount, nPrevCol, nPrevRow, nPrevNesting, nPrevRowColCount)

Parameters

nNewCol - integer; the number of the new column

nNewRow - integer; the number of the new row

nNewNesting - integer; the number of the new nesting

nNewRowColCount - integer; number of the new row and column counts

nPrevCol - integer; the number of the previous column

nPrevRow - integer; number of the previous row

nPrevNesting - integer; the number of the previous nesting

nPrevRowColCount - integer; number of the previous row and column counts

Returns None

Category Screen text

ClipboardChangedEvent

Description This event is performed when the contents of the Windows clipboard is replaced.

Syntax ClipboardChangedEvent ()

Parameters None

Returns None

Category Clipboard

CursorShapeChangedEvent

Description This function is performed when the mouse pointer changes shape. The name of the new shape is passed to this function via a string variable.

Syntax CursorShapeChangedEvent (CursorType)

Parameters CursorType - String; the string value for the current cursor type

Returns None

Category Cursors

DialogPageChangedEvent

Description This function is performed when switching between pages of a multipage dialog box.

Syntax DialogPageChangedEvent(hwndNewPage, hwndOldPage)

Parameters

hWndNewPage - Handle; handle of the new page in a multi page dialog box

hWndOldPage - Handle; handle of the old page in the multi page dialog box

Returns None

Category Dialogs

DocumentLoadedEvent

Description This function is performed when a document is loaded in Internet Explorer. The function starts SayAll when the web page loads.

Syntax DocumentLoadedEvent ()

Parameters None

Returns None

Category HTML

FocusChangedEventEx

Description This function is performed when focus moves between applications, dialogs, dialog controls, or to another item within a control with child items. The function must determine the type of focus change and then call the proper event to handle the type of focus change that has occurred.

Syntax FocusChangedEventEx (hWndFocus, nObject, nChild, hWndPrevFocus, nPrevObject, nPrevChild, nChangeDepth)

Parameters

hWndFocus - handle; the handle of the window that has received the focus

nObject - integer; the number of the object that has received the focus

nChildObject - integer; the number of the current child object

hWndPrevFocus - handle; the handle of the window that previously had the focus

nPrevObject - integer; the number of the object that previously had the focus

nPrevChild - integer; the number of the child object that previously had the focus

nChangeDepth - integer; the change depth (number of levels in the window hierarchy affected by the change)

Returns None

Category Window

FocusChangedEvent

Description This function is performed when focus moves between applications, dialogs, and dialog controls. The window handles of the previous and current windows are passed to this function. This function calls either SayWindowTypeAndText, SayFocusedWindow or SayFocusedObject in order to ensure that the active control is properly spoken.

Syntax FocusChangedEvent (FocusWindow, PrevWindow)

Parameters

FocusWindow - Handle; handle of the window that has received the focus

PrevWindow - Handle; handle of the window that previously had the focus

Returns None

Category Window

FocusPointMovedEvent

Description This function is performed when the pixel location of the blinking caret or highlight changes. Examples of focus changes include moving focus from one control to a different control within an application or dialog and moving the insertion point through a document. The pixel location is determined by video resolution as in row and column coordinates. Processor intensive code should not be included in this function as it is performed each time the PC cursor moves.

Syntax FocusPointMovedEvent (nX, nY, nOldX, nOldY, Unit, nDir, nTimeElapsed)

Parameters

nX - Integer; current horizontal coordinate of the PC cursor

nY - Integer; current vertical coordinate of the PC cursor

nOldX - Integer; previous horizontal coordinate of the PC cursor

nOldY - Integer; previous vertical coordinate of the PC cursor

nUnit - Integer; the movement unit as constant variables defined in hjconst.jsh

nDir - Integer; the direction of movement as constant variables defined in hjconst.jsh

nTimeElapsed - Integer; the amount of time (milliseconds) that has elapsed since the movement occurred

Returns None

Category Cursors

ForegroundIconicEvent

Description This event function is performed when all apps are minimized or closed and the focus is not placed on the desktop. More testing is needed before it is implemented.

Syntax ForegroundIconicEvent(HANDLE hwndForeground)

Parameters hwndForeground - Handle; handle of current foreground window (not focus)

Returns None

Category Window

ForegroundWindowChangedEvent

Description This function is performed each time a new real window gains focus. A real window is a window that has a title. Real windows are often application, and dialog main windows.

Syntax ForegroundWindowChangedEvent (newWindow)

Parameters NewWindow - Handle; handle of the new window

Returns None

Category Window

FormsModeEvent

Description This function is performed when forms mode is entered or exited. The function is passed a Boolean value indicating which of these actions has taken place. If bEntering is equal to true, forms mode has been turned on. If bEntering is equal to false, forms mode has been turned off

Syntax FormsModeEvent(bEntering)

Parameters bEntering - Integer; boolean value representing the current state of forms mode

Returns None

Category HTML

FrameLoadedEvent

Description This function is performed when a web page updates or loads content to a frame contained on the page. It is currently implemented in only the Internet Explorer script file.

Syntax FrameLoadedEvent (hDoc, sFrameName)

Parameters

hDoc - handle; the handle of the window of the parent document

sFrameName - string; the name of the frame being updated

Returns None

Category HTML

HelpBalloonEvent

Description This function is performed for Windows XP Help Balloons. In Windows XP two kinds of bubbles are displayed to provide help. The first is a ToolTip that is processed by the ToolTipEvent. The second is a Help Balloon that triggers this event.

Syntax HelpBalloonEvent(hwnd, sText)

Parameters

hWnd - Handle; the handle to the help balloon window

sText - String; the text of the help balloon

Returns None

Category Window

ItemNotFoundEvent

Description This event is performed when the item cannot be found in the Off Screen Model.

Syntax ItemNotFoundEvent (int hwnd)

Parameters hWnd - Integer; Window handle

Returns None

Category Screen text

JavaFocusChangedEvent

Description This function is performed when focus moves between Java applications, dialogs, and dialog controls.

Syntax JavaFocusChangedEvent (FocusWindow, PrevWindow)

Parameters

FocusWindow - handle; the handle of the window that has received focus

PrevWindow - handle; the window that previously had the focus

Returns None

Category Window

KeyPressedEvent

Description This function is performed when a keystroke is pressed. All key presses cause this function to fire. If the key is assigned to a script, then KeyPressedEvent is called before the script itself. Because this function will be called quite frequently, it is recommended that you refrain from intensive tasks that will be performed each time a keystroke is pressed.

Syntax KeyPressedEvent (nKey, strKeyName,IsBrailleKey, IsScriptKey)

Parameters

nKey - integer; numeric key value

strKeyName - string; key name as it is used in the key map file

IsBrailleKey - Integer; set to 1 if the key is on a Braille display

IsScriptKey - integer; set to one if the key is assigned to a script

Returns None

Category Keyboard

MagSendKeyEvent

Description If a MAGic key event is attached to a key in a key map file, then you can use this function to send the key event on to the MAGic interface. For example, when the key is pressed to toggle magnification, the KI_MAGONOFF needs to be passed on to the MAGic user interface for processing.

Syntax MAGSendKeyEvent (nKICode)

Parameters nKICode - integer; The code for the key event. These codes can be found in magcodes.jsh.

Returns Integer - If MAGic is not running, or nKICode is out of range, then the function will return FALSE. Otherwise, TRUE is returned.

Category MAGic

Description This function is performed when the status of a menu changes. There are three menu modes as defined in HJCONST.JSH. They are: MENU_INACTIVE, MENUBAR_ACTIVE, and MENU_ACTIVE. This event receives the Handle of the menu and the mode of the menu as parameters.

Syntax MenuModeEvent (WinHandle, mode)

Parameters

WinHandle - Handle; handle of the menu

mode - Integer; the mode of the menu whose status has just changed

::: {#returns-21}

Returns

:::

None

::: {#category-22}

Category

:::

Menus

MouseMovedEvent

::: {#description-24}

Description

:::

This function is performed when the mouse is moved. This function is passed two integers. The first value specifies the x-coordinate at the position of the mouse pointer. The second parameter specifies the y-coordinate and the position of the mouse pointer.

::: {#syntax-22}

Syntax

:::

MouseMovedEvent (int x, int y)

::: {#parameters-22}

Parameters

:::

x - Integer; the horizontal position of the mouse pointer in pixels

y - Integer; the vertical position of the mouse pointer in pixels

::: {#returns-22}

Returns

:::

None

::: {#category-23}

Category

:::

Mouse

NewTextEvent

Description This function is performed when new text is written to the screen. When this function is called, it receives information pertaining to the newly written text. If the text was written in a frame, then the text is spoken according to the frame's echo setting. Otherwise the text is sent to SayHighlightedText () or SayNonHighlightedText ().

Syntax NewTextEvent (hwnd, buffer, nAttributes, nTextColor, nBackgroundColor, nEcho, sFrameName)

Parameters

hWnd - handle; Handle of the window containing the text that was written

Buffer - String; string containing the text that was written

nAttributes,- Integer; The attributes of the text that was written

nTextColor - Integer; The foreground color of the text that was written

nBackgroundColor - Integer; the background color of the text that was written

nEcho - Integer; the echo setting associated with this text

sFrameName - String; the name of the frame containing the newly written text if applicable

Returns None

Category Screen text

SayAllStoppedEvent

Description This function is performed when the SayAll function stops.

Syntax SayAllStoppedEvent ()

Parameters None

Returns None

Category Screen text

ScreenStabilizedEvent

Description This event is performed after no screen writes have occured within a reasonable amount of time. The window handle of the last window to which text was written is passed as the parameter to this event function.

Syntax ScreenStabilizedEvent (hWndLastTextWrite)

Parameters hWndLastTextWrite - handle; the window handle where the last text write occurred

Returns None

Category Screen text

SpeechToggledEvent

Description This function is performed whenever speech is turned on or off.

Syntax SpeechToggledEvent (bSpeechOn )

Parameters bSpeechOn - integer; This is the Boolean value whether speech has been turned on or off.

Returns None

Category Voices

TextSelectedEvent

Description This event is performed when text is selected or unselected.

Syntax TextSelectedEvent(strText, bUnSelecting)

Parameters

strText - String; the selected text.

bUnselecting - Integer; Boolean value used to indicate when text is being unselected.

bContainsSpeechMarkup - integer; Boolean value used to indicate whether or not text contains speech mark up. This parameter is optional.

Returns None

Category Selection

ToolTipEvent

Description This function event is called if the JCF option OPT_PROCESSTOOLTIPEVENT is set to one. It is also called by the autographics labeler. This event runs each time a tool tip appears. It currently is used only to store the text of the last tool tip in the global string variable STRLastTooltip.

Syntax ToolTipEvent (hWnd, strText)

Parameters

hWnd - Handle;

strText - String; tool tip text

Returns None

Category Window

TopEdgeEvent

Description This function is performed when the active cursor attempts to move beyond the top edge of the active window. The function receives the window handle as a parameter.

Syntax TopEdgeEvent (WindowHandle)

Parameters WindowHandle - handle; handle of the window whose top boundary was reached.

Returns None

Category Cursors

TutorMessageEvent

Description This event is performed after the FocusChangedEvent and when the focus moves between menu items. It is always called after NewTextEvent and hence SayHighlightedText. The function speaks tutor or access key messages.

Syntax tutorMessageEvent(hwndFocus, nMenuMode)

Parameters

hWndFocus - Handle; handle of the window with focus

nMenuMode - Integer; menu mode

Returns None

Category Help

WindowActivatedEvent

Description This function is generally triggered when focus changes because of the opening or closing of a top-level window, such as when a dialog appears or disappears.

Syntax WindowActivatedEvent (hWindow)

Parameters hWindow - handle; handle of the window just activated

Returns None

Category Window

WindowCreatedEvent

Description This function is performed when a window is created. Processor intensive code should not be included in this function, as The code within this function is processed very frequently.

Syntax WindowCreatedEvent (handle hWindow, int nLeft, int nTop, int nRight, int nBottom)

Parameters

hWindow - Handle; handle of the window just created

nLeft - Integer; left edge of the window

nTop - Integer; top edge of the window

nRight - Integer; right edge of the window

nBottom - Integer; bottom edge of the window

Returns None

Category Window

WindowDestroyedEvent

Description This function is performed when a window is closed. This function can be modified for application specific needs.

Syntax WindowDestroyedEvent (handle hWindow)

Parameters hWindow - Handle; handle of the window that is about to be closed

Returns None

Category Window

WindowMinMaxEvent

Description This function is performed when the Minimize/Maximize status of a window changes. nMinMaxRest gives general information about what is happening to the window. It can be WE_MINIMIZE, WE_MAXIMIZE, or WE_RESTORE. nShow is more specific. For a complete list of nShow values, look for "SW_" in hjconst.jsh.

Syntax WindowMinMaxEvent (hWindow, nMinMaxRest, nShow)

Parameters

hWindow - Handle; the handle of the window whose status is about to change

nMinMaxRest - Integer; describes the general action about to take place on the window

nShow - Integer; describes the specific action taking place on the window

Returns None

Category Window

WindowResizedEvent

Description This function is performed when a window is about to be resized. This function can be modified for application specific needs.

Syntax WindowResizedEvent (handle hWindow, int nLeft, int nTop, int nRight, int nBottom)

Parameters

hWindow - Handle; handle of the window about to be resized

nLeft - Integer; the left edge of the window that is about to be resized

nTop - Integer; the top edge of the window that is about to be resized

nRight - Integer; the right edge of the window that is about to be resized

nBottom - Integer; the bottom edge of the window that is about to be resized

Returns None

Category Window



JAWS Built-in Functions

JAWS Built-In Functions

function abs

Description Returns the absolute value of the supplied signed integer.

Example: abs (-35) would return 35, abs (100) would return 100, and abs (0xFFFF) would return 65535.

Returns int the absolute value of the supplied signed integer.

Param int the signed integer.

Category system

function ActivateMenuBar

Description Activates or deactivates the Menu bar for the active program. Same as pressing and releasing the ALT key.

Category Menus

function ActivateOnMouseOver

Synopsis Activates OnMouseOver action at active cursor

Description This function Activates the OnMouseOver action at the active cursor. It is used primarily for the virtual cursor. This function was introduced in JAWS 8.0 update.

Returns int TRUE if successful, FALSE otherwise.

Category Mouse

function ActivateStartMenu

Description Brings up the Start menu in Windows 95/98 or NT. Same as pressing CTRL + ESC.

Category Menus

function AddCustomNodes

Synopsis This is the companion function to OptionsTreeCore, which sets up the optional node structures.

Description This companion function to OptionsTreeCore lives in Default and operates on the string sent to the OptionsTreeCore function, adding node paths where paths did not exist. See the description for OptionsTreeCore for complete examples.

Param string/byRef/sCustomItems The string upon which to operate, adding the node paths where they don't exist.

Param string/strNewNode The node name to explicitly use for all strings not containing node paths. Leave this blank for JAWS to fill in the node name based upon the configuration set which is active at runtime.

Category User Options

function AddHook

Description Installs a hook function. When a hook of type script is in place, it is called right before every script is run, and passed the name of the script which activated the hook, and the frame name if the script is attached to a frame as its two parameters. If the hook function of type script returns TRUE, the script is allowed to execute; if it returns FALSE, the script received by the hook function will not be allowed to run. See the KeyboardHelp script and the KeyboardHelpHook function in DEFAULT.JSS for an example of a script type hook function in action. When a hook of type event trace is in place, it is called before every script event is run. An event trace hook receives as parameters The path and name of the JSB file that will run the event, the name of the event that will run, and any parameters received by this event. The event trace hook is for diagnostic purposes, it does not prevent script events from running.

Param Int The type of hook to be installed. Use HK_SCRIPT for a script type hook, or HK_EVENT_TRACE for an event trace hook. Hook types are defined in HJConst.JSH.

Param string The name of a function to be installed as a hook.

Category Scripts

function AddMarkupForLanguage

Description Marks up a string of text with the specified language code.

Returns string The text marked up with the language code.

Param string The language code to be added as mark up to the text.

Param string The text to be marked up with the language code.

Category Speech Markup

function AddTestSuite

Description Add a suite of tests to the TestRunner.

Param Handle/hRunner The handle of the test runner to be released. This is a handle that was generated in a call to GetTestRunner.

Param String/strTests The name of the test suite to be added.

Category Test

function AllowedToUseSkypeAPI

Synopsis Checks to see if this version of JAWS is allowed to use the Skype API

Description When a program like JAWS first tries to use the Skype API, Skype asks the user to allow or deny that program access. Once access is allowed it remains in place until a new build of the program is put in place, at which time the access check is repeated.

Returns int 0=Access is allowed,1= access is waiting for user approval, 2=Client has explicitly denied access, 3=API unavailable most likely because no user is logged in to Skype, 0x8001=Skype not running

Category System

function AllowFormsModeTransition

Description Used to allow or disallow forms mode transition.

Param int True if JAWS should allow forms mode transition, false otherwise. Assumed to be true by default.

Category HTML

function AlphaNumCombinations

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function AltLeftMouseClick

Description Simulates holding down the ALT key and clicking the left mouse button.

Category Mouse

function AppCommand

Description performs an Windows app-command action.

Param int An app command which is a numeric value corresponding to definition in winuser.h.

Category system

function AppendToClipboard

Synopsis Adds a string of text to the end or the beginning of the Windows Clipboard.

Description The previous clipboard contents are retained and the new text added to the front or end. Appended items are separated by blank line space. Only plain text can be appended to the Clipboard.

Returns Int TRUE if the item was appended. FALSE if there was nothing to append to or if the clipboard update failed.

Param String The string to append.

Param Int TRUE if adding string to the End. FALSE if adding to the front.

Category Clipboard

function AreJAWSFramesActive

Synopsis Returns TRUE if any frames are currently defined and valid

Description This function determines if any frames are currently valid. For example, if three frames are defined for the current application but only one is valid at the moment, this function will return TRUE. If none are valid or none are defined, the function will return FALSE.

Returns int TRUE or FALSE

Category frames

function ArrayLength

Synopsis Obtains the length of one dimension of an array

Returns int the length of a dimension of the array

Param variant/ArrayName the array for which the length is desired

Category Aggregate Data Types

function AttributeEnumerate

Synopsis Finds each field in a window with the specified attribute and calls a callback function with the field's rectangular coordinates.

Description This function provides a quick method of enumerating all fields in a window with a specified attribute. For each field found, the coordinates of the bounding rectangle are passed to the callback function. If the callback function returns false then the enumeration stops. the callback function must take the following parameters: int topLeftX, int topLeftY, int bottomRightX, int bottomRightY. It must return true to continue the enumeration or false to abort the enumeration.

Returns Int the number of fields found in the window.

Param Handle/hWnd the window to enumerate.

Param Int/iAttributes the attributes of the text to find.

Param String/sCallback the callback function name.

Category Text Format

function Beep

Description This is used to make the PC beep. It can be included within an If...Then...Else...statement so that when a certain condition is present, the PC will beep.

Category Sounds

function BottomOfColumn

Description When inside a table or spreadsheet, moves the active cursor to the bottom of the current column.

Returns Int TRUE if the cursor moved, FALSE otherwise.

Category Tables

function BrailleAddBrlCursorLine

Description This function is used To add the contents of the line at the Braille cursor to the display in Structured mode. It is different to BrailleAddFocusLine because it uses the line at the Braille cursor rather than the PC cursor. It is primarily required in virtual documents when Brailling table data.

Returns Int True if successful, false otherwise.

Category Braille Output

function BrailleAddColorField

Description Adds the current color field's line segment range to the Braille display's structured data including cursor tracking within the field. Note that this adds the current line segment falling within the color field, not the entire color field in the event that the color field spans multiple lines.

Optional

Param int/nSearchLeftMax The maximum distance to look left. The default distance is 0 pixels.

Param Int/nSearchRightMax The maximum distance to look right. The default distance is 0 pixels.

Param int/bSearchLeftFirst If True, JAWS looks left first, otherwise JAWS looks right first. The default value is true.

Category Colors

function BrailleAddField

Description Adds the field at the cursor to the Braille Structured data and allows cursor routing within the field.

Returns int true or false.

Optional

Param int If true, and the cursor is at the offset just after the last character of text in the field, jaws returns the preceding field.

Category Braille Output

function BrailleAddFocusCell

Description Used from within the BrailleAddObjectXX functions to Braille the contents of a table cell which may visually span multiple lines. This also allows proper tracking of the caret when editing the contents of a cell.

Returns Int True if successful, false otherwise.

Category Braille Output

function BrailleAddFocusItem

Description Used from within the BrailleBuildLine function to add the contents of the current control to the data to be shown on the Braille display.

Optional

Param int/noTranslation JAWS 19 and later: Set to true to force no translation for text in the focused item. If false or not supplied, text is translated if appropriate.

Param int/noSegmentDelimiter JAWS 19 and later: Set to true if you do not want the space between segments. (If false or not supplied, a segment delimiter space is added).

Category Braille Output

function BrailleAddFocusLine

Description Used from within the BrailleBuildLine function to add the contents of the current line to the data to be shown on the Braille display.

Returns Int True if successful, false otherwise.

Category Braille Output

function BrailleAddFrame

Description Used to Braille a frame.

Returns Int TRUE if the frame exists and was added, FALSE otherwise.

Param String/FrameName the name of the frame to be added.

Optional

Param Int/iAttribs attributes of text to include.

Param Int/iTextColor text color of text to include.

Param Int/iBackgroundColor background color of text to include.

Category Braille Output

function BrailleAddString

Description Used with in BrailleBuildLine to add text to the Braille display.

Returns Int TRUE if successful, FALSE otherwise.

Param String/Buffer Text to be added.

Param Int/XPosition The X position for the mouse to click if a routing button is pressed over any of the cells in this string. This value is used along with Y position to determine where to click. Make both values 0 if no click should happen.

Param Int/YPosition the Y position for the mouse to click if a routing button is pressed over any of the cells in this string. This value is used along with X position to determine where to click. Make both values 0 if no click should happen.

Param Int/Attributes Combination of the ATRIB_xxx values from HJCONST.JSH that indicate the attributes of the characters in this string.

Optional

Param int/bNoTranslation output this string directly without translation even if Grade II or UEB is turned on. (Available as of JAWS 10.0.)

Param int/noSegmentDelimiter JAWS 19 and later: Set to true if you do not want the space between segments. If false or not supplied, a segment delimiter space is added.

Category Braille Output

function BrailleAddStringWithCallback

Description Like BrailleAddString, but rather than supplying a click point, supply a function to be executed if a routing button is clicked within this segment. The function may have parameters, e.g. BrailleAddStringWithCallback("hello", "sayString ('hello') ", attrib_highlight)

Returns Int TRUE if successful, FALSE otherwise.

Param string/text the string to Braille.

Param string/funcNameAndParams a function and its parameters.

Optional

Param int attributes such as attrib_highlight, etc.

Param int noTranslation set to true to force no translation for text in the focused item. If false or not supplied, text is translated if appropriate.

Param int noSegmentDelimiter set to true if you do not want the space between segments. If false or not supplied, a segment delimiter space is added.

Category Braille Output

function BrailleAddTextBetween

Synopsis Like BrailleAddFocusItem but allows specification of starting and ending x-coordinate on current line.

Description This function adds the text between the specified coordinates to the Braille display. It is used in situations where you do not wish to show the entire line but do wish to show the cursor context as you edit in this area of the line. It is used for example in MSWord 2000 and above in table cells.

Returns Void

Param Int/x1 the starting coordinate on the line.

Param Int/x2 the ending coordinate on the line.

Category Braille Output

function BrailleAutoAdvanceMode

Synopsis Starts or stops Braille Auto Advance Mode.

Description When Auto Advance Mode is enabled, JAWS will automatically pan through documents at the specified speed. Panning stops either at the bottom of the document, focus changes, a routing button is pressed or this function is called again with the iMode parameter set to FALSE. If a Flash Message is displayed, Auto Advance is paused until the Flash message is manually or automatically cleared. The user may still pan left or right while the mode is active. the timer will be restarted so that the user may reread the new information.

Returns int TRUE if the feature was successfully enabled or disabled.

Param int/iMode Set to TRUE to turn the mode on, FALSE to turn it off.

Optional

Param int/nInterval optional duration between pans, if not supplied, defaults to the value of OPT_BRL_AUTOADVANCE_INTERVAL.

Category Braille Navigation

function BrailleAutoAdvanceModeActive

Synopsis Enables the user to query if the Braille auto Advance mode is active.

Description When Auto Advance Mode is enabled, JAWS will automatically pan through documents at the specified speed. Panning stops either at the bottom of the document, focus changes, a Flash Message is displayed or the feature is explicitly disabled. The user may still pan left or right while the mode is active. the timer will be restarted so that the user may reread the new information.

Returns int TRUE if the feature is active, FALSE otherwise.

Category Braille Navigation

function BrailleBuildStatus

Description Builds the line of Braille to be displayed in the status cells.

Returns Void

Category Braille Output

function BrailleClearMessage

Synopsis Clears the current Flash message.

Description This function clears the current Flash message.

Optional

Param int/iIgnoreIfInfinite if TRUE and the message time is set to infinite, the message will not be cleared, it defaults to FALSE.

Category Braille Output

function BrailleCount

Description Retrieves the number of Braille displays configured in JAWS

Returns Int the number of Braille displays configured in JAWS

Category Settings

function BrailleCursor

Description Turns on the Braille cursor. This cursor is only used internally by the Braille scripts and should never be left on after a script completes its work.

Category Cursors

function BrailleDisplayLoadErrors

Description Retrieves whether or not JAWS displays an error to the user when the Braille display at the specified index fails to load

Returns Int TRUE if the error should be displayed, FALSE otherwise

Param int/nIndex the index of the Braille display

Category Settings

function BrailleDriver

Description Retrieves the driver name of the Braille display at the specified index

Returns String The driver name of the requested Braille display, or " ," if there is not a Braille display at that index.

Param int/nIndex the index of the Braille display whose driver name is to be retrieved

Category Settings

function BrailleDriverInformation

Description Retrieves the driver information of the Braille display at the specified index

Returns String The driver information string of the requested Braille display, or " ," if there is not a Braille display at that index.

Param int/nIndex the index of the Braille display whose driver information string is to be retrieved

Category Settings

function BrailleG2StringLength

Description Determines the length of the translation to grade two Braille of a given string.

Returns Int The length of the given string when translated to grade two Braille.

Param string String of interest.

Category Braille Output

function BrailleGetCellCount

Synopsis Gets the number of cells available on the attached Braille Display.

Description this function returns the number of cells on the installed and active Braille display.

Returns Int The number of cells.

Category Braille Device

function BrailleGetCurrentProfileName

Synopsis Obtains the display name of the current Braille profile.

Description This function obtains the display name of the current Braille profile.

Returns string the name of the profile.

Category Braille Settings

function BrailleGetCurrentTranslatorMode

Synopsis Gets the current mode of the braille translator - this is an optional function for braille translator dlls.

Description Queries the active braille translator to see if it supports modes. If it does then the function gets the current mode setting.

Returns Int current mode of the braille translator if it supports modes, -1 otherwise. The first mode is always 0.

Category Braille Settings

function BrailleGetCursorDots

Description Retrieves the DOT pattern used to show the active cursor on the Braille display.

Returns String The DOT numbers used to show the active cursor. For example, "78."

Category Braille Output

function BrailleGetDataOffsetFromDisplayOffset

Synopsis Gets the offset into the original data from a display offset.

Description This function gets the offset into the original data (string) from a display offset (the offset as seen on the braille display). This is useful for getting the original position of a character, which is now at a different offset due to braille translation.

Returns int DataOffset the actual offset into the original data (string) sent to the display.

Param int DisplayOffset the offset as seen on the braille display

Category Braille Output

function BrailleGetDeviceInfo

Synopsis Gets the Braille Display's driver name, Model Name and Port string.

Description This function gets the Braille Display's driver library name, its model name and its port string.

Returns Int true if a Braille Display is found, False otherwise.

Param String/ByRef/sDriver Driver name.

Param String/ByRef/sName Display Name.

Param String/ByRef/sPort Port String.

Category Braille Device

function BrailleGetFramePrompt

Synopsis Returns the Braille prompt associated with the frame specified.

Description This function retrieves the Braille prompt of the specified frame. If no frame is specified then the frame at the active cursor location is asumed. Note that a frame's prompt is any string or strings defined as part of any EVENT_Focus/ACTION_BrailleString pairs.

Returns String the Braille prompt.

Optional

Param String/sName the name of the frame whose prompt you want.

Category Frames

function BrailleGetProfileState

Synopsis Gets the current profile's state

Description this function returns The current profile's state.

Returns int One of brlComputerInContractedOut, brlComputerInContractedOut or brlContractedInContractedOut.

Category Braille Settings

function BrailleGetStateString

Synopsis Returns a string defining the state for the specified state flags.

Description This function returns the state string as defined in the app or default jbs for the specified state flags. This may be a combination of strings. The state flags maybe any combinations of the CTRL_XX attributes defined in hjconst.jsh, eg CTRL_CHECKED etc.

Returns String the state string.

Param Int/nState the state flags.

Category Braille Output

function BrailleGetStatusCellCount

Description Returns the number of status cells on the currently attached Braille display.

Returns Int The number of status cells, or 0 if no Braille display is connected.

Category Braille Device

function BrailleGetSubtypeDisplayName

Synopsis Returns the type display name defined for the supplied type constant.

Description This function returns the type display name as defined in the app or default jbs for the specified type constant. Note that if no value is defined for a standard window type's displayname key in the jbs, the default string spoken for that type will be returned.

Returns String the type display name.

Param Int/nType either one of the wt_typeCode constants or a constant representing a custom control ie wt_custom_control_base + customControlCode.

Category Braille Output

function BrailleGetSubtypeString

Synopsis Returns the type string defined for the supplied type constant.

Description This function returns the type string as defined in the app or default jbs for the specified type constant.

Returns String the type string

Param Int/nType either one of the wt_typeCode constants or a constant representing a custom control ie wt_custom_control_base + customControlCode.

Category Braille Output

function BrailleGetTranslatorModeCount

Synopsis Returns the number of Braille Translator modes - this is an optional function for braille translator dlls.

Description Queries the active braille translator to see if it supports mode setting, and if so returns the number of modes.

Returns Int number of modes if braille translator supports modes, 0 otherwise.

Category Braille Settings

function BrailleGetTranslatorModeID

Description Returns the internal ID of the translator mode supplied by index.

Returns int The internal ID of the mode by index.

Param int/Index the index of the Braille rules whose ID to return.

Category Braille Settings

function BrailleGetTranslatorModeName

Synopsis Returns the name of a particular braille translator mode - this is an optional function for braille translator dlls.

Description Queries the active braille translator to see if it supports operating more than one mode. If it does then the function retrieves the name of the mode whose index matches the parameter provided.

Returns String copy of the braille translator mode name from the braille translator, empty string otherwise.

Param Int The index of the mode name desired - the index starts at 0.

Category Braille Settings

function BrailleGetTypeKeysMode

Synopsis Retrieves TypeKeys mode state available in Freedom Scientific Braille displays.

Description When TypeKeys mode is enabled, characters typed using the display are inserted into the application with focus.

Returns int TRUE if TypeKeys mode is enabled, FALSE otherwise.

Category Braille Keyboard

function BrailleInUse

Description Checks to see if a Braille display is in use.

Returns Int TRUE if Braille display is being used, FALSE otherwise.

Category Braille Device

function BrailleIsMessageBeingShown

Synopsis Determines if a Flash message is currently being shown on the display.

Description This function Determines if a Flash message is currently being shown on the display, ie if the user has called BrailleMessage or internal code has called ShowMessage.

Returns int true or false.

Category Braille Output

function BrailleIsStructuredLine

Description Determines if the Braille line is a structured line. Only applicable when using Structured mode.

Returns Int True if line is structured, false otherwise.

Category Braille Output

function BrailleLine

Description Sends the current line of text to a Braille display. It is automatically executed ten times per second and does not need to be routinely used by a script. It can be used in a script after the BrailleString function has been used and you are ready to display a line of information from the desktop.

Returns Void

Optional

Param int/whichRange If the entire line will not fit on the Braille display, then this indicates which portion to show. Should be one of the brlShowXXX constants in hjconst.jsh.

Category Braille Output

function BrailleLongName

Description Retrieves the descriptive name of the Braille display at the specified index

Returns String The descriptive name of the requested Braille display, or " ," if there is not a Braille display at that index.

Param int/nIndex the index of the Braille display whose name is to be retrieved

Category Settings

function BrailleMessage

Synopsis Sends a Flash message to the display.

Description This function sends a Flash message to the display which is held on the display for the specified length of time. You may append messages together by using the second optional parameter. If you do not specify the duration of the message or the append flag, the duration will default to the value of the OPT_BRL_MESSAGE_TIME JCF option and the message will replace any existing message.

Returns void

Param string sMessage the message to send.

Optional

Param int/iAppend if non-zero, the message will be appended to the existing message, if 0, the message will replace the current message.

Param int/tiMS the time in milliseconds to keep the message on the display before restoring the display to the prior content.

Category Braille Output

function BrailleMessageRepeatLast

Synopsis Reshows the last Flash message on the Braille display.

Description This function reshows the last Flash message that was sent to the Braille display. It is shown for the same duration as it was originally shown for and with the same prefix. This works even if Flash Messages have been disabled.

Returns int True if the last message was repeated, False if no messages have yet been shown.

Category Braille Output

function BrailleName

Description Retrieves the name of the Braille display at the specified index

Returns String The name of the requested Braille display, or " ," if there is not a Braille display at that index.

Param int/nIndex the index of the Braille display whose name is to be retrieved

Category Settings

function BrailleNextLine

Description Moves the Braille cursor one line down and shows the new line.

Returns Int "WAS_SUCCESSFUL" = 1,"WAS_NOT_SUCCESSFUL" = 0.

Category Braille Navigation

function BraillePanLeft

Description Displays the prior group of Braille characters from the line with the active cursor. The characters that are displayed when this function is used are those that precede the first character on the current display of Braille characters. For example, the display moves or pans to the left to reveal additional text.

Returns Int "WAS_SUCCESSFUL" = 1, "WAS_NOT_SUCCESSFUL" = 0.

Optional

Param Int true to move to the last segment of the prior line if no more text to the left, default value is false.

Category Braille Navigation

function BraillePanRight

Description Displays the next group of Braille characters from the line with the active cursor. The characters that are displayed when this function is used are those that follow the last character on the current display of Braille characters. For example, the display moves or pans to the right to reveal additional text.

Returns Int "WAS_SUCCESSFUL" = 1, "WAS_NOT_SUCCESSFUL" = 0.

Optional

Param Int true to move to the first segment of the next line if no more text to the right, default value is false.

Category Braille Navigation

function BraillePort

Description Retrieves the port name of the Braille display at the specified index

Returns String The port name of the requested Braille display, or " ," if there is not a Braille display at that index.

Param int/nIndex the index of the Braille display whose port name is to be retrieved

Category Settings

function BraillePortString

Description Retrieves the port string of the Braille display at the specified index

Returns String The port string of the requested Braille display, or " ," if there is not a Braille display at that index.

Param int/nIndex the index of the Braille display whose port string is to be retrieved

Category Settings

function BraillePriorLine

Description Moves the Braille cursor one line up and shows the new line.

Returns Int "WAS_SUCCESSFUL" = 1, "WAS_NOT_SUCCESSFUL" = 0.

Category Braille Navigation

function BrailleRefresh

Description Used to refresh the Braille display and redisplay the appropriate text.

Returns Void

Optional

Param int/whichRange If the entire line will not fit on the Braille display, then this indicates which portion to show. Should be one of the brlShowXXX constants in hjconst.jsh.

Category Braille Output

function BrailleRoutingButton

Description Attempts to move the PC cursor to the location designated by the braille cell.

Param int The 1-based number of a braille cell.

Optional

Param int/routingType 0 route and click, 1 rout only. See constants in hjconst.jsh.

Category Braille Navigation

function BrailleSetColorsToMark

Synopsis Allows user to specify the foreground and background colors of up to 9 color pairs which should be marked in Braille with DOTS 7 and 8.

Description This function allows the user to specify the foreground and background colors of up to 9 color pairs which should be marked in Braille with DOTS 7 and 8. This function also toggles the Braille Mark Colors to on. Supply an empty string to turn off color marking or set the JCF option to exclude marking colors.

Returns Void

Param String up to 9 pairs of text and background colors of the form rgb/rgb,rgb/rgb,... Supply empty string to turn off color marking.

Category Colors

function BrailleSetCurrentProfile

Synopsis Loads a Braille profile.

Description Loads a language specific Braille profile.

Returns int true or false.

Param string three letter language abbreviation or lang ID of the form 0x409.

Optional

Param int destination -1 (default) to not save to JCF, or one of wdUser, wdSession or wdFocus.

Category Braille Settings

function BrailleSetCursorDots

Description Sets the DOT pattern used to represent the active cursor on the Braille display.

Param String/DotPattern The DOT numbers used to show the active cursor. For example, "78."

Category Braille Output

function BrailleSetProfileState

Synopsis Sets the current profile's state

Description The profile's state can be set to one of brlComputerInContractedOut, brlComputerInContractedOut or brlContractedInContractedOut.

Returns int true or false.

Param int state one of the following constants from hjconst.jsh: brlComputerInContractedOut, brlComputerInContractedOut or brlContractedInContractedOut

Optional

Param int destination -1 (default) do not save, or one of wdUser, wdSession or wdFocus.

Category Braille Settings

function BrailleSetStatusCells

Description Puts characters on the status cells of the Braille Display. This function should only be called from within a BrailleBuildStatus function.

Param String/StatusText Characters to be placed in the Braille status cells.

Category Braille Output

function BrailleSetTranslatorMode

Synopsis Sets the braille translator mode - this is an optional function for braille translator dlls.

Description Queries the active braille translator to see if it supports mode setting. If it does then the function sets the mode using the parameter provided.

Returns Int TRUE if switching to the desired braille translator mode was successful, FALSE otherwise.

Param Int The index of the desired mode - the index starts at 0.

Category Braille Settings

function BrailleSetTypeKeysMode

Synopsis Sets the TypeKeys mode to the value specified by bEnable.

Description When TypeKeys mode is enabled, characters typed using the display are inserted into the application with focus.

Returns int TRUE if the value is properly set, FALSE otherwise.

Param int/bEnable Set to TRUE to enable TypeKeys mode, FALSE otherwise.

Category Braille Keyboard

function BrailleString

Description Sends the specified string to the Braille display regardless of whether or not the line is visible.

Param String/strBuffer String to be sent to the Braille display.

Category Braille Output

function BrailleSupportsTypeKeysMode

Description Determines whether or not TypeKeys mode is supported by at least one of the loaded Braille drivers.

Returns int TRUE if the mode is supported, FALSE otherwise.

Category Braille Keyboard

function BrailleSwitchTransLanguage

Description Switches to a Braille Translation engine appropriate for the specified language.

Returns Int true on success, false otherwise.

Param String language abbreviation, eg enu, deu, etc.

Category Braille Output

function BrailleVerbosity

Synopsis Adjusts the Braille verbosity.

Description When in structured mode varies the amount of descriptive information shown on the Braille display.

Returns String description of value to be displayed as value of Braille Verbosity.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category Braille Settings

function CallFunctionByName

Description Allows dynamically calling a function whose name is passed as the first argument. This means that the function name does not need to be known at compile time and can be passed in a variable. Note that using CallFunctionByName bypasses all checking of argument types that happens when a function is invoked normally.

Returns variant whatever the function being called returns

Param String/FunctionName the name of the function to be run

Optional

Param Variant the function's 1st argument

Param Variant the function's second argument

Param Variant the function's third argument

Param Variant the function's 4th argument

Param Variant the function's 5th argument

Param Variant the function's sixth argument

Param Variant the function's seventh argument

Param Variant the function's eighth argument

Param Variant the function's 9th argument

Category Scripts

function CancelLayeredKeySequence

Description Cancels any currently active key layer for both braille and QWERTY keyboards.

Category Keyboard

function CancelOCR

Synopsis If optical character recognition is in progress, cancels the operation.

Description If optical character recognition is in progress (initiated by OCRScreenArea), cancels the operation.

Returns void

Param int a job ID returned from OCRScreenArea identifying the OCR job to cancel.

Category Optical Character Recognition

function CanRecognize

Synopsis Determines if the OCR components are installed.

Description Determine whether the OCR components are installed.

Returns int 1 if OCR components are installed, 0 if OCR components are not installed or configured, and 2 if Convenient OCR Feature is Not supported.

Category Optical Character Recognition

function CapsIndicate

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function CapsIndicateDuringSayAll

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function CaptureAllGestures

Description If enabled, all gestures will be captured by JAWS, so that none will pass through to Windows. If disabled (default), then only gestures bound to scripts will be captured.

Returns void

Param int 1 for enable, 0 for disable

Category Scripts

function CaretVisible

Description Indicates whether an insertion point or a caret is visible in the active window. The function returns a constant value of TRUE to indicate that a caret is visible and a value of FALSE to indicate that it is not visible.

Returns Int "TRUE" = 1, "FALSE" = 0.

Category Cursors

function CenterMouseInView

Synopsis Centers the mouse in the active view.

Description The mouse is centered both horizontally and vertically. If MAGic is running and the screen is magnified, then the mouse is centered in the active view. Otherwise, the mouse is placed in the center of the display.

Category MAGic

function ChangeSystemVolume

Description Changes the system volume.

Param int The direction of volume change, use V_UP or V_DOWN defined in HJConst.jsh.

Param int The amount to change the volume. Volume ranges from 0 to 100.

Category system

function CheckAuthScheme

Description A call to this function determines if JAWS is authorized to run. For the dongle, a check is done to ensure the dongel is installed and that it is the correct one for the product .

Returns Int 0 if dongle is in place and authorized correctly, error code otherwise.

Category FS Product Info

function ClearSavedLocation

Synopsis Clears the prior saved location

Description This function clears the location saved by a prior call to SaveCurrentLocation.

Returns void

Category Cursors

function ClearScriptPerformanceHistory

Description Clears the Script Performance History.

Returns Void

Category Misc

function ClearSpeechHistory

Description Clears the Speech History buffer.

Returns void

Category Speech History

function ClickObjectByName

Description Does a LeftMouse click at the upper lefthand corner of the named object. This function relies on MSAA and is ideal for clicking an object that does not have its own window but for which you know the name.

Returns int TRUE if the object was found and could be clicked, false otherwise.

Param HANDLE/hwnd The window containing the object of interest

Param string/ObjectName The name of the object desired

Optional

Param int/nWhichOccurance If there is more than one object with this name, which one is desired. This parameter defaults to 1.

Category Object Model And MSAA

function ClipboardHasData

Description This function will return true if there is any data at all on the Windows clipboard.

Returns Int True if the clipboard contains data, false otherwise.

Category Clipboard

function CloseOleObject

Description Takes the pass-in IDispatch object, does a QueryInterface on it for IOleObject and if the QueryInterface succeeds, calls IOleObject::Close. This is very rarely used, and if none of the above makes sense assume you don't need to use it.

Returns int TRUE on success, FALSE on failure.

Param object/pObject the object that supports the IOleObject interface.

Category Object Model and MSAA

function CollectionCompare

Synopsis Compares the contents of two collections

Returns int True if the two collections have identical contents, False otherwise

Param collection/Collection1 the first of the collections to compare

Param collection/Collection2 the second of the collections to compare

Category Aggregate Data Types

function CollectionCopy

Synopsis Makes a deep copy of a collection

Description Normally when you assign a variable containing a collection to another variable, both variables then point at the same collection. This function allows making a copy of a collection so that each variable points at a unique copy of the collection. This means that if the elements of one collection are changed, these changes will not be reflected in the contents of the other collection.

Returns Collection a new collection with contents identical to that which was copied

Param collection/CollectionToCopy a variable containing the collection to be coppied

Category Aggregate Data Types

function CollectionItemCount

Synopsis Obtains the number of items contained in a collection

Returns int The number of items in the collection.

Param collection/CollectionName the Collection for which an item count is desired

Category Aggregate Data Types

function CollectionItemExists

Synopsis Determines if a specific item is contained in a collection

Returns int True if ItemName is in the collection, False otherwise.

Param collection/CollectionName the Collection to be searched

Param String/ItemName the name of the item to be looked up

Category Aggregate Data Types

function CollectionRemoveAll

Synopsis Removes all items from a Collection

Returns Void

Param collection/CollectionName the Collection from which all items should be removed

Category Aggregate Data Types

function CollectionRemoveItem

Synopsis Removes an item from a collection

Returns int True if ItemName was in the collection and was removed, False otherwise.

Param collection/CollectionName the Collection from which an item is to be removed

Param String/ItemName the name of the item to be removed

Category Aggregate Data Types

function CollectWindowInfo

Synopsis Collects the technical information about a window.

Description collects the technical information about a window.

Returns string The information retrieved for the window.

Param handle The window for which the information will be collected.

Category Utility

function ColorToRGBString

Description Converts a color value to a string of the form "255255255" where the first three digits represent the proportion of red, the second three digits the proportion of green, and the third three digits the proportion of blue.

Returns String The color value converted to an RGB string.

Param Int The color value to be used.

Category Colors

function ComAttachEvents

Synopsis Attaches script functions to events fired by a specific COM object.

Description For each event that the COM object fires, a script function will be called. If an event named OnBeforeClose is fired and sPrefix is word_ then the function word_OnBeforeClose will be called. This function should be defined with the parameters that the object passes to the event. Failure to add the parameters to the function definition will not cause any problems other than the inability of the function to access the information. No errors will be generated if only certain events have functions defined to handle them. The events will automatically be disconnected when the object to which they are connected goes out of scope or the variable containing the object is set to something else. This means that you should only attach events to objects referenced by global variables.

Returns int TRUE if events have been attached, FALSE otherwise.

Param Object The object for which events are desired

Param string/sPrefix The prefix to be added to the name of the event when constructing the name of the function to be called

Optional

Param string/IIDEventInterface The IID of the outgoing interface to which events are dispatched. This and all subsequent parameters should only be provided if the object does not support IProvideClassInfo2.

Param string/GuidTypeLib The GUID of the typelib in which the interface is described

Param int/TypeLibMajorVersion The major version of the typelib

Param int/TypeLibMinorVersion The minor version of the typelib

Category Object Model and MSAA

function ComDetachEvents

Synopsis Detaches script functions from a COM object.

Description This function only needs to be used if you want to hold on to an object but want the events from that object to stop being fired. If you let go of an object by setting the variable containing it to something else, the events will automatically be detached.

Returns int TRUE if events have been detached, FALSE otherwise.

Param Object The object for which events are no longer desired

Category Object Model and MSAA

function ComGetAvailableNames

Description A method for a script developer to interrogate an object and get back all its methods and properties. Returns the name of each method or property.

Returns string A list of available methods and properties for the supplied object. Items are separated by newlines.

Param object/ComObject The object to be interrogated. The results you get back will depend upon the object and how much of it is outward-facing.

Category Object Model and MSAA

function ComRelease

Synopsis Releases a COM object

Description When called with a single argument, this is equivalent to releasing the object without blocking, even if that means to intercept another process. When the optional second argument is TRUE, the object will be released in a way that there is no chance of the Release call blocking, even if the Release involves calling into another process that isn't responsive. When set to FALSE, the second parameter means set the object to null, releasing the pointer in JAWS. In other words, if the argument references an IDispatch object, that object will be released. The second parameter is set to TRUE by default. This added functionality is less resource efficient and should only be used in those situations where the call is likely to block.

Returns int TRUE if the object has been release, FALSE otherwise.

Param Object/obj The object to release

Optional

Param int/KeepFromBlocking TRUE to take steps to ensure that the call doesn't block, false simply to null the object. If this parameter is not specified, the default is TRUE.

Category Object Model and MSAA

function ContractedBrailleInputAllowedNow

Description Overwrite this function in your script file when you need to turn off Contracted Braille input in a scenario where it would otherwise be enabled. An example would be in Microsoft Word, where Quick Navigation Keys are enabled, CanEditNow should return false so the keyboard is used for navigation rather than editing This is called for the item with focus., and is not called for a window which does not support contracted input to begin with..

Returns int TRUE or False, script method for enabling or disabling contracted Braille input.

Category Braille Keyboard

function ControlCanBeChecked

Description Determines whether or not the current control can be checked.

Returns Int 0 if cannot be checked or 1 can be checked.

Category Dialog Controls

function ControlEnterKey

Synopsis The ControlENTER key is passed to the application.

Description Passes the ControlEnter key through to the application. If the virtual cursor is active and on an element with an OnMouseOver handler then the OnMouseOver handler is activated for that element.

Returns Void

Category Keyboard

function ControlIsChecked

Description Determines whether or not the current control is checked.

Returns Int Returns true or false.

Category Dialog Controls

function ControlLeftMouseClick

Description Sends a Control Left Mouse click to the system, useful for selecting non-contiguous items in a list.

Category Mouse

function ControlShiftEnterKey

Synopsis The Control Shift ENTER key is passed to the application.

Description Passes the Control Shift Enter key through to the application. If the virtual cursor is active and on an element then the focus is set on that element and Control + Shift + Enter key is passed to the application.

Returns Void

Category Keyboard

function ConvertListToNodeList

Synopsis Prepends alist of options with the same node path.

Description When you need to add a whole group of options in the same branch of the tree view, use this function to give each option the same node path. Pass the group in the standard list format using the vertical bar ( ) symbol as the primary array delimitor, and the colon (:) symbol as the divider between the callback function and the display text.

Param string/ByRef/strList The list of list item segments, delivered in the dlgSelect*ToRun format

Param string/sNode The node path explicit to the list you specified in the first parameter.

Category User Options

function ConvertLookupModuleDataToList

Description This list can be used to present to the user via dlgSelectItemInList.

Returns string a UI-capable list, presenting Rule set first, then Lookup Module name. This is the Pretty name assigned to the active rule set.

Param int/nSize The number of items to expect in the subsequent module and rule set lists.

Param string/strModules The list of lookup modules - delimited by LIST_ITEM_SEPARATOR or the bell char ( \007)

Param string/strRuleSets The list of rule sets - delimited by LIST_ITEM_SEPARATOR or the bell char (\007)

Category Research It

function CopyToClipboard

Description Puts a string of text onto the Windows clipboard erasing any previous clipboard contents. In order to copy multiple lines of text, these must be concatenated together into a single string before calling CopyToClipboard. In the concatenated string, lines should be separated with \r \n.

Param String/ClipboardData Text to be copied to the Windows clipboard.

Category Clipboard

function CreateObject

Description In applications such as Internet Explorer or those found in Microsoft Office, launches an application under the control of JAWS, which is the automation object. The difference between CreateObject and GetObject is that GetObject creates a pointer to an automation object that already exists, whereas CreateObject creates the automation object for the application.

Returns Object The automation object associated with the program.

Param String/ApplicationName Name of the COM class that can return an automation object.

Optional

Param string/manifestFile name of the manifest file that contains the Registration Free COM information or the name of a .dll with a manifest embedded as a resource. Providing this parameter allows creation of an object that hasn't been registered. More information can be found at http://msdn.microsoft.com by searching for "Registration Free COM"

Category Object Model And MSAA

function CreateObjectEx

Description In applications such as Internet Explorer or those found in Microsoft Office, launches an application under the control of JAWS, which is the automation object. The difference between CreateObject and GetObject is that GetObject creates a pointer to an automation object that already exists, whereas CreateObject creates the automation object for the application.

Returns Object The automation object associated with the program.

Param String/ApplicationName Name of the COM class that can return an automation object.

Param Int TRUE = Same behavior as CreateObject. FALSE = Will always force the use of CoCreateInstance instead of using GetObjectHelper when JAWS is running as a service.

Optional

Param string/manifestFile name of the manifest file that contains the Registration Free COM information or the name of a .dll with a manifest embedded as a resource. Providing this parameter allows creation of an object that hasn't been registered. This parameter is supported in JAWS 10.0 and beyond More information can be found at http://msdn.microsoft.com by searching for "Registration Free COM"

Category Object Model And MSAA

function cStrBrailleList

Description This function returns the default Braille verbosity list. The functions is found in VerbosityCore.jss. Use the new TreeCoreGetDefault version with JAWS 9 and later for AdjustJAWSOptions dialog box.

Returns String

Category Scripts

function cstrBrailleMarkingList

Description This function returns the default Braille marking verbosity list.

Returns String

Category Scripts

function cStrDefaultHTMLList

Description This function returns the default HTML verbosity list. This function is now legacy, and lives in VerbosityCore.jss. Use its TreeCore companion for VCursor options to add to the AdjustJAWSOptions tree.

Returns String

Category Scripts

function cStrDefaultList

Description This function returns the default verbosity dialog list. The list is now legacy, but is replaced with the new TreeCore functions.

Returns String

Category Scripts

function cStrTableBrailleList

Description This function returns the default Braille HTML table verbosity list. This list is now legacy, and the functions live in VerbosityCore.jss. For new functionality, use the TreeCore companion functions in default.jss

Returns String

Category Scripts

function CustomLabelsSet

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function DebugLookupModuleQueryUsingListOfModules

Description Debug output for rule set. Error codes / text are placed in the Virtual Viewer for developers of rule sets and/or modules. This function only displays what's thrown up by Invoke calls. No parameters, as it runs as a stand-alone providing both a list of available rule sets and a prompt to enter the search term. To make your rule set discoverable first, put at least a dummy version of the files into the RuleSets folder of your subdirectory. Then go to Settings Center Research It and make sure yours is checked, so it's available for listing. When asked for the search term, press ESC to send a blank string, or type the term and press ENTER. Note that in JAWS 12 or later, Settings Center replaces Configuration Manager.

Category Research It

function DecToHex

Synopsis converts a decimal integer to a hex string.

Description This function converts a decimal integer to a hex string.

Returns string The hex value

Param int/iDec decimal value

Category Number conversion

function Delay

Description Makes a script stand still for a specified period of time. It causes a script to stop, wait a period of time, and then resume again. It is different than the Pause function which yields to the processing needs of applications.

Param Int Type a number to indicate the amount of time that the script should be delayed. The number 1 equals one-tenth of a second. The number 10. equals one second. Do not use numbers with decimals, and do not use quotation marks.

Optional

Param Int/nNoEvents TRUE to suppress checking for and processing FocusChangedEvent and NewTextEvent functions before returning from the delay.

Category Scripts

function DeleteFile

Synopsis Deletes a specified file.

Returns int True if the file was successfully deleted, False otherwise

Param string/Filename the name of the file to delete

Category Files

function DescribeAreaEx

Description Describes a screen area.

Returns int 0 on success, any value greater than 0 on error.

Param int/left Screen area left coordinate

Param int/top Screen area top coordinate

Param int/right Screen area right coordinate

Param int/bottom Screen area bottom coordinate

Param int/multiService 0 to use only the Microsoft image recognition service, 1 to use all image recognition services.

Category Picture Smart

function DescribeClipboardEx

Description Describes an image on the clipboard.

Returns int 0 on success, any value greater than 0 on error.

Param int/multiService 0 to use only the Microsoft image recognition service, 1 to use all image recognition services.

Category Picture Smart

function DescribeCursorEx

Description Describes an image at the cursor.

Returns int 0 on success, any value greater than 0 on error.

Param int/multiService 0 to use only the Microsoft image recognition service, 1 to use all image recognition services.

Category Picture Smart

function DescribeSelectedFileEx

Description Describes the currently selected image file.

Returns int 0 on success, any value greater than 0 on error.

Param handle/focusWindow Focus window.

Param int/primaryLang Primary recognition language.

Param int/secondaryLang Secondary recognition language.

Param int/multiService 0 to use only the Microsoft image recognition service, 1 to use all image recognition services.

Param int/globalOcrJobId Recognition identifier.

Category Picture Smart

function DesktopAttachEvent

Synopsis Called right after switching from the security desktop to the user-desktop

Description This is the place for scripts to reconnect any COM events that were previously disconnected in DesktopDetachEvent. This function is only called when JAWS is running as a service.

Category Object Model and MSAA Events

function DesktopDetachEvent

Synopsis Called right before switching from the user-desktop to the Security desktop

Description This is the place for scripts to disconnect any COM events. This function is only called when JAWS is running as a service.

Category Object Model and MSAA Events

function DialogActive

Description Used to determine whether a dialog box is currently active. It returns a constant value to indicate the status: ACTIVE indicates that a dialog box is active, and INACTIVE indicates that a dialog box is not active. These constants can be used in If...Then...Else...statements.

Returns Int "ACTIVE" = 1, "INACTIVE" = 0.

Optional

Param int/useTopWindowControlType Specifies whether the control type of the top level window should be taken into consideration. The default is true.

Category Dialogs

function DisplayShapeOverlapInfo

Synopsis Display overlap information for the selected shape in the virtual buffer.

Description If the selected object is of type WT_SHAPE information about any shapes that overlap the shape are put in the virtual buffer.

Returns int TRUE if information was placed in the virtual buffer else FALSE.

Category Misc

function DlgAriaLiveRegionFilterText

Description Displays the ARIA Live Region dialog.

Returns int 1 if the dialog was opened successfully, regardless of the action performed.

Category HTML

function DlgCustomizeColumns

Synopsis Displays Custom column headers options.

Description Displays a dialog that contains options for indicating how column headers are spoken or brailled. This function requires the caller to supply column header text delimited by a vertical bar character. This function also requires the caller to supply a key in the form of a string to store the custom information. The function also returns the current or modified speech and braille custom column information.

Returns Int FALSE if the DlgCustomizeColumns is already open, TRUE otherwise.

Param String/sColumnHeaders Contains a list of vertical bar character delimited column header text.

Param String/sKey A key to identify specific custom column information.

Optional

Param String/sDialogTitle A string used for the dialog title.

Param String/ByRef/sSpeechColumnRules The current or modified Speech Column information.

Param String/ByRef/sBrailleColumnRules The current or modified Braille Column information.

Category User Interaction

function DlgCustomizeListview

Synopsis Displays Listview column headers options.

Description Displays a dialog that contains options for indicating how Listview column headers are spoken or brailled.

Returns Void

Param Handle/hwnd The handle of the Listview of interest.

Category User Interaction

function DlgGetCustomSummaryInfo

Synopsis Displays dialog for labeling cells.

Description Displays a dialog that contains options for labeling cells and cell ranges in spreadsheets.

Returns Void

Param String/sSection The name of the worksheet.

Param String/sKey The name of the cell or cell range (Example, A1 or A1:B1).

Param String/sValue The description for the cell or cell range.

Param String/sFileName The file name of the JSI file.

Category User Interaction

function DlgListOfDropTargets

Description Displays a list of possible drop targets for a drag and drop operation on a web page.

Returns int 1 if the dialog was opened successfully, regardless of the action performed. 0 if there were no drop targets available.

Category HTML

function DlgListOfLandmarks

Description Displays a list of possible landmarks on a web page.

Returns int 1 if the dialog was opened successfully, regardless of the action performed. 0 if there were no landmarks.

Category HTML

Returns int True if links exist, false otherwise.

Optional

Param int linkTypeFlags set of flags specifying which kinds of links to include in the list, see hjconst.jsh for values, use 0xff or leave empty to include all links.

Category HTML

function DlgListOfPlaceMarkers

Synopsis Displays a dialog containing a list of PlaceMarkers.

Description PlaceMarkers dialog provides Add,MoveTo,ChangeName,Remove and RemoveAll PlaceMarker capabilities.

Returns Int TRUE if successful, returns FALSE otherwise.

Param Int/nAdd 1 to pop up Add dialog,bypassing PlaceMarkers dialog, 0 to display PlaceMarkers dialog.

Category HTML

function DlgSelectAVoiceProfile

Description Displays a dialog that contains a set of Voice Profiles. The user can select a voice profile as their default profile or can select a profile to be application specific.

Category User Interaction

function DlgSelectControls

Description Displays a list box containing controls you may want to perform any one of the following actions: right single click, left single click, left double click, or Move To. You may change the dialog window title, display any combinations of the buttons, and specify a default.

Returns Int An integer value indicating what type of mouse action is required to activate the selected task tray icon, whether it be Left Mouse Button, Right Mouse Button, or double click of the left mouse button.

Param String/strGraphicList The list of controls.

Param Int/nIdx/ByRef The number of controls.

Param String/strWindowTitle The new window title.

Param Int/nMask The mask that indicates the buttons desired. See the available buttons in HjConst.jsh with the prefix bt_.

Param Int/nDefault The default button as specified by the mask value.

Optional

Param Int/nDefaultSelectedIndex the index of the item which should have the focus when the dialog is invoked. (JAWS 12.0 and above)

Category User Interaction

function dlgSelectFunctionToRun

Description Presents a list of functions to be run and displays their current value. Pressing the space bar or the Execute button will change the return value of the selected function, based on how the function was written. It is much like dlgSelectScriptToRun except that it does not merely speak, but the new return values are placed in the list box.

Param String strList This is the delimited list to be presented in the list box. It is in the same format as the dlgSelectScriptToRun function.

Param String/strDialogName Enter the string consisting of the Dialog's name.

Param Int/iSort Enter True if the items are to be sorted alphabetically, false otherwise.

Category User Interaction

function DlgSelectItemInList

Description Displays a dialog that contains a set of menu items. When the dialog is okayed, the one based index of the selected item is returned.

Returns Int This is 0 if the dialog was cancelled, otherwise the one based index of the selected item.

Param String/Items A " \007" delimited set of menu items.

Param String/DialogName A string containing the name you want to appear as the title for the Menu Select dialog.

Param Int/nSort If TRUE, then the contents of the list will be sorted.

Optional

Param Int/nDefaultSelectedIndex the index of the item which should have the focus when the dialog is invoked. (JAWS 5.0 and above)

Param string/sButtonList a list of up to 5 button names delimited with the vertical bar character "ButtonCaption1 ButtonCaption2l ...ButtonCaption5"

Param int/byRef/nButtonIndex The 1-based button index of the custom button invoked, 0 for cancel, -1 for OK.

Category User Interaction

function DlgSelectScriptToRun

Description Displays a dialog that contains a set of scripts. Scripts can be performed from this dialog.

Param String/Scripts A " \007" delimited set of script names. Aliases can also be included in this list. Example: ScriptDialog (VerbosityLevel:Verbosity \007ScreenEcho). This would create a listbox containing entries; Verbosity and ScreenEcho.

Param String/DialogName A string containing the name you want to appear as the title for the script dialog. If this parameter is "PerformScript" is used for the title.

Param Int/nSort If TRUE, then the contents of the list will be sorted.

Category User Interaction

function DlgSkimRead

Synopsis Displays Skim Reading options.

Description Displays a dialog that contains options for indicating how Skim Reading is performed.

Returns Void

Category Skim-Reading

function DlgSysTray

Description Displays a list box containing the icons on the System Tray

Returns Int An integer value indicating what type of mouse action is required to activate the selected task tray icon, whether it be Left Mouse Button, Right Mouse Button, or double click of the left mouse button.

Param String/strGraphicList The list of Task tray icons.

Param Int/nIdx The number of Task tray icons.

Category User Interaction

function DocumentPresentationSet

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function DoesSelectedShapeOverlap

Description Checks if selected shape is overlapped by another shape

Returns int TRUE or FALSE

Category Misc

function DoesWindowBelongToFocusedThread

Description Determines if hwnd belongs to the same thread as the window with focus.

Returns Int TRUE if hwnd belongs to the same thread as the app with focus, FALSE otherwise

Param handle/hwnd Handle of window to check.

Category Window

function DoFlexibleWebDialog

Description Launches the dialog for flexible web.

Returns int 0 if the dialog failed to launch successfully, non-zero otherwise.

Category HTML Flexible Web

function DownCell

Description When inside a table or spreadsheet, moves the active cursor to the same cell in the next row.

Returns Int TRUE if the cursor moved, FALSE otherwise.

Category Tables

function DragItemWithMouse

Description The drag-and-drop function is used to move the contents of one area of the screen to another area of the screen.

Param Int/SourceX The X coordinate of the item that is to be moved.

Param Int/SourceY The Y coordinate of the item that is to be moved.

Param Int/TargetX The X coordinate of the target location for the item.

Param Int/TargetY The Y coordinate of the target location for the item.

Category Mouse

function EnableFlexibleWeb

Description Enables or disables flexible web.

Param int On or Off.

Category HTML Flexible Web

function EnablePerModeGestures

Description If enabled (default), mode specific gestures will be available. If disabled, only base gestures will be available.

Returns void

Param int 1 for enable, 0 for disable

Category Scripts

function EnableRemoteAccessClient

Description Enable or disable the Remote Access Client component. The Remote Access Client component is typically enabled during product installation. When the component is enabled, %product% is able to recieve speech and Braille through a Citrix or Remote Desktop client session.

Returns Int TRUE if the component is successfully set to the desired state, FALSE otherwise.

Param int Set parameter to TRUE to enable or FALSE to disable.

Category System

function EnableRemoteAccessServer

Description Enable or disable the Remote Access Server component. The Remote Access Server component is typically enabled during product installation. When the component is enabled, %product% is able to run in a Remote Desktop or Citrix session.

Returns Int TRUE if the component is successfully set to the desired state, FALSE otherwise.

Param int Set parameter to TRUE to enable or FALSE to disable.

Category System

function EndOfRow

Description When inside a table or spreadsheet, moves the active cursor to the end of the current row.

Returns Int TRUE if the cursor moved, FALSE otherwise.

Category Tables

function EnterKey

Synopsis The ENTER key is passed to the application.

Description Passes the enter key through to the application. If the Virtual PC cursor is positioned on a link or button, it is activated. If the Virtual PC cursor is on another form control, Forms Mode is activated.

Optional

Param int - 0 no input origin specified. 1 specifies that the command has originated from the keyboard. 2 specifies that the command has originated from a Braille display (i.e. Whiz wheel up/down). 3 specifies that the command has originated from a mouse click. Defaults to 0.

Category Keyboard

function EnumerateChildWindows

Synopsis For each child of the specified window, calls a callback script function which may optionally process the window and either stop or continue the enumeration.

Description This function calls a specified function for each child of the starting window. This function must be defined as: int function SomeName(handle hwnd). This function must return true if the enumeration should continue or false if it should stop.

Returns Int true if the enumeration completed, false if it was terminated by the callback function returning false for a window.

Param Handle/hWnd starting handle.

Param String/sFunctionCallback The name of the script function to call for each child window.

Category Window

function EnumerateTypeAndTextStringsForWindow

Synopsis Calls a specified function with info about each control in a window

Description Information about each control is obtained using MSAA. The order in which items are enumerated is dictated by how they appear in the MSAA hierarchy. The callback function takes the following parameters: int typeCode, int stateCode,string name, string value,string Description. If the callback function returns 0 the enumeration stops, if it returns 1 the enumeration continues.

Returns int Number of controls enumerated.

Param handle/Window The window containing the controls to be enumerated.

Param String/CallbackName Name of the function to be called for each control.

Category Object Model and MSAA

function EscapeKey

Synopsis The ESCAPE key is passed to the application.

Description Passes the ESCAPE key through to the application. If the cursor is in the virtual ribbons, special functionality takes place.

Category Keyboard

function ExecuteZoomTextCommand

Synopsis Executes ZoomText command

Returns int TRUE when the command was successfully passed to ZoomText

Param String/CommandName Name of command to be executed.

Category Scripts

function ExMessageBox

Synopsis Displays a Windows Standard Message Box.

Description This function displays a Windows Standard Message Box. It is very much like the function MessageBox except it allows you to specify the Message Box title and the type of message box (i.e. The buttons that are used and the icon that is to be displayed). This function also returns a value that indicates which button was pressed on the Message Box.

Returns Int Returns an integer value indicating which button was pressed on the message box.

Param String/strMsg The text of the message that you would like to be displayed in the main body of the message box.

Param String/strTitle The text of the Message Box's title.

Param Int/iType One or more of the Message Box type specifiers that are listed in HJConst.jsh, separated by a single vertical bar. An example of such is: MB_YESNOCANCEL MB_DEFBUTTON1 making the Yes button the default.

Category User Interaction

function ExtractLanguageCodeFromMarkup

Description Extracts language code from marked up text, if any exists.

Returns string The language code.

Param string The marked up text from which a language code is to be extracted.

Category Speech Markup

function FetchCollectionProperty

Description A batch method to retrieve all values from an atomic property of a list of objects within a VB collection. This assumes that the collection is indexable, not just accessible by property name. Use this function to save a for loop's worth of round trip calls to access a collection member by index. Since the return is a variantArray, you can index that with a local for loop which will process much faster.

Returns int TRUE if the remote object was accessed, FALSE otherwise. May return TRUE and also supply an array length of 0 if there are no members.

Param object/remoteCollection the VB object collection that can be accessed by index.

Param string/list the property name of the list to be accessed by index. Often item, as it's written. E.g. list.item(i)

Param int/LowerBound Most VB arrays are 1-based.

Param int/upperBound the end point of the search, often a VB collection will have a .count property or method you can use for this.

Param string/methodOrPropertyName The atomic property you want, For example, "name" if the access is expressed like: list.Items(i).name

Param variantArray/byref/items All the values returned as a variant array. Note that even if the function returns TRUE, it may return a 0-length array.

Category Object Model and MSAA

function FetchObjectProperties

Description Retrieve all properties at once for a VB object. This saves round trips to and from the remote object, where you need to access a lot of properties of a particular object. For example, in Excel, the cell object has a lot of properties that are useful, but the round trip cost to get the properties can be expensive. Note that like a VB object itself, you may see the name for the property, but its value may be null or empty.

Returns int TRUE if the remote object was accessed, FALSE otherwise. TRUE does not mean the collection has items or that the items all have values. Only that the remote object was queried successfully.

Param object/remoteObject The object whose collection members to fetch.

Param collection/byref/JAWSLocalCollection a JAWS script language collection a map of the entire collection in one batch.

Category Object Model and MSAA

function FileExists

Description Checks to see if the specified path exists.

Returns Int TRUE if the path exists.

Param String/strFile The file to be checked.

Category Files

function FilenameGetNearestMatch

Synopsis finds a file whose name most closely matches the given name.

Description This function looks for a file whose name most closely matches the supplied name. The function uses the second two parameters to narrow the search. This function is most useful in locating JSI files to associate settings with documents whose settings maybe similar, indicated by similar file names eg Excel monthly reports.

Returns String The nearest matching filename to the one specified.

Param String/sFileToMatch The filename (including optional path). If the path is not specified the script directory is assumed.

Param Int/nMustMatchFirstNChars specifies the minimum number of characters of the filename's prefix which must match, eg if you are only interested in jsi files starting with excel_ then the value of this parameter would be 6.

Param Int/nMustMatchExtention Set this to true if the extention must match.

Category Files

function FileNameList

Synopsis Returns a delimited list of file names matching the specified criteria.

Description This function returns a delimited list of file names matching the specified criteria. For example, to get a list of scheme files, pass in "*.smf" for the first parameter

Returns String a delimited list of file names matching the specified criteria.

Param String sFileNameMask filename mask optionally including path information. If no path is included, the settings/lang path is prepended

Optional

Param String sDelim the delimiter to separate filenames with. If no delimiter is supplied, \007 is used.

Param String callback an optional callback function for filtering each file. The function is passed the basename of the file (i.e. without extension) and it must return true to include it in the list, or false to exclude it.

Category Files

function FindAncestorOfType

Description Searches the ancestors of the current object to find one with the indicated type.

Returns int The level in the ancestry of the current object with the matching type.

Param Int/typeToFind One of the wt_typeCode constants.

Category Object Model And MSAA

function FindCaret

Description allows the user to specify the coordinates of the system caret when JAWS is unable to locate it.

Returns Int TRUE if the function is determining the correct caret location, false otherwise.

Param Int/nX/ByRef set to x coordinate of caret.

Param Int/nY/ByRef set to y coordinate of caret.

Category Cursors

function FindColors

Description Searches for the occurrence of a specific combination of foreground and background colors. If the search is successful, the JAWS cursor is placed at the beginning of the text with the desired combination of colors.

Returns Int The number is 1 if the search was successful, 0 if it was not successful.

Param Int Type in a variable name or function that can provide the color value to be used as the foreground color. RGBStringToColor is often used as a parameter. Use the constant IgnoreColor defined in the file HJConst.jsh to ignore the foreground color and search only for the occurrence of the background color.

Param Int Type in a variable name or function that can provide the color value to be used as the background color. RGBStringToColor is often used as a parameter. Use the constant IgnoreColor defined in the file HJConst.jsh to ignore the background color and search only for the occurrence of the foreground color.

Param Int Type in one of the following constants defined in HJConst.jsh to indicate the direction of the search: s_top, to search from the top of the active window; s_bottom, to search from the bottom of the active window; s_next, to search forward from the position of the active cursor; s_prior, to search backward from the position of the active cursor.

Optional

Param int set this to TRUE to restrict the search to the window containing the active cursor, FALSE for an unrestricted search, if not supplied, defaults to FALSE, ie unrestricted. this optional parameter is only available in JAWS 6.0

Category Colors

function FindDescendantWindow

Description Find the descendant window with the specified Control ID.

Returns Handle The handle of the window that is found. This is 0 if the window is not found.

Param Handle The handle of the parent window that will serve as the starting point for the search.

Param Int The Control ID of the window for which you are searching.

Category Window

function FindDistantAncestorOfType

Description Searches the ancestors of the current object starting from the most distant to find one with the indicated type.

Returns int The level in the ancestry of the current object with the matching type; -1 if type is not found.

Param Int/typeToFind One of the wt_typeCode constants.

Category Object Model And MSAA

function FindFirstAttribute

Description Searches for the first occurrence of text with certain attributes. It begins the search at the upper left corner of the specified window and moves downward. If the search is successful, then the active cursor is placed on the first character that has the desired attributes. Generally, the PC cursor can be successfully moved to attributes within a text window.

Returns Int "WAS_SUCCESSFUL" = 1, "WAS_NOT_SUCCESSFUL" = 0.

Param Int Type the name of the constant value for the attribute that is to be located: ATTRIB_BOLD, ATTRIB_UNDERLINE, ATTRIB_ITALIC, ATTRIB_HIGHLIGHT, and ATTRIB_STRIKEOUT. You can search for a combination of attributes by placing a PLUS SIGN ( + ) between constants. For example, ATTRIB_BOLD + ATTRIB_UNDERLINE.

Optional

Param int set this to TRUE to restrict the search to the window containing the active cursor, FALSE for an unrestricted search, if not supplied, defaults to FALSE, ie unrestricted. this optional parameter is only available in JAWS 6.0

Category Text Format

function FindGraphic

Description FindGraphic searches for a graphic in the specified window. If the graphic is found, then the JAWS cursor is placed on it. The graphic must have a text label associated with it because the FindGraphic function searches for text labels. Text labels are assigned by the Graphics Labeler.

Returns Int "WAS_SUCCESSFUL" = 1, "WAS_NOT_SUCCESSFUL" = 0.

Param Handle Specify a window handle. Type the name of a variable or choose a script function that indicates the window that is to be searched.

Param String Type the graphic label that is to be located. The label must be typed exactly as it appears in the graphic label file. Enclose the graphic label within quotation marks.

Param Int Indicate the search direction. Type a constant value to indicate the starting point for the search: S_TOP or S_BOTTOM.

Param Int Indicate search restriction. Type the name of a constant value to indicate whether the search should be restricted to the active window or it should extend into all child windows of the active application. Type S_UNRESTRICTED to search all application windows or S_RESTRICTED to limit the search to the active child window.

Category Graphics

function FindJAWSHelpFile

Description Retrieves the full path to the specified JAWS help file. This will depend in part on the current language.

Returns String Full path to the specified JAWS help file.

Param String/strHelpFile Name of the desired help file.

Category JAWS Program

function FindJAWSHomeFile

Description Retrieves the full path to the specified file in the JAWS home directory.

Returns String Full path to the specified JAWS file.

Param String/strFile Name of the desired file.

Category JAWS Program

function FindJAWSPersonalizedSettingsFile

Description Retrieves the full path to the specified JAWS personalized settings file. This will depend in part on the current language; it may also depend on the current logged-in user.

Returns String Full path to the specified JAWS personalized settings file.

Param String/strSettingsFile Name of the desired personalized settings file.

Optional

Param Int TRUE if the file is to be created in the user's personalized settings directory.

Category JAWS Program

function FindJAWSSettingsFile

Description Retrieves the full path to the specified JAWS settings file. This will depend in part on the current language; it may also depend on the current logged-in user.

Returns String Full path to the specified JAWS settings file.

Param String/strSettingsFile Name of the desired settings file.

Optional

Param Int TRUE if the file is to be created in the user's settings directory.

Category JAWS Program

function FindJAWSSoundFile

Description Retrieves the full path to the specified JAWS sound file. This will depend in part on the current language; it may also depend on the current logged-in user.

Returns String Full path to the specified JAWS sound file.

Param String/strSoundFile Name of the desired sound file.

Optional

Param Int TRUE Optional. if only the user's space is to be searched, FALSE to search both user and shared spaces. Leave this parameter empty (do not include) to specify FALSE.

Category JAWS Program

function FindJAWSUtilityProgram

Description Retrieves the full path to the specified JAWS utility program.

Returns String Full path to the specified JAWS utility program.

Param String/strUtility Name of the desired utility program.

Category JAWS Program

function FindKeyAliasMatch

Description Find the actual key that has the passed in alias.

Returns String The name of the key that matches the Alias. The returned string is empty if no match is found.

Param String/strAlias

Category Keyboard

function FindLastAttribute

Description Searches for the last occurrence of text with certain attributes. It begins the search at the lower right corner of the active window and moves up to the upper left corner of the window. If the search is successful, then the active cursor is placed on the first character that has the desired attributes. Generally, the PC cursor can be successfully moved to attributes within a text window.

Returns Int "WAS_SUCCESSFUL" = 1, "WAS_NOT_SUCCESSFUL" = 0. "FALSE" = search failure.

Param Int Type the name of the constant value for the attribute that is to be included in the search: ATTRIB_BOLD, ATTRIB_UNDERLINE, ATTRIB_ITALIC, ATTRIB_HIGHLIGHT, and ATTRIB_STRIKEOUT. You can search for a combination of attributes by placing a PLUS SIGN ( + ) between constants. For example, ATTRIB_BOLD + ATTRIB_UNDERLINE.

Optional

Param int set this to TRUE to restrict the search to the window containing the active cursor, FALSE for an unrestricted search, if not supplied, defaults to FALSE, ie unrestricted. this optional parameter is only available in JAWS 6.0

Category Text Format

function FindNextAttribute

Description Searches for the next occurrence of text with certain attributes. The search begins at the location of the active cursor and moves down through the remainder of the active window. If the search is successful, then the active cursor is placed on the first character that has the desired attributes. Generally, the PC cursor can be successfully moved to attributes within a text window.

Returns Int "WAS_SUCCESSFUL" = 1, "WAS_NOT_SUCCESSFUL" = 0.

Param Int Type the name of the constant value for the attribute that is to be located: ATTRIB_BOLD, ATTRIB_UNDERLINE, ATTRIB_ITALIC, ATTRIB_HIGHLIGHT, and ATTRIB_STRIKEOUT. You can search for a combination of attributes by placing a PLUS SIGN ( + ) between constants. For example, ATTRIB_BOLD + ATTRIB_UNDERLINE.

Optional

Param int set this to TRUE to restrict the search to the window containing the active cursor, FALSE for an unrestricted search, if not supplied, defaults to FALSE, ie unrestricted. this optional parameter is only available in JAWS 6.0

Category Text Format

function FindPriorAttribute

Description Searches for the prior occurrence of text with certain attributes. It begins the search at the location of the active cursor and moves up through the remainder of the active window. If the search is successful, then the active cursor is placed on the first character that has the desired attributes. Generally, the PC cursor can be successfully moved to attributes within a text window.

Returns Int "WAS_SUCCESSFUL" = 1, "WAS_NOT_SUCCESSFUL" = 0.

Param Int Type the name of the constant value for the attribute that is to be included in the search: ATTRIB_BOLD, ATTRIB_UNDERLINE, ATTRIB_ITALIC, ATTRIB_HIGHLIGHT, and ATTRIB_STRIKEOUT. You can search for a combination of attributes by placing a PLUS SIGN ( + ) between constants. For example, ATTRIB_BOLD + ATTRIB_UNDERLINE.

Optional

Param int set this to TRUE to restrict the search to the window containing the active cursor, FALSE for an unrestricted search, if not supplied, defaults to FALSE, ie unrestricted. this optional parameter is only available in JAWS 6.0

Category Text Format

function FindString

Description FindString searches for a string of text in a specified window. If the text is found, then the JAWS cursor is placed at the beginning of the text string

Returns Int "WAS_SUCCESSFUL" = 1, "WAS_NOT_SUCCESSFUL" = 0.

Param Handle Specify a window handle. Type the name of a variable or choose a script function to provide the handle of the window that is to be searched.

Param String Specify the text that is to be located. Type a text string, or type a variable name or choose a script function that can provide the text. Text strings must be enclosed within quotation marks.

Param Int Indicate the search direction. Type the name of a constant value to indicate the direction of the search: S_TOP or S_BOTTOM.

Param Int Indicate search restriction. Type the name of a constant value to indicate whether the search should be restricted to the active window or it should extend into all child windows of the active application. Type S_UNRESTRICTED to search all application windows or S_RESTRICTED to limit the search to the active child window.

Optional

Param int/bUseUnderlyingDom set to TRUE to use the ap's underlying DOM to find text even if not onscreen, FALSE to do an onscreen search (for backward script compatibility, defaults to FALSE)

Category Strings

function FindTopLevelWindow

Description Find the top level window with the specified window class and/or window name. If you do not wish to search based on one of the arguments, use " ," for that argument

Returns Handle The handle of the window that is found. This is 0 if the window is not found.

Param String The window class that will be used to find the desired window.

Param String The window name that will be used to find the desired window.

Category Window

function FindWindow

Synopsis finds a window with a specified class or name.

Description This function starts at the specified window and searches all of its children to find one with the specified Class or Window Name. If the handle is 0 then a top level window is sought (ie equivalent to calling FindTopLevelWindow). Leave the name blank to find a window with a class but any name or leave the class blank to find a window with any class but a particular name.

Returns Handle the window handle of the found window.

Param Handle/hStart starting window.

Param String/sClass class name to search for.

Optional

Param String/sWindowName the name of the window to find.

Category Window

function findWindowByType

Synopsis Finds a child window by its type.

Description This function allows the scripter to find a child window of a given window with a specified window type.

Returns handle the handle of the window with the specified type if found, or 0 if no window with the specified type exists under the starting window's hierarchy.

Param handle the starting window

Param int the window type (one of the WT_ constants from hjconst.jsh).

Category Window

function FindWindowsSystemFile

Description Retrieves the full path to the specified Windows system file.

Returns String Full path to the specified WIndows system file.

Param String/strSystemFile Name of the desired file.

Category JAWS Program

function FindWindowWithClassAndId

Synopsis Finds a child window with a given control ID and class

Description this function is useful when control IDs are not unique in an application and you need to find a child window with a given control ID and class name.

Returns handle the handle of the window if found, NULL otherwise

Param handle/hwnd starting handle

Param string/sClass the class name

Param int/ControlID the control ID of the child

Category Window

function FirstCell

Description When inside a table or spreadsheet, moves the active cursor to the first cell.

Returns Int TRUE if the cursor moved, FALSE otherwise.

Category Tables

function FlashMoviesRecognize

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function FlexibleWebGetActiveRulesNumberForSelectedLocation

Description Returns the number of selected rules for the current location, when the Apply Flexible Web rules dialog is active, and the focus is in the Locations tree view.

Returns int The number of active rules for the selected Location

Category HTML Flexible Web

Synopsis Causes the system focus to move to a specified link in a document.

Description The first link in the buffer is 1, the second 2, etc.

Returns int The number of the link

Param int/LinkNumber The 1-based number of the link to which focus should move.

Category Object Model and MSAA

function FocusWindowSupportsUIA

Description Determines if the focus window supports UIA.

Returns int

Category Window

function FormatString

Description Formats the string you specify with the messages received as subsequent parameters. The message to be formatted must be delimited with the parameter place holder delimiters, such as %1 %2 %3 %4 %5

Returns String the contents of Message with all place holders replaced by their associated parameters.

Param String/Message string containing text intermingled with parameter place holders.

Optional

Param Variant item to be substituted in place of %1 every time it appears in Message.

Param Variant item to be substituted in place of %2 every time it appears in Message.

Param Variant item to be substituted in place of %3 every time it appears in Message.

Param Variant item to be substituted in place of %4 every time it appears in Message.

Param Variant item to be substituted in place of %5 every time it appears in Message.

Param Variant item to be substituted in place of %6 every time it appears in Message.

Param Variant item to be substituted in place of %7 every time it appears in Message.

Param Variant item to be substituted in place of %8 every time it appears in Message.

Param Variant item to be substituted in place of %9 every time it appears in Message.

Category Strings

function FormatStringWithEmbeddedFunctions

Synopsis Formats a string with embedded functions.

Description This function replaces each occurance of with the result of calling the function func.

Returns String The string with occurances replaced by function result.

Param String/SStr string with embedded functions.

Category Strings

function FormsModeEvent

Synopsis Is activated whenever forms mode is entered or exited.

Description This function is activated whenever forms mode is entered or exited. It is passed a boolean value indicating which of these actions has taken place. If bEntering is equal to true, forms mode has been turned on. If bEntering is equal to false, forms mode has been turned off.

Param Int/bEntering This is the boolean value representing the current state of forms mode.

Optional

Param int/bApplicationMode This is the boolean value representing the current state of application mode. Applicable to JAWS 10 only.

Category HTML Events

function FramesEnumerate

Synopsis Enumerates all frames calling a script function for each frame defined.

Description This function enumerates all defined and valid frames and calls a function for each frame passing in the name and rectangle tlx, tly, brx, bry for the frame.

Returns Void

Param String/Callback script function.

Category Frames

function FrameViewer

Synopsis Launch the Frame Viewer

Description Launch the Frame Viewer with information regarding a possible new frame creation.

Returns void

Param Int/iAction What action should the Frame Viewer perform. Possible values are found in HJConst beginning with FRAMEVIEW_.

Param Int/iEnclosingTop the screen coordinate for the top of the parent window for the new frame.

Param Int/iEnclosingLeft the screen coordinate for the left of the parent window for the new frame.

Param Int/iEnclosingBottom the screen coordinate for the bottom of the parent window for the new frame.

Param Int/iEnclosingRight the screen coordinate for the right of the parent window for the new frame.

Param Int/iFrameTop the screen coordinate for the top of the new frame.

Param Int/iFrameLeft the screen coordinate for the left of the new frame.

Param Int/iFrameBottom the screen coordinate for the bottom of the new frame.

Param Int/iFrameRight the screen coordinate for the right of the new frame.

Param String/strName the title of the parent window.

Param String/strClass the class of the parent window.

Param String/strPrompt the prompt that will be associated with this frame.

Category Frames

function FrameViewerActive

Synopsis Determines whether or not the Frame Viewer is loaded and active.

Description Since multiple instances of the Frame Viewer cannot be simultaneously loaded, this function is usefull for giving the user feedback when a second instance of the Frame Viewer is denied from launching.

Returns Int TRUE if the Frame Viewer is active, otherwise FALSE.

Category Frames

function GetActiveConfiguration

Synopsis retrieves the name of active configuration set.

Description The Name is what is left when all of the path information is stripped away from the Active Configuration path.

Returns String The name of the active configuration set.

Optional

Param int When TRUE, GetActiveConfiguration will return the name of the active domain configuration if applicable. Otherwise, the application configuration is returned.

Category Settings

function GetActiveCursor

Description Returns the type of the active cursor. If the detailed type is requested, and the generic type is CURSOR_PC, the more detailed type of cursor is returned.

Returns Int (JAWS Values) CURSOR_JAWS = 0, CURSOR_PC = 1, CURSOR_INVISIBLE = 2, CURSOR_Braille = 3.

Optional

Param int TRUE-returns the detailed cursor type, FALSE-returns the generic type. Defaults to FALSE.

Category Cursors

function GetActiveCursorName

Synopsis Returns the name of the active cursor.

Description This function returns the name of the active cursor.

Returns string the name of the active cursor.

Category Cursors

function GetActiveProfileIndex

Description Returns the index of the currently active voice profile.

Returns int The index of the currently active voice profile.

Category Voices

function GetActiveProfileName

Description Returns the name of the currently active voice profile.

Returns string The name of the currently active voice profile.

Category Voices

function GetActiveSynthInfo

Synopsis Returns information about the active synthesizer.

Description This function retrieves the active synthesizer's short name, long name and driver.

Returns Int TRUE if synth information was retrieved, FALSE otherwise.

Param String/byRef/sShortName the short name of the synth as defined in SynthNShortName in JFW.ini.

Param String/byRef/sLongName the long name of the synth as defined in SynthNLongName in JFW.ini.

Param String/byRef/sDriver the driver name of the synth as defined in SynthNDriver in JFW.ini.

Category Voices

function GetActiveSynthLanguage

Synopsis Retrieves the name of the active synth language.

Description This function gets the name of the synth language in use.

Returns String the language name.

Category Voices

function GetAlternateUserDirectoryMode

Description Returns the current Alternate User Directory Mode. See the documentation of SetAlternateUserDirectoryMode for information on the various Alternate User Directory Modes.

Returns Int AlternateUserDirMode_Off = 0, AlternateUserDirMode_Default = 1, AlternateUserDirMode_Roam = 2

Category Settings

function GetAncestorCount

Description Gets the hierarchical ancestor count of MSAA objects.

Returns int hierarchical Count of MSAA objects.

Category Object Model And MSAA

function GetAnnotationAtCaret

Description returns ref mark, author, text, date and time, and description of an annotation at the cursor. Note that there may be multiple annotations associated with the character at the cursor, e.g. comment plus comment replies.

Returns int The UIA AnnotationType constant representing the annotation object's type, or 0 if there is no annotation object at the caret.

Param int index 0-based index of annotation to retrieve

Param string/byref/refText the reference mark or name of the annotation

Param string/byref/ author the author of the annotation

Param string/byref/targetText The text of the actual annotation e.g. comment, footnote or endnote text.

Param string/byref/dateAndTime The date and time of the annotation if available.

Param string/byref/description A string description of the annotation type if available.

Category Proofreading and Annotations

function GetAnnotationCountAtCaret

Description returns the number of annotations at the cursor. The count is 1-based, the annotations list by index is 0-based.

Returns int the number of annotations such as comments, footnotes or endnotes at the caret

Category Proofreading and Annotations

function GetAppFileName

Description Determines the file name of the active application program or an active component of that program that was subsequently executed. These file names are the actual program files that are executed by Windows. The file name of the application is used when naming script files.

Returns String Provides a filename.

Category Application Info

function GetAppFileNameWithoutExtension

Description Determines the file name of the active application program or an active component of that program that was subsequently executed. Where GetAppFileName includes the extension, GetAppFileNameWithoutExtension does not include the extension.

Returns String The filename without an extension.

Category Application Info

function GetAppFilePath

Description The GetAppFilePath is used to get the fully qualified path name of the currently running application. When used in combination with GetFileDate, the results can be used to surmise an application version.

Returns String A string containing the fully qualified path name of the currently running application. This includes drive, directory, file name, and extension.

Category Application Info

function GetAppletName

Description Retrieves the name of the applet of the requested window handle.

Returns String The name of the applet.

Optional

Param Handle Window of interest. If not included, then the current window is used.

Category Window

function GetAppMainWindow

Description Determines the window handle for the Main window of the active application.

Returns Handle Provides the window handle of the application's Main window.

Param Handle This function starts with the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the handle for the starting window. GetCurrentWindow is often used as the parameter.

Category Window

function GetAppTitle

Description This obtains the title of the active application program. To have the application title spoken, you must use this function as a parameter for the SayString function.

Returns String The string is the title of the application.

Category Application Info

function GetAuthCode

Synopsis Obtains the first 7 characters of the authorization code.

Description For versions of JAWS using SENTINEL_LM as the Authorization scheme, this function obtains the first 7 characters of the JAWS authorization code and returns the characters as a string.

Returns string The first 7 characters of the authorization code, or null if the authorization code could not be obtained.

Category FS Product Info

function GetAuthLanguageCat

Description A call to this function determines what languages are authorized for JAWS. The values are found in HjConst.jsh and start with the prefix AUTHCAT_.

Returns Int value for the language category. The possible values are found in HjConst.jsh and start with the prefix AUTHCAT_.

Category FS Product Info

function GetAuthScheme

Description A call to this function determines what authorization scheme is being used by JAWS. An empty string indicates no authorization scheme was found.

Returns String The authorization scheme currently in use. Authorization schemes are found in HjConst.jsh and start with the prefix SCHEME_.

Category FS Product Info

function GetAuthScriptLanguageCat

Description This function is used by developers of JAWS scripts who are concerned with use of the dongle. A flag is returned and execution of code can be based upon a registered language.

Returns Int The value of the language registered in the dongle. These are registered in HjConst.jsh with the prefix AUTHCAT_SCRIPT_.

Category FS Product Info

function GetBatteryChargeStatus

Description Returns the state of the battery charge. The returned value is 1 for High, 2 for Low, 4 for Critical, 8 for Charging, 128 for No system battery, or 255 for Unknown status.

Returns int Returns the state of the battery charge.

Category System

function GetBatteryLifeTimeRemainingString

Description Returns the battery charge remaining as a string. The returned string displays hours and minutes remaining.

Returns String Returns the battery charge remaining as a string.

Category System

function GetBatteryLifeTimeSecondsRemaining

Description Returns the total number of seconds of battery charge remaining. Returns -1 if status is unknown.

Returns int Returns the percentage of full battery charge remaining.

Category System

function GetBrailleCellColumn

Description Retrieves the screen column at which the specified Braille cell is located.

Returns Int The horizontal pixel location of the cell.

Param Int The number of the Braille cell of interest.

Category Braille Output

function GetBrailleCellRow

Description Retrieves the screen row at which the specified Braille cell is located.

Returns Int The vertical pixel location of the cell.

Param Int The number of the Braille cell of interest.

Category Braille Output

function GetBrailleDisplayName

Description Returns the name of the braille display that is currently in use.

Returns String The name of the braille display that is currently in use. If no braille display is attached, this function returns an empty string.

Category Braille Device

function GetBrailleKeyboardLayout

Description Returns the keyboard layout for the braille display that is currently in use.

Returns String The keyboard layout for the braille display that is currently in use. If no braille display is attached, this function returns an empty string.

Category Braille Device

function GetBrailleModeForModeId

Description Returns the information about the mode or translation rule set associated with the supplied mode ID. it is broken up into parts separated by a (vertical bar). In order, the parts for the mode information are mode ID, mode friendly name, three-letter language abbreviation and language friendly name.

Returns string The information for the mode, or translation rule set, associated with the supplied mode ID.

Param int/ModeID the ID of the mode whose information is to be retrieved.

Category Braille Settings

function GetBrailleModesForLanguage

Description Returns a list of modes, or available sets of rules, for the selected language. List items are separated by # (number sign), and parts of the list item are separated by a (vertical bar). In order, the parts for each list item are mode ID, mode friendly name, three-letter language abbreviation and language friendly name.

Returns string The list of available modes for the selected language.

Param string/TLA The three-letter abbreviation of the language whose modes are to be returned.

Category Braille Settings

function GetBrailleRestriction

Description Gets the restriction value for the Braille cursor. These values are located in HjConst.jsh and start with Restrict.

Returns Int a constant representing the current level of cursor restriction. These constants begin uncder the heading Restriction types, and can be found in hjconst.jsh. They are: RestrictNone to allow the cursor to roam the screen, RestrictAppWindowto restrict to the application window, RestrictRealWindow to restrict to the real window or RestrictWindow to restrict to the current window.

Category Cursors

function GetBrailleTableDisplayName

Synopsis Provides the localized display name for a given Braille table.

Description Given a Braille table file name, GetBrailleTableDisplayName returns the corresponding localized display name. If there is no display name, then the file name is returned.

Returns string the localized display name corresponding to the provided file name.

Param string the Braille table file name. This is the name of the file containing the Braille table definition without the path and file extension.

Category Braille Settings

function GetBrailleTableFileName

Synopsis Provides the file name for a given Braille table.

Description Given a Braille table display name, GetBrailleTableFileName returns the corresponding file name. This is the name of the file containing the Braille table definition without the path and file extension. If there is no file name, then the display name is returned.

Returns string the file name corresponding to the provided display name.

Param string the Braille table display name.

Category Braille Settings

function GetBrailleTranslatorSupportedLanguages

Description returns a list of the languages supported by the active Braille translator. The list items are separated by the # (number sign). Each list item is made up of two parts: the three-letter language code and the friendly name for the language. The parts are separated by a vertical bar ( ).

Returns string The number-sign delimited list of languages supported by the Braille translator.

Category Braille Settings

function GetCachedMSAAFocusInfo

Description Used as a diagnostic tool for obtaining MSAA info for the focused object and its hierarchy.

Returns string The diagnostic information for the MSAA object.

Param int The object level in the hierarchy. 0 is the focus, 1 its parent, etc.

Category Object Model And MSAA

function GetCell

Description When in a table or spreadsheet, gets the contents of the current cell.

Returns String Provides the Cell of information.

Category Tables

function GetCellCoordinates

Description Gets the coordinates of the current cell in a table and passes them by reference to the variables specified in the parameter list.

Returns Int TRUE if the current cursor is positioned inside of a table. In this case, the Row and Column parameters will have meaningful information placed in them.

Param Int/Column/ByRef References the current cell column on return.

Param Int/Row/ByRef References the current cell row on return.

Category Tables

function GetCellFormula

Description When in a spreadsheet, gets the formula for the cell.

Returns string The formula for the cell, or an empty string if there is no formula.

Category Tables

function GetCellNote

Description When in a spreadsheet, gets the note for the cell.

Returns string The note for the cell, or an empty string if there is no note.

Category Tables

function GetCellSpan

Description When in a table or spreadsheet, gets the number of rows and columns spanned by the current cell.

Returns int True if the function succeeded, false otherwise.

Param int/byref/rows When the function returns, contains the number of rows spanned by the current table cell.

Param int/byref/columns When the function returns, contains the number of columns spanned by the current table cell.

Category Tables

function GetCharacter

Description Copies the character or graphic label where the active cursor is positioned. The copied text can then be used by other script functions.

Returns String Provides a character or graphic label.

Category Screen Text

function GetCharacterAttributes

Description Retrieves the text attributes of the character at the current cursor location. The returned value is a combination of the same bit fields used in FindFirstAttribute, FindNextAttribute, etc. To test for the presence of a particular attribute, use code of the form: if (GetAttributes) & ATTRIB_UNDERLINE) then....

Returns Int The attributes of the current character.

Category Text Format

function GetCharacterByExample

Description Retrieves an example phrase of the supplied character.

Returns String The example phrase for the supplied string parameter.

Optional

Param String with character to retrieve the example for. If not provided, gets example phrase for the character at the current cursor.

Category IME

function GetCharacterFont

Description Retrieves the name of the font used for the character at the current cursor location.

Returns String The name of the font.

Category Text Format

function GetCharacterPhonetic

Description returns the phonetic rendering of the character at the cursor or an empty string if there is no phonetic rendering.

Returns string The phonetic representation of the character under the cursor.

Category Screen Text

function GetCharacterPoints

Description Retrieves the point size of the character at the current cursor location.

Returns Int The point size of the character, or 0 if the cursor is either not positioned on anything or is positioned on a graphic.

Category Text Format

function GetCharacterValue

Synopsis Returns the numeric value of the character parameter.

Description This function returns the numeric value of the character parameter.

Returns Int the value of the character.

Param string the character whose value is desired.

Category Strings

function GetCharacterValueString

Synopsis returns a string describing the specified character value.

Description This function maybe used with SayCharacter thrice to get an appropriate string to speak describing the character. For example: Character u + 627 or Character 255 plus 248 or Character 1075 etc. Flags maybe used to specify if the value should be converted to hexedecimal or left as decimal and whether or not to markup the character value portion of the string.

Returns string if the character is successfully converted to a multibyte sequence using the specified code page then the string will contain either the hex or decimal values of the characters. If the markup flag was specified, the actual values will be marked up using the toSpell text option.

Optional

Param string/sChar if not supplied, the character at the active cursor is assumed.

Param int/nFlags see HJConst.jsh for supported flags (see CVF constants.

Param int/nCodePage if not specified, the active code page is assumed.

Category Strings

function GetCharacterWidth

Description Retrieves the width of the character or graphic at the current cursor location.

Returns Int The width of the character or graphic, or 0 if the cursor is not positioned on anything.

Category Text Format

function GetChunk_ColorNA

Description Similar to GetChunk, but whereas GetChunk treats sections of text with differing colors as separate chunks, GetChunk_ColorNA disregards color as a factor in sectioning text.

Returns String Provides the color independent chunk of information.

Category Screen Text

function GetChunk

Description Obtains the chunk of information to which the active cursor is pointing. A chunk is text and graphic information that was written to the screen in a single operation. GetChunk is similar to GetField, however, the GetField function uses logic to determine the text that is to be obtained, while GetChunk simply obtains the text that was stored in the off screen model as a single unit.

Returns String Provides the chunk of information.

Category Screen Text

function GetClipboardText

Synopsis Retrieve text from the Windows clipboard.

Description Retrieves text from the clipboard that is in standard ANSI format. Each line ends with a carriage return/linefeed (CR-LF) combination.

Returns STRING The text found on the clipboard, or " ," if the clipboard is empty.

Category Clipboard

function GetColorApproximation

Synopsis Returns the closest color for which we have a name to the color supplied. Also provides information about how the closest color relates to the color supplied.

Description This function takes a COLORREF and finds the closest color in our table for which we have a name. It also provides information as to whether the approximated color is lighter or darker than the color passed in.

Returns int The color approximately the same as the one past in.

Param int/iColor the color to approximate.

Param int/byRef/nComparisonIndicator a positive number is returned if the approximated color is brighter than the original, 0 if it is the same or a negative number to indicate that the approximated color is darker than the original.

Category Colors

function GetColorAtPoint

Description Retrieves the color at the specified location. This is the color RGB value in such as 000000000 or 255255255.

Returns Int The color value at the specified point.

Param Int/nX the column coordinate of the desired location. You can use GetCursorCol() to retrieve this value.

Param Int/nY the row coordinate of the desired location. You can use GetCursorRow() to retrieve this value.

Category Colors

function GetColorBackground

Description Retrieves the background color of the character at the current cursor location.

Returns Int The background color value.

Category Colors

function GetColorField

Description Obtains the color field at the position of the active cursor. A color field is a section of information, usually text, that has a common combination of colors. For example, the combination might be white foreground on blue background. The use of the color combination must be contiguous. GetColorField is similar to GetField. However, the function GetColorField is based on color changes, while GetField is based on attribute changes.

Returns String The color field pointed to by the active cursor.

Optional

Param int/nSearchLeftMax The maximum distince to look left. The default distance is 0 pixels.

Param Int/nSearchRightMax The maximum distance to look right. The default distance is 0 pixels.

Param int/bSearchLeftFirst If True, JAWS looks left first, otherwise JAWS looks right first. The default value is true.

Category Colors

function GetColorName

Description Retrieves the textual name for the given color found in colors.ini.

Returns String The name of the color, or an RGB string if a name is not provided in colors.ini.

Param Int The color value to be used.

Category Colors

function GetColorText

Description Retrieves the text color of the character at the current cursor location.

Returns Int The text color value.

Category Colors

function GetColumnHeader

Description When in a table or spreadsheet, gets the contents of the column header.

Returns String Provides the header of information.

Optional

Param Int/iMarkedHeader Include only headers that are marked in the table

Category Tables

function GetColumnText

Synopsis Gets the text of a range of cells in the current column of a table.

Description This function gets the text of a range of cells in the current column of a table. You can specify the separator string to use between data elements, whether or not to include the coordinates of the active cell immediately before that cell's data and the start and end rows to include.

Returns String The text of the included cells.

Optional

Param String/lpszSeparator string to insert between cell data, defaults to a single space.

Param String/lpszCurrentCoordinateTemplate a string defining how the coordinates of the current cell will be rendered. This string must contain two % style parameters (eg c%1r%2) which will be filled with the numeric value of the current column and row respectively. If this parameter is 0 then no coordinates will be included before the current cell.

Param String/lpszBlankCellText the text to be displayed if the cell is blank.

Param Int/nStartRow the starting row, defaults to the first row (1) of the table.

Param Int/nEndRow the ending row, defaults to the last row of the table.

Category Tables

function GetColumnTextAsArray

Description Returns an array where each element is the text of a cell in the specified range. For example, if you request the entire column, there will be an element for each cell in the column. If you only request rows 3 to 5, there will be three elements, the first for row 3, the 2nd for 4 and the third for 5. In this case you will need to take note of the starting row requested if you wish to map this back to the entire column.

Returns stringArray the array of cells.

Optional

Param int/startRow Defaults to the first row.

Param int/endRow Defaults to the last row.

Category Tables

function GetControlAttributes

Description This function returns an integer value indicating the attributes of the current control.

Returns Int The control attributes, as defined in HJconst.jsh. The values returned may be one of the following; CTRL_NONE = 0, CTRL_CHECKED = 1, CTRL_UNCHECKED = 2, CTRL_GRAYED = 4, CTRL_DISABLED = 8, CTRL_SUBMENU = 16, or CTRL_PRESSED = 32.

Optional

Param Int/BypassMSAACache if TRUE, do not use cached MSAA state

Category Dialog Controls

function GetControlID

Description Determines the Control ID for the specified child window in a dialog box. Each list box, edit field, radio button, etc. in a dialog has a unique control ID number. Child windows that contain static text all have the same control ID.

Returns Int Provides a numeric ID for the specified dialog control, or returns 0 when a dialog box is not active.

Param Handle This function provides information for the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide a window handle.

Category Window

function GetControlIDString

Synopsis Like GetControlID, but for .Net controls

Description Retrieves the ID string for a control on a .Net Windows Form. This string is actually the name of the variable used by the programmer to name the field so it may or may not be useful. GetControlID is not useful in .Net applications because numeric control IDs are automatically assigned by the runtime and are

Returns String a control's ID String

Param Handle This function provides information for the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide a window handle.

Category Window

function GetControlName

Description Gets the name of the current control.

Returns String The name of the control.

Category Dialog Controls

function GetControlTypeName

Description returns a localized string describing the WT_XX HJConst.jsh constant passed in.

Returns string The localized string for the control type.

Param int/type One of the wt_ constants from hjConst.jsh.

Category Object Model And MSAA

function GetCountedSelectionContextItems

Description Retrieves a flagset representing the context itemms for which counts will be spoken. See the SelCtxCount constants in HJConst.jsh.

Returns int The flagset representing the context itemms for which counts will be spoken.

Category Speech Markup

function GetCountOfGlanceHighlights

Description Retrieves the count of glance highlights on the page.

Returns int The count of glance highlights on the page.

Category HTML

function GetCurrentControlID

Description Determines the control ID of the active child window in a dialog box. Each list box, edit field, radio button, and so on, in a dialog has a unique control ID number. Child windows that contain static text all have the same control ID. This function performs the same task as GetControlID but it does not require a window handle.

Returns Int Provides a numeric ID for the active dialog control, or returns 0 when a dialog box is not active.

Category Window

function GetCurrentDocumentLength

Description Retrieves the number of characters in the virtual document.

Returns int The length of the virtual document.

Category HTML

function GetCurrentHeading

Description Gets the text of the current heading.

Returns String the text of the heading at the virtual cursor if any.

Category HTML

function GetCurrentHeadingLevel

Description Gets the level of the current heading.

Returns Int The heading level (if the cursor is on a heading) or 0 otherwise. The heading level is 1 for h1, ... 6 for h6.

Category HTML

function GetCurrentItem

Description Retrieves the 1-based index of the item in a ListView or combobox which has focus. This function expands the functionality of lvGetFocusItem to also work for comboboxes.

Returns Int index number of the Current item.

Param Handle The ListView or combobox window.

Category Dialog Controls

function GetCurrentKeyboardLayoutDisplayName

Synopsis Retrieves from the registry the currently active keyboard layout's registry key "Layout Text"

Returns string The registry value for the key HKLM \SYSTEM \CurrentControlSet \Control \Keyboard Layouts <activelayout > \Layout Display Name

Category Scripts

function GetCurrentKeyboardLayoutText

Synopsis Retrieves from the registry the currently active keyboard layout's registry key "Layout Text"

Returns string The registry value for the key HKLM \SYSTEM \CurrentControlSet \Control \Keyboard Layouts <activelayout > \Layout Text

Category Scripts

function GetCurrentLinkIndex

Synopsis Returns the 1-based index of the link on which the PC cursor is positioned in a virtual buffer.

Description The first link in the buffer is 1, the second 2, etc.

Returns int The number of the link

Category Object Model and MSAA

function GetCurrentObject

Description Uses MSAA to obtain the object with focus at the active cursor position.

Returns Object The accessible object at the current cursor location.

Param Int/IDChild ID of child.

Category Object Model And MSAA

function GetCurrentRegionName

Description returns the name of the active Aria region

Returns string The name of the Aria region.

Category HTML

function GetCurrentRegionType

Description returns the type of the active Aria region

Returns string The type string for the Aria region.

Category HTML

function GetCurrentRowColumnCount

Description Returns the physical number of columns in the current table row.

Returns Int 0 if not in a table row or the number of columns in the current row.

Category Tables

function GetCurrentSayAllScheme

Description returns the name of the currently active Speech and Sounds scheme used when performing a SayAll.

Returns string the currently active SayAll scheme.

Category Speech Markup

function GetCurrentSchemeName

Synopsis Gets the name of the currently loaded Speech and Sound Scheme.

Description This function returns the name of the currently loaded Speech and Sounds Scheme.

Returns String the currently active smf file minus the extention .

Category Speech Markup

function GetCurrentScriptKeyName

Description Retrieves the name of the key or gesture used to invoke the currently active script.

Returns String The key or gesture name.

Category Scripts

function GetCurrentWakeWord

Description Retrieves the word or phrase used to wake the JAWS voice assistant.

Returns string The phrase or word used to wake the JAWS voice assistant.

Category Misc

function GetCurrentWindow

Description Determines the window handle for the window that contains the active cursor. In contrast, the GetFocus function uses an analytic process to find the window that currently has the focus, regardless of which cursor is active.

Returns Handle Provides a handle for the active window.

Category Window

function GetCursorCol

Description This determines the horizontal position or column where the active cursor is located. It returns an integer that can be spoken with the SayInteger script function. The value returned is based upon the number of pixels that the active cursor is from the left edge of the screen.

Returns Int the value of the active cursor column position.

Optional

Param Int/nCursorType Optional parameter that designates whose cursor position is to be retrieved. If this parameter is not specified, then the active cursor is used.

Param Int/CoordinateSystem The prefered coordinate system in which the value should be returned This is only a recommendation and will not work in all places. See the COORDSYS_xxx constants in hjconst.jsh.

Category Cursors

function GetCursorColString

Description This gets the appropriate string describing the cursor position relative to the left of the page or sccreen.

Returns string The cursor column position.

Optional

Param int Type the constant value that represents a cursor, type a variable name, or choose a script function. Cursor constants are: CURSOR_JAWS, CURSOR_PC, CURSOR_INVISIBLE, CURSOR_Braille. A script function such as GetActiveCursor also can provide the constant.

Param int desired units of measure, see hjconst.jsh smmUnitsOfMeasure constants.

Category Cursors

function GetCursorPos

Description This gets the cursor position relative to the top of the page or sccreen.

Returns int TRUE if the coordinates were obtained in the desired unit of measure, FALSE otherwise.

Param Int Type the constant value that represents a cursor, type a variable name, or choose a script function. Cursor constants are: CURSOR_JAWS, CURSOR_PC, CURSOR_INVISIBLE, CURSOR_Braille. A script function such as GetActiveCursor also can provide the constant.

Param int desired units of measure, see hjconst.jsh smmUnitsOfMeasure constants.

Param Int/nCol/ByRef set to x coordinate of caret in desired unit of measure (if supported).

Param Int/nRow/ByRef set to y coordinate of caret in desired unit of measure (if supported).

Category Cursors

function GetCursorPosString

Description This gets the appropriate string describing the cursor position relative to the top and left of the page or sccreen.

Returns String The cursor column and row position.

Param Int Type the constant value that represents a cursor, type a variable name, or choose a script function. Cursor constants are: CURSOR_JAWS, CURSOR_PC, CURSOR_INVISIBLE, CURSOR_Braille. A script function such as GetActiveCursor also can provide the constant.

Optional

Param int desired units of measure, see hjconst.jsh smmUnitsOfMeasure constants.

Category Cursors

function GetCursorRow

Description This determines the vertical position or row where the active cursor is located. It returns an integer that can be spoken by the SayInteger script function. The value returned is based upon the number of pixels that the active cursor is from the top of the screen.

Returns Int the value of the active cursor row position.

Optional

Param Int/nCursorType Optional parameter that designates whose cursor position is to be retrieved. If this parameter is not specified, then the active cursor is used.

Param Int/CoordinateSystem The prefered coordinate system in which the value should be returned This is only a recommendation and will not work in all places. See the COORDSYS_xxx constants in hjconst.jsh.

Category Cursors

function GetCursorRowString

Description This gets the appropriate string describing the cursor position relative to the top of the page or sccreen.

Returns string The cursor row position.

Optional

Param int Type the constant value that represents a cursor, type a variable name, or choose a script function. Cursor constants are: CURSOR_JAWS, CURSOR_PC, CURSOR_INVISIBLE, CURSOR_Braille. A script function such as GetActiveCursor also can provide the constant.

Param int desired units of measure, see hjconst.jsh smmUnitsOfMeasure constants.

Category Cursors

function GetCursorShape

Description Gets the current shape of the mouse cursor.

Returns String The shape of the current cursor. It may be one of the following values; Arrow Cursor, I beam cursor, Hour Glass, or cross hair cursor.

Category Cursors

function GetCustomLabelFileName

Synopsis returns the custom label filename for the current document

Description This allows scripts used in the process of creating a custom label to obtain the filename for the current document.

Returns string the filename containing custom labels for this document.

Category Custom Labels

function GetCustomLabelKey

Synopsis returns the custom label key for the current object

Description This allows scripts used in the process of creating a custom label to obtain the unique key for the current object. this key is used to map the object to the custom label.

Returns string the key used to map the object to the custom label.

Category Custom Labels

function GetCustomLabelSectionName

Synopsis returns the custom label section name for the current document

Description This allows scripts used in the process of creating a custom label to obtain the section name for the current document. Typically the section name is just [CustomLabels] but in the case of MSWord, where the labels are stored in a file named after the attached template, the section name may also be [CustomLabels docname.doc] where docname.doc refers to the specific document. thus, MSWord may define template level and document level custom labels.

Returns string the section name containing custom labels for this document.

Category Custom Labels

function GetCustomTutorMessage

Synopsis Retrieves a custom tutor message to be spoken by SayTutorialHelp.

Description Retrieves a custom tutor message to be spoken by SayTutorialHelp. Overwrite this function in applications where you want a custom tutor message to be substituted instead of the usual tutor message. This function is processed after GetFrameTutorMessage and before any of the usual tutor messages are processed.

Returns string Null if no custom tutor message is to be spoken, otherwise the custom tutor message.

Category Help

function GetDayOfWeek

Description Returns a localized string representing the day of the week given a date in the YYYY/MM/DD format. The day can be either the long day format or the short day format.

Returns String The day of the week

Param String/strDate a date in the format YYYY/MM/DD

Optional

Param String/strDayType "L" or "S". Determines if the day of the week is returned as a short abbreviated day or a long day. Defaults to a long day name.

Param String/locale The LCID to be used for determining the language in which the day name should be returned. Defaults to the system LCID.

Category System

function GetDefaultBrailleDisplayInfo

Description Retrieves information about the default braille display.

Returns int True if information about the default braille display could be retrieved, false otherwise.

Param string/byRef braille display short name.

Param string/byRef braille display long name.

Param string/byRef braille display driver.

Category Braille Device

function GetDefaultButtonName

Description Identifies the default button in a dialog box. This is the button that will be chosen when ENTER is pressed.

Returns String Provides the name of the default dialog button.

Category Dialogs

function GetDefaultJCFOption

Description Determines the value of a specified option in the default JAWS configuration file.

Returns Int Returns the numeric Value that has been set for the specified option.

Param Int Type the constant value that names the option that you wish to check. Constant values are listed in HJCONST.JSH, and begin with the prefix "OPT_" or "OPTBRL_." Constants beginning with "OPTBRL_" are for Braille devices.

Category Settings

function GetDefaultProfileIndex

Description Returns the index of the default voice profile.

Returns int The index of the default voice profile.

Category Voices

function GetDefaultProfileName

Description Returns the name of the default voice profile.

Returns string The name of the default voice profile.

Category Voices

function GetDefaultSynthGlobalSectionName

Description retrieves the section name used in default.jcf for the default synthesizer.

Returns string The section name in default.jcf of the default synthisizer.

Category Files

function GetDefaultSynthInfo

Synopsis Returns information about the default synthesizer.

Description This function retrieves the default synthesizer's short name, long name and driver.

Returns Int TRUE if synth information was retrieved, FALSE otherwise.

Param String/byRef/sShortName the short name of the synth as defined in SynthNShortName in JFW.ini.

Param String/byRef/sLongName the long name of the synth as defined in SynthNLongName in JFW.ini.

Param String/byRef/sDriver the driver name of the synth as defined in SynthNDriver in JFW.ini.

Category Voices

function GetDescribedByText

Description Returns the text of any elements that have a describedBy relationship to the current element.

Returns string The descriptive text.

Category HTML

function GetDialogIdentifier

Synopsis Obtains the dialog identifier.

Description This function obtains the dialog identifier. If focus is in a multi-page dialog the Dialog Identifier is the Dialog Page Name. If focus is in a web page dialog or a MSAA window the Dialog Identifier is the name of the object that has the dialog role; this information is obtained from the Cached MSAA Data. Otherwise the Dialog Identifier is the window name of the dialog box.

Returns String The dialog identifier

Category Dialogs

function GetDialogPageName

Description If the active cursor is inside a multi-page dialog, retrieves the name of the current page.

Returns String The name of the current page.

Category Dialogs

function GetDialogStaticText

Description Gets the static text in a dialog box.

Returns String The static text found in a Dialog box.

Category Dialogs

function GetDocumentLoadState

Synopsis Queries the document at the requested window for its load state.

Description This is currently supported in applications that use the Freedom Scientific Document Server module.

Returns int One of the values listed in hjconst.h under Document Load States.

Param HANDLE/hWnd The window at the document whose state is to be queried.

Category Window

function GetDocumentName

Description Retrieves the name of the active document in the virtual buffer.

Returns string The name of the active document in the virtual buffer.

Category HTML

function GetDocumentPath

Synopsis returns the path for the current document

Description This allows scripts to obtain the path or URL of the currently active document

Returns string The path of the current document

Category HTML

function GetDocumentPercentage

Synopsis Returns the position of the active cursor as a percentage of the entire document.

Description This function returns the position of the cursor as a percentage of the entire document.

Returns Int percentage

Category HTML

function GetDocumentProperties

Description Returns various document properties for an editable text document. At present this function is only valid for Lotus Notes 8. This function is available in JAWS 8.0 update 1 and higher.

Returns Int 1 for success, 0 for failure

Param string/title The title of the document

Optional

Param string/PageName The number (or letter) of the current page

Param string/PageNumber The number of a page as it relates to all pages. For example, PageNumber would be the number "1" in the text "1 of 3"

Param string/TotalPages The total number of pages in the document

Param string/LineNumber The current line number within a document page

Param string/CharacterPosition The index of a character on a line of text

Param string/ColumnNumber The number of the current text column

Param string/TotalColumns The total number of text columns

Param string/SectionName The name of the current text section

Category Object Model and MSAA

function GetDocumentTitle

Description Retrieves the title of the active html document.

Returns string The title of the active document from its title tag.

Category HTML

function GetDocumentXML

Description This function returns XML for the current virtual document. It obtains well-formed XML from the Dom Server for parsing using the MSXML com object.

Returns string The XML for the current virtual document.

Category HTML XML DOM

function GetDomainName

Synopsis returns the domain for the current document.

Description This allows scripts to obtain the domain of the currently active document. Starting with JAWS 17, called on local files it returns the filename without path or extension --e.g. for f:.html it returns "index".

Returns string The domain of the current document

Category HTML

function GetElementDescription

Synopsis Returns a string describing the current HTML element.

Description This function returns the current HTML element's parameters and their values as a string suitable for speaking or posting to the Virtual Buffer.

Returns String Description of element

Optional

Param Int/nAncestors the number of ancestors to include in the description, the default is 1.

Param Int/bWantTagsOnly true if you only want the tag name(s) and not the parameters as well, default is TRUE.

Category HTML

function GetElementXML

Description This function returns the XML for the element at the virtual cursor. You may also specify the number of ancestors to include.

Returns string The XML for the element at the virtual cursor.

Optional

Param int/ancestorCount 0 for current element only, 1 to include parent, 2 for grandparent etc, -1 for all ancestors.

Category HTML XML DOM

function GetElementXMLAtPoint

Description This function returns the XML for the element at the specified point. You may also specify the number of ancestors to include.

Returns string The XML for the element at the specified point.

Param int/x The X coordinate of the point.

Param int/y The Y coordinate of the point.

Optional

Param int/ancestorCount 0 for current element only, 1 to include parent, 2 for grandparent etc, -1 for all ancestors.

Category HTML XML DOM

function GetEmbeddedObjectDescription

Description Used to get the description of an object embedded within another object. Usually, this applies to objects, such as links, which may be embedded within a text object. Presently, this function will only return success when focus is on a text object with a role of IA2_ROLE_PARAGRAPH. At this time, the only application implementing such objects is in Lotus Notes 8. This function is available after JAWS 8, update 1.

Returns string Description of the embedded object at the cursor position.

Category Object Model And MSAA

function GetEnvironmentVariable

Description Retrieves the value of a Windows environment variable.

Returns STRING

Param string/environmentVariableName

Category system

function GetField

Description Obtains the information in the field where the active cursor is pointing. A field is a section of information (usually text) that has a common attribute. Examples are; bold, underlined, italics, or strikeout. The use of the attribute must be contiguous. GetField is similar to GetChunk, however, the GetField function uses logic to determine the text that is to be obtained, while GetChunk simply obtains the text that was stored in the Off Screen Model as a unit.

Returns String Provides a field of information.

Optional

Param int If true, and the cursor is at the offset just after the last character of text in the field, jaws returns the preceding field.

Category Screen Text

function GetFileDate

Description Used to get the last modified date of a particular file GetAppFilePath can be used to specify the path of the desired application.

Returns Int An integer containing the last modified date in the form of yyyymmdd. For example, the integer 19970911 would specify September 11, 1997.

Param string Enter the fully qualified path name of the desired application. GetAppFilePath can be used to get the path of the currently running application.

Category Files

function GetFirstChild

Description Determines the first child window that may have been created by a specific parent window. This function is useful when you wish to move down through the stack of window handles.

Returns Handle Provides the handle of the first child window or returns a value of 0 when a child window cannot be found.

Param Handle This function starts with the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the handle for the starting window.

Category Window

function GetFirstWindow

Description Provides the handle for the first window that is at the same logical level as a specified window handle. It is used to get to the beginning point of a series of windows.

Returns Handle Provides the handle for the first window that is at the same logical level or returns 0 when a window is not found.

Param Handle This function starts with the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the handle for the starting window.

Category Window

function GetFixedProductVersion

Description GetFixedProductVersion gets the application's fixed product version.

Returns Void

Param string The path of the program for which you want the information. You can get the path by using GetAppFilePath.

Param Int/nMajorVersion/ByRef Type the variable to receive the major version value.

Param Int/nMinorVersion/ByRef Type the variable to receive the minor version value.

Param Int/nUpdateVersion/ByRef Type the variable to receive the update version value.

Param Int/nBuildNumber/ByRef Type the variable to receive the build number value.

Category Application Info

function GetFocus

Description Obtains the window handle for the window that has the focus. It always seeks the PC cursor or highlighted item that has the focus. It does not take into account which cursor is active. In contrast, the GetCurrentWindow function is less sophisticated. It simply obtains the handle for the window in which the active cursor is located.

Returns Handle Provides the window handle for the window with the focus.

Optional

Param int/byref MSAA object ID for the object with focus. Available in Jaws 11 update 1 and later.

Param int/byref MSAA child ID for the object with focus. Available in Jaws 11 update 1 and later.

Category Window

function GetFocusObject

Description Uses MSAA to get the object with focus.

Returns Object The interface to the Accessible object.

Param Int/IDChild ID of child.

Category Object Model And MSAA

function GetFocusRect

Description Gets the coordinates of a focus rectangle.

Returns Int TRUE if the focus rectangle is successfully retrieved.

Param Int/hWnd the handle of the window containing the focus rectangle.

Param Int/nLeft the left edge of the focus rectangle after the function is called.

Param Int/nRight the right edge of the focus rectangle after the function is called.

Param Int/nTop the top edge of the focus rectangle after the function is called.

Param Int/nBottom the bottom edge of the focus rectangle after the function is called.

Category Window

function GetFocusRectBottom

Description Gets the coordinates of the bottom edge of a focus rectangle.

Returns Int Screen coordinate of bottom edge of focus rectangle.

Param Int Handle of window containing the focus rectangle.

Category Window

function GetFocusRectLeft

Description Gets the coordinates of the left edge of a focused rectangle.

Returns Int Screen coordinate of left edge of focus rectangle.

Param Int Handle of window containing the focus rectangle.

Category Window

function GetFocusRectRight

Description Gets the coordinates of the right edge of a focus rectangle.

Returns Int Screen coordinate of right edge of focus rectangle.

Param Int Handle of window containing the focus rectangle.

Category Window

function GetFocusRectTop

Description Gets the coordinates of the top edge of a focus rectangle.

Returns Int Screen coordinate of top edge of focus rectangle.

Param Int Handle of window containing the focus rectangle.

Category Window

function GetFont

Description Gets font information about the character under the active cursor.

Returns String

Category Text Format

function GetForegroundWindow

Description Retrieves the handle to the current foreground window. This is generally the main window of the active application, but can sometimes be the handle of a dialog box. Marginally faster than GetAppMainWindow.

Returns Handle The handle of the foreground window.

Category Window

function GetFormFieldIndex

Synopsis Returns the 1-based index of the current formfield.

Description This function returns the 1-based index of the current formfield. Note that if the ControlType optional parameter is supplied and specifies a valid WT constant, this function will return the index for that control type only.

Returns Int the 1-based table index or 0.

Optional

Param int/ControlType one of the WT_ constants to match on or wt_unknown (or 0) for all. This enables a list of specific formfield types to be retrieved. Note this extra param is only available in JAWS 6.0 and higher.

Category HTML

function GetFrameDescription

Description Retrieves the description of a specified frame.

Returns String The text of the description.

Param string The frame name of interest.

Category Frames

function GetFrameNameAtCursor

Description Retrieves the name of the frame that surrounds the location of the current cursor.

Returns String The name of the frame containing the cursor. If no such frame exists, the string is empty. An empty string can be tested for by comparing the result with " "

Category Frames

function GetFramePrompt

Synopsis Returns the prompt associated with the frame specified.

Description This function retrieves the prompt of the specified frame. If no frame is specified then the frame at the active cursor location is asumed. Note that a frame's prompt is any string or strings defined as part of any EVENT_Focus/ACTION_SayString pairs.

Returns String the prompt.

Optional

Param String/sName the name of the frame whose prompt you want.

Category Frames

function GetFrameSynopsis

Description Retrieves the synopsis of a specified frame.

Returns String The text of the synopsis.

Param string The frame name of interest.

Category Frames

function GetFrameTutorMessage

Synopsis Returns the tutor message associated with the frame specified.

Description This function retrieves the tutor message of the specified frame. If no frame is specified then the frame at the active cursor location is asumed.

Returns String the tutor message.

Optional

Param String/sName the name of the frame whose tutor message you want.

Category Frames

function GetFromStartOfLine

Description Retrieves text on the current line that is located to the left of the active cursor.

Returns String

Category Screen Text

function GetGestureName

Description Retrieves the name of the gesture attached to the specified script.

Returns String The gesture name.

Param string The name of the script.

Category Scripts

function GetGestureNames

Description Retrieves a \r \n delimited list of the names of all the gestures that are assigned to the specified script.

Returns String A \r \n delimited list of the names of all the gestures that are assigned to the specified script.

Param string The name of the script.

Category Scripts

function GetGraphicID

Description Gets the ID associated with the graphic under the current cursor. If this function fails, then the pointer is not positioned in a valid location on the graphic. Moving into the center of the graphic increases the success of this call.

Returns Int The Graphic ID, or zero if GetGraphicID fails.

Category Graphics

function GetGroupBoxName

Description Gets the name of the current Group box.

Returns String The name of the Group box.

Category Dialogs

function GetHeadingCount

Description Gets the number of headings present on the current Web page at the specified level.

Returns Int The number of headings present.

Param Int/nAtLevel 0 for all headings or 1 through 6 to get the count of levels at that level. These correspond to HTML tags h1 through h6.

Category HTML

function GetHotKey

Description Retrieves the first underlined character in the chunk of text on which the active cursor is positioned. This is especially useful in menus and dialog boxes where an accelerator key for a particular item has been defined and is displayed on the screen as a underlined letter in the name of the control.

Returns String The first underlined character if one exists, otherwise an empty string.

Optional

Param Handle The Handle of the window for which you would like to find the hot key. If a handle is not provided, the handle of the current window will be used.

Category Dialog Controls

function GetHTMLFrameCount

Description Gets the number of HTML frames present on the current Web page or html document.

Returns Int The number of frames present.

Category HTML

function GetHTMLFrameIndex

Synopsis Returns the 1-based index of the current HTML frame.

Description This function returns the 1-based index of the current frame. Note that invisible frames are not counted.

Returns Int the frame index.

Category HTML

function GetHTMLFrameName

Synopsis Returns the name of the current frame.

Description This function returns the name of the current HTML frame. This is either taken from the title or if no title, the name attribute.

Returns String the name of the frame.

Category HTML

function GetHTMLFrameNames

Synopsis Returns a delimited list of visible frames currently rendered in the VPC buffer.

Description This function returns a delimited list of visible frames currently rendered in the VPC buffer. Specify the delimiter for the list using the optional string parameter. This is used to ensure that the list of frames presented by the ins + f9 keystroke is consistent with what is in the VPC bbuffer. Note that this function is not used if the VPC cursor is not active.

Returns String the delimited list of frame names.

Optional

Param String/sDelimiter The delimiter to use to separate the frame names.

Category HTML

function GetInputLanguage

Description Returns the name of the active intput language. One can add multiple input languages through Control Panel's Regional and Language Options.

Returns String The name of the active input language.

Category System

function GetIntOptionDefaultSetting

Synopsis retrieves the shipping default settings for a JCF option.

Description Looks in the shared settings directory for the default shipping value of a JCF option. If the application has a JCF file and the option is set there, retrieves the value for the setting; otherwise, retrieves the value from the default.jcf file.

Returns int The default value of the setting in the shipping scripts; otherwise, -1 if the setting could not be retrieved.

Param string The section name to which the JCF setting belongs.

Param string The key name exactly as it appears in the JCF file.

Category Files

function GetItemCount

Description Retrieves a count of items in a ListView, Toolbar, or combobox. This function expands the functionality of lvGetItemCount to also work for comboboxes and ToolBArs.

Returns Int the count of items.

Param Handle The window of interest.

Category Dialog Controls

function GetItemRect

Description Gets the bounding rectangle surrounding the specified item or items. Items can be combined using the bitwise ( ) operator. When two or more items are combined, the resulting rectangle enclosed each of the items.

Returns Int TRUE if the bounding rectangle is successfully retrieved.

Param Int/nX The x coordinate of the point where the target item exists. If nX and nY are 0, then the current item rectangle will be retrieved.

Param Int/nY The y coordinate of the point where the target item exists. If nX and nY are 0, then the current item rectangle will be retrieved.

Param Int/nLeft The left edge of the bounding rectangle after the function is called.

Param Int/nRight The right edge of the bounding rectangle after the function is called.

Param Int/nTop The top edge of the bounding rectangle after the function is called.

Param Int/nBottom The bottom edge of the bounding rectangle after the function is called.

Param Int/nType The item type. Can be IT_CHUNK, IT_WORD, IT_CHAR, IT_FIELD, IT_COLORFIELD, IT_PROMPT, IT_CARET, IT_BOUNDINGRECT, IT_MAGNIFIED, IT_LINE, IT_PRIOR_WORD, IT_NEXT_WORD, or IT_HIGHLIGHT. Types can be combined using the bitwise ( ) operator. For example, if you want to get the rectangle that surrounds an edit control and its prompt, use IT_BOUNDINGRECT IT_PROMPT for this parameter.

Category Window

function GetJAWSDirectory

Description Retrieves the full path to the directory in which JAWS is running.

Returns String The JAWS drive and directory without a trailing .

Category JAWS Program

function GetJAWSFindText

Description Gets the text to be located when JAWSFindNext runs.

Returns string the text which JAWSFindNext will use when searching

Category Screen Text

function GetJAWSHelpDirectory

Description Retrieves the full path to the JAWS help directory currently in use. This depends on which language is being used.

Returns String The JAWS drive and help directory without a trailing .

Category JAWS Program

function GetJAWSMode

Description Determines whether JAWS is running normally, running from the system tray, or running as MagUtil.

Returns int One of the JAWS modes listed in HJConst.jsh.

Category JAWS Program

function GetJAWSSettingsDirectory

Description Retrieves the full path to the JAWS settings directory currently in use. This depends on which language is being used.

Returns String The JAWS drive and settings directory without a trailing .

Category JAWS Program

function GetJAWSUserName

Synopsis Retrieves the name of the user currently logged into JAWS.

Description If this instance of JAWS is not network aware, then the function returns " ,"

Returns String the name of the user currently logged into JAWS.

Category JAWS Program

function GetJCFOption

Description Determines the value of a specified option as it is currently set in memory.

Returns Int Returns the numeric value that has been set for the specified option.

Param Int Type the constant value that names the option that you wish to check. Constant values are listed in HJCONST.JSH, and begin with the prefix "OPT_" or "OPTBRL_." Constants beginning with "OPTBRL_" are for Braille devices.

Category Settings

function GetJFWLang

Description Gets the three letter abbreviation of the JAWS Language that is currently in use. This is the language of the resource DLLs that are loaded by JAWS. This is not necessarily the same as the current speech synthesizer language.

Returns String Returns a string containing the three letter abbreviation of the JAWS Language that is currently in use.

Category JAWS Program

function GetJFWSerialNumber

Description Used to get the serial number of the currently running JAWS.

Returns Int The serial number of the corrently running JAWS, or 0 if there is an error.

Category FS Product Info

function GetJFWSMACount

Synopsis Returns the SMA count.

Description This function returns the SMA count as an integer.

Returns Int The SMA count.

Category FS Product Info

function GetJFWVersion

Description Used to get the version of the currently running JAWS. Can be used to ensure that a function is only called on versions of JAWS that support it.

Returns Int An integer of the form jjmmbbb where j represents the major version, m represents the minor version, and b represents the build number. For example, the integer 300061 would specify JFW 3.00.61.

Category JAWS Program

function GetKeyState

Description Returns by reference both the up/down state of the key, and the toggle state if applicable. NumLock, ScrollLock, and CapsLock have toggle states.

Returns Int TRUE if the keystate was successfully returned.

Param String/strName The name of the key whose state is to be retrieved. A list of key names is referenced in keycodes.ini.

Param Int/bDown/ByRef Set to true if the key is in a down state.

Param Int/bOn/ByRef Set to true if the toggle state is on. For example, if CapLock is in the on state, then this value will be true.

Category Keyboard

function GetLandmarkCount

Description Retrieves the number of available landmarks on the current web page.

Returns int The number of available landmarks.

Optional

Param Int/landmarkType landmark type to count.

Category HTML

function GetLanguageCodeAtCursor

Synopsis Obtains language code at cursor

Description Returns the language abbreviation of the text at the active cursor or the active JAWS language if the language at the cursor cant be determined.

Returns string the language code

Category System

function GetLastBrailleRoutingKey

Description Retrieves the position of the last routing key pressed on a Braille display.

Returns Int The position of the Braille cell with which the routing key is associated. 1 = "cell 1", 2 = "cell 2", and so on.

Category Braille Output

function GetLastInputSource

Description Used to determine the source of the most recent input.

Returns int The most recent input source: keyboard (1), braille (2) or touch (4). See InputSource constants in HJConst.jsh.

Category Scripts

function GetLastKeyPressTime

Description Returns the tick count of the last keyboard event. This function can be used in conjunction with GetLastMouseMovementTime in cases in which it is necessary to know whether a mouse event or a keyboard event occurred more recently.

Returns int Returns the tick count of the last keyboard event.

Category Keyboard

function GetLastMouseMovementTime

Description Returns the tick count of the last mouse movement event. This function can be used in conjunction with GetLastKeyPressTime in cases in which it is necessary to know whether a mouse event or a keyboard event occurred more recently.

Returns int Returns the tick count of the last mouse movement event.

Category Mouse

function GetLastMSAAAlertInfo

Synopsis retrieves the text and alert level of the last known MSAA alert

Description This function allows the user to retrieve the text and alert level of the last MSAA alert.

Returns int TRUE if there is alert data still in the buffer, FALSE otherwise

Param string/byRef/sText the text of the alert

Param int/byRef/nLevel the priority level of the alert, 1 highest, 3 lowest

Category Object Model and MSAA

function GetLastWindow

Description Provides the handle for the last window that is at the same logical level as a specified window handle. It is used to get to the end point of a series of windows.

Returns Handle Provides the handle for the last window that is at the same logical level or returns 0 when a window is not found.

Param Handle This function starts with the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the handle for the starting window.

Category Window

function GetLine

Description Copies the text from the line where the active cursor is positioned. The copied text can then be used by other script functions.

Returns String Provides a line of text.

Category Screen Text

function GetLineBottom

Description Determines the vertical pixel location of the bottom of the line containing the current cursor.

Returns Int The pixel location of the bottom of the current line of text, or 0 if no text is found in this location.

Optional

Param Int/nCursorType Optional parameter that designates whose cursor position is to be retrieved. If this parameter is not specified, then the active cursor is used.

Category Text Format

function GetLineCount

Synopsis Gets the number of lines in the current document .

Description This function returns the number of lines in the current virtual document.

Returns Int the number of lines.

Category HTML

function GetLineTop

Description Determines the vertical pixel location of the top of the tallest character of the line on which the current cursor is positioned. Since the cursor position reported by JAWS is based on the base line of characters, this function is the only way of determining how high up a line of text extends.

Returns Int The pixel location of the top of the tallest character on the current line of text, or 0 if no text is found in this location.

Optional

Param Int/nCursorType Optional parameter that designates whose cursor position is to be retrieved. If this parameter is not specified, then the active cursor is used.

Category Text Format

function GetLinkCount

Description Gets the number of links present on the current Web page.

Returns Int The number of links present.

Category HTML

function GetListIndex

Synopsis Returns the 1-based index of the current list.

Description This function returns the 1-based index of the current list. If the cursor is not within a list, returns 0.

Returns Int the 1-based list index or 0.

Category HTML

function GetListOfFormFields

Synopsis Returns a delimited list of form fields.

Description This function returns a delimited list of form fields currently rendered in the VPC buffer. Specify the delimiter for the list using the optional string parameter.

Returns String the delimited list of form fields.

Optional

Param String/sDelimiter The delimiter to use to separate the form fields

Param int/ControlType one of the WT_ constants to match on or wt_unknown (or 0) for all. This enables a list of specific formfield types to be retrieved. Note this extra param is only available in JAWS 6.0 and higher.

Category HTML

function GetListOfGlanceHighlights

Description This function returns a delimited list of glance highlights on the page.

Returns string The delimited list of glance highlights.

Category HTML

function GetListOfLists

Synopsis Returns a delimited list of lists.

Description This function returns a delimited list of lists currently rendered in the document. Specify the delimiter for the list using the optional string parameter. This function is used in conjunction with MoveToListByIndex and GetListIndex to facilitate the listing of tables in a ddocument and the ability for the user to select and move directly to any of the tables listed.

Returns String the delimited list of lists.

Optional

Param String/sDelimiter The delimiter to use to separate the list information for each list in the list.

Category HTML

function GetListOfObjects

Description Given a window handle, retrieves the names of all objects contained in that window. This function is intended primarily as a tool for script developers to explore a new aplication and find out the names of objects contained therein. This info can be used in crafting scripts to use calls to GetObjectInfoByName.

Returns String A delimited list of object names.

Param HANDLE/hwnd The window containing the objects of interest

Optional

Param String/Delimiter Character to be used as the delimiter between object names. If not provided, defaults to \007.

Category Object Model And MSAA

function GetListOfProofreadingElements

Synopsis gets a delimited list of proofreading elements

Description This function is used to obtain a delimited list of proofreading elements to present to the user so that the user can select and move the cursor to a particular element.

Returns string the list of elements found delimitted by the specified delimiter or \007 if none specified.

Param int/nProofreadingElementType see hjconst.jsh for the proofreading element types, peSpellingError, peGrammaticalError, peRevision

Optional

Param string/sDelim the delimiter to use to separate the elements.

Category Proofreading and Annotations

function GetListOfTables

Synopsis Returns a delimited list of tables.

Description This function returns a delimited list of tables currently rendered in the VPC buffer. Specify the delimiter for the list using the optional string parameter. The information for each table will be taken from its caption, Summary, (if no Caption) or text within the table. If the table doesn't have any text then the table entry will be labelled untitled N where N increases from 1 for each untitled table. This function is used in conjunction with MoveToTableByIndex and GetTableIndex to facilitate the listing of tables in a ddocument and the ability for the user to select and move directly to any of the tables listed.

Returns String the delimited list of tables.

Optional

Param String/sDelimiter The delimiter to use to separate the table information for each table in the list.

Category HTML

function GetListOfTags

Synopsis Returns a delimited list of elements with a specified tag.

Description This function returns a delimited list of elements with the specified tag currently rendered in the VPC buffer. Specify the tag and the attributes you wish to be used for information about the tag. If a tag doesn't have any of the attributes in the comma delimited list, the inner text of the tag will be used if possible. Specify the delimiter for the list using the optional string parameter. The information for each table will be taken from its caption, Summary, (if no Caption) or text within the table. If the table doesn't have any text then the table entry will be labelled untitled N where N increases from 1 for each untitled table. This function is used in conjunction with MoveToTableByIndex and GetTableIndex to facilitate the listing of tables in a ddocument and the ability for the user to select and move directly to any of the tables listed.

Returns String the delimited list of tags.

Param string/sTag the UPPERCASE HTML tag to collect.

Param string/sAttrList a comma delimited list of HTML attributes to look for when gathering information about the tag.

Optional

Param String/sDelimiter The delimiter to use to separate the tag information for each tag in the list.

Category HTML

function GetListOfTagsWithAttribute

Synopsis Returns a delimited list of elements with a specified tag. The element must also have the specified attribute

Description This function returns a delimited list of elements with the specified tag currently rendered in the VPC buffer. The element must have the supplied attribute. You may optionally also indicate if the tags may be nested or not (which will affect their index). Specify the delimiter for the list using the optional string parameter. This function is used in conjunction with MoveToTagWithAttributeByIndex and related functions. If you specify that you want the value of the attribute included in each list item (see optional param 6), the list's elements will be divided into two parts, the first part is the value of the supplied attribute followed by a colon. The second part is the inner text of the element. For example, in The AOL AIM Triton History Window, this function may be used to obtain information about the messages. The list will look something like MSGID:text MSGID:text ...

Returns String the delimited list of tags.

Param string/sTag the UPPERCASE HTML tag to collect (maybe empty if you want all tags with a specific attribute such as any element with an onclick).

Param string/sAttr the attribute which each element in the list must have and whose value is optionally included as part of the list items retrieved.

Optional

Param int/iAllowNesting TRUE to allow nested elements, FALSE to disallow nesting. Default is TRUE

Param String/sDelimiter The delimiter to use to separate the tag information for each tag in the list.

Param handle/hwndDoc the handle of the document (may not have focus). If this parameter is not supplied, we assume the document has focus.

Param int/bIncludeAttributeValueInListItems if TRUE, the value of the attribute will be included in each list item, if FALSE, the value of the attribute will not be included.

Category HTML

function GetLiveRegionText

Synopsis Obtains the text of the live region with the given ID from the window.

Description This function returns the text of a live region in a given window. Optionally supply the ID of a particular Live Region, or leave it blank to retrieve the text of the last Live Region updated in the specified window.

Returns string The text.

Param handle The window handle of the window containing the Live Region.

Optional

Param string Optionally supply the ID of the Live Region, or leave blank.

Category screen text

function GetLocaleNameForLangID

Description Given a language abbreviation or language ID, retrieves the locale name of the language.

Returns string The locale name of the language matching the abbreviation or id.

Param string The abbreviation or ID of a language.

Category Misc

function GetLockingCode

Synopsis Obtains the locking code.

Description For versions of JAWS using SENTINEL_LM as the Authorization scheme, this function obtains the JAWS locking code and returns the code as a string.

Returns string The locking code, or null if the locking code could not be obtained.

Category FS Product Info

function GetLotusProgramVersion

Description This function returns the major version of Lotus Notes application. For example, if the full version of Lotus Notes 6.5.20.4091, GetLotusProgramVersion would return 6.

Returns Int An integer specifying the major version of the Lotus Notes program.

Param string The path of the Lotus Notes program for which you want the version. You can get the path by using GetAppFilePath.

Category Application Info

function GetLotusVersionInfoString

Description GetLotusVersionInfoString gets a requested string from the version table of Lotus Notes application. If version is lower than 6, this function get the string from String table of this application.

Returns String The requested string.

Param string The path of the Lotus Notes program for which you want the information. You can get the path by using GetAppFilePath.

Category Application Info

function GetMAGicSerialNumber

Description Used to get the serial number of the currently running MAGic.

Returns Int The serial number of the corrently running MAGic, or 0 if there is an error.

Category MAGic

function GetMenuMode

Description Gets the mode of a menu, active or inactive.

Returns Int The Menu mode returned.

Category Menus

function GetMenuName

Description Gets the name of the active menu.

Returns String The name of the active menu.

Category Menus

function GetMetroAppName

Description Retrieves the name of the current application if it is a Universal/Modern/Metro app. (They're all the same thing renamed over the years.) This function should only be used if IsMetroApp returns true.

Returns String the app name. Note that the name may not correspond to anything that a user will see on screen.

Category Application Info

function GetMetroAppVersion

Description Retrieves the version of the current application if it is a Universal/Modern/Metro app. (They're all the same thing renamed over the years.) This function should only be used if IsMetroApp returns true.

Returns String Version of the form "17.0.50.0"

Category Application Info

function GetNativeOMFromMSAA

Synopsis Gets a pointer to the native Object Model of an application using MSAA.

Description This function uses MSAA to get a pointer to the Application's native object model directly. It should be used when other methods fail and will only work for Office 2000 and above. It is particularly useful when running under Windows XP in Excel where all other methods fail. This function should be called when focused on the main work area, ie the Excel7 class window in Excel, the _wwg class window in MSWord etc.

Returns Object a poihnter to the Application Object.

Optional

Param int/ObjectID The object ID to use when requesting the native OM pointer. In most cases this is OBJID_NATIVEOM and that's what is used if this parameter isn't specified.

Category Object Model and MSAA

function GetNavModuleVersionInfo

Description Retrieves information about the nav module responsible for the passed in window handle.

Returns String String describing the nav module that is handling the passed in window.

Param Handle Window of interest

Category Window

function GetNearestGlanceHighlightIndex

Description Retrieves the index of the nearest glance highlight on the page.

Returns int If there are glance highlights on the page, the index of the nearest one; otherwise, 0.

Category HTML

Optional

Param int LinkTypeFlags specifying which link types you want to find.

Category HTML

function GetNextWindow

Description Provides the next window handle in a series of window handles that are all at the same logical level. It is used to move across a list of window handles.

Returns Handle Provides the handle of the next window in the stack or returns a value of 0 when another window cannot be found.

Param Handle This function starts with the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the handle for the starting window.

Category Window

function GetObject

Description Looks in the Windows Running Object Table for an instance of an application with the specified COM class name.

Returns Object

Param String/ApplicationName Program to find.

Category Object Model And MSAA

function GetObjectAtPoint

Description Uses MSAA to determine the object at a set of X/Y coordinates.

Returns Object The accessible object at the given point.

Param Int ref data.

Param Int The x coordinate.

Param Int The y coordinate.

Category Object Model And MSAA

function GetObjectAutomationId

Description Retrieves the UIA automation ID of an object in the focus hierarchy. This is much faster than using the UIA Script API.

Returns String the automation ID.

Optional

Param int/nLevel The object in the hierarchy to be used. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectClassName

Description Retrieves the UIA class name of an object in the focus hierarchy. This is much faster than using the UIA Script API.

Returns String the class name.

Optional

Param int/nLevel The object in the hierarchy to be used. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectContainerHelp

Synopsis Returns the description of an MSAA object's container

Description This function returns the AccDescription property of the container of an MSAA object if it has one.

Returns String AccDescription property of accessible object's container.

Category Object Model And MSAA

function GetObjectDescription

Description the description of the object with focus is returned. The value is returned as a string.

Returns String the MSAA description of the object with focus.

Optional

Param Int/AlwaysUseMSAA if TRUE, always obtains this information via MSAA, even in those situations where other methods would otherwise be used instead.

Param int/nLevel Which object in the hierarchy should be spoken. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectFromEvent

Synopsis retrieves an MSAA object from a window.

Description This function retrieves the specified MSAA object from the given window. This object is generated by an event.

Returns Object the MSAA object.

Param Handle/hWnd the window containing the Object.

Param Int/idObject the id of the object.

Param Int/idChild the id of the child.

Param Int/byRef/v.

Category Object Model And MSAA

function GetObjectHelp

Synopsis Returns the description of an MSAA object.

Description This function returns the AccDescription property of an MSAA object if it has one.

Returns String AccDescription property of accessible object.

Optional

Param Int/AlwaysUseMSAA if TRUE, always obtains this information via MSAA, even in those situations where other methods would otherwise be used instead.

Param int/Level Which object in the hierarchy should be spoken. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectIA2State

Description Gets the IA2 state of an object in the focus hierarchy.

Returns int the IA2 state bits of the nth object.

Optional

Param int/nLevel The object in the hierarchy to be used. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectIA2UniqueID

Description Gets the IA2 unique ID of an object in the focus hierarchy.

Returns int the IA2 unique ID of the nth object.

Param int/level The object in the hierarchy to be used. 0 refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectInfoByName

Description Given a window handle and the name of an objectt contained in that window, retrieves information about that object. In most cases, this information is obtained using MSAA. Using this function is much faster than directly using MSAA functions to walk the object hierarchy to find the object of interest and then querying the object for the equivalent information. Information is returned in byRef parameters. Not all information is available for all objects.

Returns int TRUE if function was successful, false on failure.

Param HANDLE/hwnd The window containing the object of interest

Param string/ObjectName The name of the object desired

Param int/nWhichOccurance If there is more than one object with this name, which one is desired. To retrieve the first occurance, pass in 1 as the value for this parameter.

Param int/byref/nSubtype On return will contain the object's subtype code.

Optional

Param int/byref/nState On return will contain the object's state flags. This will be a combination of Control Attribute identifiers defined in HJCONST.JSH.

Param String/byRef/Value On return will contain the object's value.

Param String/byRef/Description On return will contain the object's description.

Param String/byRef/HotKey On return will contain the object's HotKey

Param string/ContainerName On return will contain the name of the object that contains this object.

Category Object Model And MSAA

function GetObjectIsEditable

Description whether or not the object with focus is editable.

Returns int true or false according to whether the cursor is in an object which may be edited.

Category Object Model And MSAA

function GetObjectItemStatus

Description Retrieves the UIA ItemStatus property of an object in the focus hierarchy. This is much faster than using the UIA Script API.

Returns String the ItemStatus property

Optional

Param int/nLevel The object in the hierarchy to be used. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectItemType

Description Retrieves the UIA ItemType property of an object in the focus hierarchy. This is much faster than using the UIA Script API.

Returns String the ItemType property

Optional

Param int/nLevel The object in the hierarchy to be used. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectModuleId

Description Determines the type of module currently in focus. The module types are listed in HJConst.jsh.

Returns int One of the module ID type constants listed in HJConst.jsh.

Category Object Model and MSAA

function GetObjectMSAAState

Description Gets the MSAA state of an object in the focus hierarchy.

Returns int the MSAA state bits of the nth object.

Optional

Param int/nLevel The object in the hierarchy to be used. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectName

Description If the Pc Cursor is active, the name of the object with focus is returned. Otherwise, the name of the object at the position of the active cursor is returned. The value is returned as a string.

Returns String the name of the object at the position of the active cursor.

Optional

Param Int/AlwaysUseMSAA if TRUE, always obtains this information via MSAA, even in those situations where other methods would otherwise be used instead.

Param int/nLevel Which object in the hierarchy should be spoken. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function getObjectNameFromEvent

Synopsis retrieves the name of an MSAA object from a window.

Description This function retrieves the name of the specified MSAA object from the given window. This object is generated by an event.

Returns String Object name, help or description (searched in that order).

Param Handle/hWnd the window containing the Object.

Param Int/idObject the id of the object.

Param Int/idChild the id of the child.

Category Object Model And MSAA

function GetObjectNameUnfiltered

Description Unconditionally obtains the name of the object with focus or one of it's ancestors. This is in contrast to GetObjectName which does not return the names of objects of type wt_unknown. Any Objects with MSAA role of Window get mapped to the JAWS type of wt_unknown, which means that it's impossible to use GetObjectName to get the names of windows in the focus hierarchy that don't have a more specific type because the names are returned as empty strings. GetObjectNameUnfiltered does not have the above limitation and provides this functionality without breaking legacy behavior.

Returns String the name of the object in the focus hierarchy.

Optional

Param int/nLevel Which object in the hierarchy should be spoken. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectPlaceholder

Description If the PC cursor is active, the placeholder value of the object with focus is returned. Otherwise, the placeholder value of the object at the position of the active cursor is returned.

Returns string The placeholder value of the object at the position of the active cursor.

Optional

Param int/alwaysUseMSAA If TRUE, always obtains this information via MSAA, even in those situations where other methods would otherwise be used instead.

Param int/level Which object in the hierarchy should be spoken. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model and MSAA

function GetObjectProcessName

Description Retrieves process name for current object in cached focus.

Returns string Process name with extension

Category Object Model And MSAA

function GetObjectRect

Synopsis Retrieves the focus rectangle surrounding the object at the position of the active cursor.

Description Will return TRUE if the object has a focus rectangle, FALSE otherwise. This function takes four int parameters. Left, right, top and bottom. Declare, but do not initialize, the int variables for these parameters, as they are passed by reference.

Returns Int True if a focus rectangle was found surrounding the object, false otherwise.

Param Int/iLeft the value for the left-hand edge of the focus rectangle surrounding the object.

Param Int/iRight the value for the right-hand edge of the focus rectangle surrounding the object.

Param Int/iTop the value for the top edge of the focus rectangle surrounding the object.

Param Int/iBottom the value for the bottom edge of the focus rectangle surrounding the object.

Optional

Param Int/AlwaysUseMSAA if TRUE, always obtains this information via MSAA, even in those situations where other methods would otherwise be used instead.

Param int/nLevel Which object in the hierarchy should be spoken. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectRole

Description Gets the role of an object in the focus hierarchy.

Returns int the role of the nth object.

Optional

Param int/nLevel The object in the hierarchy to be used. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectState

Synopsis Returns the state of the given object.

Description If the PC cursor is active, the state of the object with focus is returned. Otherwise, the state of the object at the position of the active cursor is returned.

Returns String The state of the object.

Optional

Param Int/AlwaysUseMSAA if TRUE, always obtains this information via MSAA, even in those situations where other methods would otherwise be used instead.

Param int/nLevel Which object in the hierarchy should be spoken. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectStateCode

Synopsis Returns the state of the given object. Unlike GetObjectState which returns a string that is an interpretation of the state, GetObjectStateCode returns an int which is the bit set of the actual object state.

Description If the PC cursor is active, the state of the object with focus is returned. Otherwise, the state of the object at the position of the active cursor is returned.

Returns int The state of the object.

Optional

Param Int/AlwaysUseMSAA if TRUE, always obtains this information via MSAA, even in those situations where other methods would otherwise be used instead.

Param int/nLevel Which object in the hierarchy should be spoken. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetObjectSubtype

Description Retrieves the subtype of the object located at the current cursor's location. Because the type is a string that differs across languages, this function should only be used when the objective is to speak the type of the object. GetObjectTypeCode should instead be used in all conditional statements because it provides a language independent solution.

Returns String The subtype of the object at the current cursor's location.

Category Object Model And MSAA

function GetObjectSubTypeCode

Description Retrieves the numeric subtype code of the object located at the current cursor's location. Constants for these type codes all begin with WT_ and are defined in HJCONST.JSH. The numeric values are the same for all languages of JAWS. Using this function in all conditional statements instead of using GetObjectType insures that these statements will function without change in multiple languages. The subtype code is more specific, i.e. a button can have the sub type of WT_CHECKBOX.

Returns Int The type of the object at the current cursor's location.

Optional

Param Int/AlwaysUseMSAA if TRUE, always obtains this information via MSAA, even in those situations where other methods would otherwise be used instead.

Param Int/nLevel Level of the object from which to get the type. 0 retrieves the type code for the object with focus; 1 refers to the parent, 2 the grand parent, and so on.

Category Object Model And MSAA

function GetObjectType

Description Retrieves the type of the object located at the current cursor's location. Because the type is a string that differs across languages, this function should only be used when the objective is to speak the type of the object. GetObjectTypeCode should instead be used in all conditional statements because it provides a language independent solution.

Returns String The type of the object at the current cursor's location.

Category Object Model And MSAA

function GetObjectTypeCode

Description Retrieves the numeric type code of the object located at the current cursor's location. Constants for these type codes all begin with WT_ and are defined in HJCONST.JSH. The numeric values are the same for all languages of JAWS. Using this function in all conditional statements instead of using GetObjectType insures that these statements will function without change in multiple languages.

Returns Int The type of the object at the current cursor's location.

Optional

Param Int/AlwaysUseMSAA if TRUE, always obtains this information via MSAA, even in those situations where other methods would otherwise be used instead.

Category Object Model And MSAA

function GetObjectValue

Description If the PC cursor is active, the value of the object with focus is returned. Otherwise, the value of the object at the position of the active cursor is returned. The value is returned as a string.

Returns String the value of the object at the position of the active cursor.

Optional

Param Int/AlwaysUseMSAA if TRUE, always obtains this information via MSAA, even in those situations where other methods would otherwise be used instead.

Param int/nLevel Which object in the hierarchy should be spoken. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Category Object Model And MSAA

function GetOCRLanguages

Description These language codes can be used for primary or secondary OCR language settings.

Returns string a bell-char-delimited list of OCR languages

Category Optical Character Recognition

function GetOutputModeName

Synopsis retrieves a human friendly name for an output mode

Description This function retrieves a human friendly output mode name given an output destination. The names can be different for Speech and Braille. For instance, OT_HELP may have a speech name of Help Information while the Braille name might be hlp. this function is used primarily to retrieve an appropriate message to be shown in the Status cells of the Braille Display or prepended to a Flash message for displays with no status cells during the display of a Flash message. This makes it easier to determine where the message is coming from.

Returns string the human friendly name for the given output mode and destination.

Param int/iOutputType one of the OT constants from hjconst.jsh

Param int/IDestination one of the Output Type destinations from hjconst.jsh.

Category Misc

function GetParagraph

Synopsis Gets the paragraph at the cursor.

Description This function returns the text of the paragraph at the cursor.

Returns String The paragraph.

Category Screen Text

function GetParent

Description Determines which window created a specified child window. For Example, when a dialog box pops up, it could be used to determine the window handle of the window that created the dialog box. It can be used to move up through a list of window handles in order to get to a specific window.

Returns Handle This is the handle of the parent window.

Param Handle This function starts with the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the handle for the starting window.

Category Window

function GetPhraseByExample

Description Retrieves an example phrase of the supplied string.

Returns String The example phrase for the supplied string parameter.

Optional

Param String phrase to retrieve the example for, otherwise it uses the phrase at the current cursor.

Category IME

function GetPlaceMarkerCount

Synopsis Retrieves the number of PlaceMarkers on the current page or virtual document.

Description Returns the number of available PlaceMarkers on the active page. It does not determine whether or not they are valid.

Returns Int The number of PlaceMarkers found.

Category HTML Placemarkers

function GetPowerACLineStatus

Description Returns the Offline or Online status of AC power. The returned value is 0 for Offline, 1 for Online, or 255 if status is unknown.

Returns int Returns the Offline or Online status of AC power.

Category System

function GetPriorCharacter

Description If this function returns a null string, the cursor is at the beginning of the line.

Returns String the prior character from the cursor position.

Optional

Param Int/IncludeMarkup This optional parameter was added in JAWS 10.0. The default value for the parameter it FALSE. This parameter controls whether markup information is included when the text of the character is returned.

Category Screen Text

function GetPriorWindow

Description Provides the prior window handle in a series of window handles at the same logical level. It is used to move across a list of window handles.

Returns Handle Provides the handle of the prior window in the stack or returns a value of 0 when another window cannot be found.

Param Handle This function starts with the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the handle for the starting window.

Category Window

function GetPriorWord

Description gets the word prior to the cursor location without moving the cursor.

Returns string the prior word.

Optional

Param int/bIncludeMarkup FALSE by default.

Category Screen Text

function GetProgramVersion

Description This function returns the major version of an application. For example, if the full version was 3.00.62, Get ProgramVersion would return 3.

Returns Int An integer specifying the major version of the specified program.

Param string The path of the program for which you want the version. You can get the path by using GetAppFilePath.

Category Application Info

function GetProgressBarInfo

Synopsis Returns the handle and the name and value by reference of the first progress bar in the current real window.

Description This function returns the handle, the name and the value of the first progress bar in the current real window.

Returns handle the progress bar handle if any.

Param string/byRef/sName the prompt of the Progress Bar.

Param string/byRef/sValue the value of the progress bar as a percentage.

Category Dialog Controls

function GetProofreadingElementCount

Synopsis gets the number of spelling errors, grammatical errors or revisions in the current document

Description This function returns the number of spelling errors, grammatical errors or revisions in the current document.

Returns int the number of proofreading elements of the specified type.

Param int/nProofreadingElementType see hjconst.jsh for the proofreading element types, peSpellingError, peGrammaticalError, peRevision

Category Proofreading and Annotations

function GetProofreadingElementInfo

Synopsis Gets information about a proofreading element at the current cursor location

Description This function allows the scripter to obtain information about an element at the cursor such as the text, author, initials, type and date of the element (if relevant). Not all components are returned for all element types.

Returns int TRUE if info was obtained for the specified element type, FALSE otherwise

Param int/nProofreadingElementType see HJConst.jsh for types, prefixed by pe.

Param string/byRef/sText text of element

Param string/byRef/sAuthor author's name

Param string/byref/sInitials Author's initials

Param string/byref/sDesc extra descriptive information (such as revision type if element is a revision).

Param string/byref/date date of element creation (such as revision or comment date).

Category Proofreading and Annotations

function GetRangeInconsistencyByIndex

Synopsis obtains information about the specified inconsistency in the requested text range

Description This function obtains information about the inconsistency with the 0-based index in the specified text range at the cursor.

Returns int TRUE or FALSE.

Param int/nRange 0 line, 1 sentence, 2 paragraph

Param int/nIndex 0-based index of inconsistency in range for which you want information

Param int/nInconsistencyTypeFlags The type of inconsistencies bitwise ored together, see hjconst.jsh.

Param int/nPairedSymbolCategoryFlags the flags governing the paired symbols to check, see hjconst.jsh

Param int/byref/nTypeOfInconsistency The inconsistency type see hjconst.jsh

Param string/byref/sChars The characters of the inconsistency (eg the punctuation symbol, miscapitalized letter, etc).

Param int/byref/nOffset The offset of the inconsistency from the start of the specified text range.

Category Proofreading and Annotations

function GetRangeInconsistencyCount

Synopsis returns the number of inconsistencies in the specified text range at the cursor.

Description This function obtains the number of inconsistencies in the specified unit of text. The user can determine what kinds of inconsistencies are detected and thus counted.

Returns int The number of inconsistencies detected in the requested range at the cursor's location.

Param int/nUnit 0 line, 1 sentence, 2 paragraph

Param int/nInconsistencyTypeFlags The type of inconsistencies bitwise ored together, see hjconst.jsh.

Param int/nPairedSymbolCategoryFlags the flags governing the paired symbols to check, see hjconst.jsh

Category Proofreading and Annotations

function GetRealWindow

Description Moves up through the list of window handles in search of a real window. A real window is one that has a title.

Returns Handle Provides the handle of the real window.

Param Handle This function starts with the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the handle for the starting window.

Category Window

function GetRegionCount

Description Gets the number of regions of the indicated type. If no type is given, then a count of all types of regions is returned.

Returns int Count of regions of the indicated type or all region types if no type is specified.

Optional

Param Int/regionType one of the wt_typeCode constants.

Category HTML

function GetRegistryEntryDWORD

Synopsis Gets a DWORD entry of the registry, first parameter represents root key.

Description Use to get DWORD entries in registry.

Returns int registry entry, no error checking.

Param int 0=HKEY_CLASSES_ROOT, 1=HKEY_CURRENT_USER, 2=HKEY_LOCAL_MACHINE, 3=HKEY_USERS.

Param String/byRef/Name of SubKey

Param String/byRef/Name of Variable

Category System

function GetRegistryEntryString

Synopsis Gets a string entry of the registry, first parameter represents root key.

Description Use to get string entries in registry.

Returns string The string of entry, otherwise an empty string.

Param int 0=HKEY_CLASSES_ROOT, 1=HKEY_CURRENT_USER, 2=HKEY_LOCAL_MACHINE, 3=HKEY_USERS.

Param String/byRef/Name of SubKey

Param String/byRef/Name of Variable.

Category System

function GetRelationText

Description Using one of the relation constants specified in hjconst.h, retrieves text associated with the given relation. These relations are specified as part of the IAccessible2 interface.

Returns string Text associated with the requested relation.

Param int Relation type. Only one relation type at a time is valid for this function.

Category Object Model And MSAA

function GetReservedKeystrokes

Description Returns the keystrokes reserved by the currently active web application. This delimited string consists of key;item pairs, where key is the keystroke and item is its action as described by the web application. For example, key;item \n.

Returns String A delimited string containing the keystrokes reserved by the currently active web application in the format keystroke;action \n.

Category Keyboard

function GetRestriction

Description Gets the restriction value for the current cursor. These values are located in HjConst.jsh and start with Restrict.

Returns Int a constant representing the current level of cursor restriction. These constants begin uncder the heading Restriction types, and can be found in hjconst.jsh. They are: RestrictNone to allow the cursor to roam the screen, RestrictAppWindowto restrict to the application window, RestrictRealWindow to restrict to the real window or RestrictWindow to restrict to the current window.

Category Cursors

function GetRestrictionName

Description Says the current level of restriction for the active cursor. All cursors besides the PC cursor can have their restriction changed.

Returns Void

Param Int/nRestriction The first parameter requires a constant indicating the current level of cursor restriction. The function GetRestriction can provide a constant for this value.

Category Cursors

function GetRibbonStatus

Synopsis returns the state, active tab (if any), active group (if any) and group description (if any).

Description This function returns the status and descriptive information about the Microsoft Ribbon in the current application. It will work with and without the virtual ribbon enabled; but, with the virtual ribbon enabled, unless the real focus is on a lower ribbon item, it will not obtain lower ribbon information when the virtual cursor is reviewing lower ribbon objects since they don't really have focus.

Returns int TRUE or FALSE, depending on whether the ribbon data was obtained for the currently focused application.

Param int/byref/RibbonState The state is 0 when the focus is not in the ribbon but the ribbon is expanded, 1 the focus is in the upper ribbon, 2 the focus is in the lower ribbon, 3 the ribbon is collapsed. If the state is 0, 1 or 2, the ribbon is expanded, if it is 3, it is collapsed.

Param string/byref/tabName The name of the active tab if the upper or lower ribbon has focus.

Param string/byref/groupName The name of the lower ribbon group if a lower ribbon group item has focus.

Param string/byref/groupDesc The description of the group of the lower ribbon item with focus.

Category Window

function GetRichEditDocument

Description Gets a pointer to the ITextDocument interface of the document in the specified window. This only works for windows of class RichEdit20A or RichEdit20W. The ITextDocument Interface allows access to the object model of RichEdit documents in a similar manner to the MSWord object model. For more details, search Microsoft Developer Network for "Text Object Model."

Returns Object A pointer to the ITextDocument interface.

Optional

Param Handle/hRichEdit The handle to the window of interest. It defaults to the window with focus.

Category Object Model and MSAA

function GetRightLeaf

Synopsis Traverses the window tree to find the right-most leaf window, starting from the specified root window.

Description Traverses the window tree to find the right-most leaf window, starting from the specified root window.

Returns handle The right-most leaf window handle.

Param handle The starting window handle, the root position.

Param string ByRef The string describing the path from the root to the leaf.

Param int ByRef The hierarchical x position of the leaf window.

Param int ByRef The hierarchical y position of the leaf window.

Category Utility

function getRoleText

Synopsis Retrieves the localized description of an MSAA role.

Description This function retrieves the description of an MSAA role. MSAA roles can be retrieved by accessing the accRole property of an MSAA object. This function is equivalent to the GetRoleText function in the MSAA SDK.

Returns String The text describing the role.

Param int/sRole The role constant to describe. This should be obtained from the accRole property of an MSAA object.

Category Object Model And MSAA

function GetRowHeader

Description When in a table or spreadsheet, gets the contents of the row header.

Returns String Provides the header of information.

Optional

Param Int/iMarkedHeader Include only headers that are marked in the table

Category Tables

function GetRowSpanInfo

Description When in a table on the web, gets position of the current cell in a rowspan and the total number of cells in the span.

Returns int True if the function succeeded, false otherwise.

Param int/byref/posInSpan When the function returns, contains the position in the span of the current cell.

Param int/byref/totalSpan When the function returns, contains the total number of rows spanned by the rowspan cell.

Category Tables

function GetRowText

Synopsis Gets the text of a range of cells on the current row of a table.

Description This function gets the text of a range of cells on the current row of a table. You can specify the separator string to use between data elements, whether or not to include the coordinates of the active cell immediately before that cell's data and the start and end columns to include.

Returns String The text of the included cells.

Optional

Param String/lpszSeparator string to insert between cell data, defaults to a single space.

Param String/lpszCurrentCoordinateTemplate a string defining how the coordinates of the current cell will be rendered. This string must contain two % style parameters (eg c%1r%2) which will be filled with the numeric value of the current column and row respectively. If this parameter is 0 then no coordinates will be included before the current cell.

Param String/lpszBlankCellText the text to be displayed if the cell is blank.

Param Int/nStartCol the starting column, defaults to the first column (1) of the row.

Param Int/nEndCol the ending column, defaults to the last column of the row.

Category Tables

function GetRowTextAsArray

Description Returns an array where each element is the text of a cell in the specified range. For example, if you request the entire row, there will be an element for each cell in the row. If you only request cells 3 to 5, there will be three elements, the first for column 3, the 2nd for 4 and the third for 5. In this case you will need to take note of the starting column requested if you wish to map this back to the entire row.

Returns stringArray the array of cells.

Optional

Param int/startCol Defaults to the first column.

Param int/endCol Defaults to the last column.

Category Tables

function getRunningFSProducts

Description Returns a bit field listing the running products. Valid options are product_JAWS, product_MAGic, or product_OpenBook

Returns int The bit field listing the running products.

Category FS Product Info

function GetScreenEcho

Description Obtains the current screen echo setting. The screen echo setting determines the amount of information that is to be read as the information is displayed on the desktop. The Say NonHighlighted text and Say Highlighted text functions often check the setting for screen echo before deciding how much information to speak.

Returns Int "ECHO_NONE" = 0, "ECHO_HIGHLIGHTED" = 1, "ECHO_ALL" = 2.

Category Screen Text

function GetScreenXML

Description This function obtains screen content as XML which may be processed by the Microsoft MSXML Com Object. To use this XML, you will first need to create an object instance to Microsoft's XML Com interface. Use the following: CreateObject("msxml2.DOMDocument.6.0"), or take a look at HomeRowUIAObject.jss for code examples using XML.

object function GetUIAXMLObject(string UIAInfoXMLString)
var
    object oMSXML,
    object o
if !UIAInfoXMLString then
    return Null()
EndIf
let oMSXML = CreateObject("msxml2.DOMDocument.6.0")
if !oMSXML then
    if InHomeRowMode() then
        Say(msgErr_NoXMLObject,ot_error)
    EndIf
    return Null()
EndIf
oMSXML.async = false
oMSXML.resolveExternals = false
oMSXML.loadXML(UIAInfoXMLString)
let o = oMSXML.SelectNodes("/item")
if !o then
    if InHomeRowMode() then
        say(msgErr_NoItemsInXMLObject,ot_error)
    EndIf
    return Null()
EndIf
return o.item(0)
EndFunction

Optionally, do a search on the Internet for help on data members for the Microsoft XML object.

Returns string The screen content as XML.

Optional

Param int left

Param int top

Param int right

Param int bottom

Category Screen Text

function GetScriptAssignedTo

Description Looks up the name of the script assigned to the specified key or gesture.

Returns string If the key or gesture name is assigned to a script, the name of the script to which it is assigned; null otherwise.

Param string the key or gesture name for which the script assignment is to be determined.

Category Scripts

function GetScriptCallStack

Synopsis Retrieves the names and parameters of all scripts and functions currently executing.

Description Information is ordered from most recent to least recently called items.

Returns string The contents of the call stack.

Category Scripts

function GetScriptDescription

Description Retrieves the description of a specified script.

Returns String The text of the description.

Param string The script name of interest.

Optional

Param int As of JAWS 14, if true, retrieves the script description from default.jsd.

Category Scripts

function GetScriptFileName

Description Retrieves the name of a currently active default or application script file. For the application script file, this is the same as the executable file name of the application, except in those cases where the originally loaded application script file replaced itself with another one by me and of SwitchToScriptFile. Similarly, for the active default script file, this is the name specified in JFW.INI, except in those cases where the original file replaced itself by means of SwitchToScriptFile.

Returns String The name of the script file. This name can be blank if requesting the application script file name and no application script file is loaded.

Param Int/WantAplication True to obtain the name of the application script file, False to obtain the name of the default script file.

Category Scripts

function GetScriptKeyName

Description Retrieves the name of the key attached to the specified script.

Returns String The key name.

Param string The name of the script.

Category Scripts

function GetScriptKeyNames

Description Retrieves a \r \n delimited list of the names of all the keys that are assigned to the specified script.

Returns String A \r \n delimited list of the names of all the keys that are assigned to the specified script.

Param string The name of the script.

Category Scripts

function GetScriptPerformanceHistory

Description Obtains the Script Performance History.

Returns string

Category Misc

function GetScriptSynopsis

Description Retrieves the synopsis of a specified script.

Returns String The text of the synopsis.

Param string The script name of interest.

Optional

Param int As of JAWS 14, if true, retrieves the script synopsis from default.jsd.

Category Scripts

function GetScrollBarInfo

Description Retrieves information about a ScrollBar

Returns int The current position of the thumb on the ScrollBar

Param Handle/hWnd handle to a ScrollBar window or NULL to use the window containing the active cursor

Param int/byref/MinValue the minimum value of the ScrollBar

Param int/byref/MaxValue the maximum value of the ScrollBar

Category Window

function GetSecondaryFocusSelectionGroupPosition

Description Retrieves the position in group information for the selected item at the secondary focus.

Param int/setLevel/ByRef The level of set in the secondary focus.

Param int/sizeOfSet/ByRef The count of items in the secondary focus.

Param int PositionInSet/ByRef The index of the selected item in the secondary focus.

Category Secondary Focus Events and Helpers

function GetSecondaryFocusSelectionText

Description Retrieved the selected text in the secondary focus.

Returns string The selected text in the secondary focus.

Category Secondary Focus Events and Helpers

function GetSelectedCellsAsArray

Description Returns an array where each element is the text of a cell in the selected range. Note this only works in selected apps supporting the selection of cells.

Returns stringArray the array of selected cells.

Optional

Param int/byref/startCol

Param int/byref/startRow

Param string/byref/startColName

Param int/byref/endCol

Param int/byref/endRow

Param string/byref/endColName

Category Selection

function GetSelectedText

Description Retrieves the currently selected text.

Returns String Provides the selected text.

Optional

Param int/bWantMarkup JAWS 6.0, specify true if you want the text to contain speech markup, defaults to false if not specified.

Param int/bWantAllListViewItemText Set when you want to get all the text for a ListView item across multiple columns. When not set you will only get the text in the first column.

Category Selection

function GetSelectionContext

Synopsis Returns a bit pattern of flags indicating items present at the caret or within the current selection.

Description This function returns the currently detected items at the caret or in the selection as determined by the flags set in SetSelectionContextFlags. For instance, if selCtxSpellingErrors is set, and there is a spelling error at the caret location, this flag will be set in the result returned by this function.

Returns int a bit pattern of the detected items at the caret or within the selection.

Category Speech Markup

function GetSelectionContextFlags

Synopsis Returns the flags set by SetSelectionContextFlags which will determine which items will be detected during document navigation.

Description This function enables the user to determine which flags are currently set and thus which items will be detected during document navigation.

Returns int The flags set by SetSelectionContextFlags.

Category Speech Markup

function GetSentence

Synopsis Gets the sentence at the cursor.

Description This function returns the text of the sentence at the cursor.

Returns String The sentence.

Category Screen Text

function GetSettingsCenterControlDisabledReason

Description Used to retrieve a help message for a disabled Settings Center control, explaining why the control is disabled.

Returns String The help message explaining why the control is disabled.

Param handle The dialog page or a spawned dialog, and where the specified control is located.

Param handle The handle of the disabled control who's disabled reason is to be retrieved.

Category Settings

function GetSettingsCenterControlHelp

Description Retrieves the help text belonging to a specified control in the JAWS Settings Center.

Returns string The help message for the specified control.

Param handle The dialog page or a spawned dialog, and where the specified control is located.

Param handle The control who's help string is to be retrieved.

Category Settings

function GetSharedScriptsDirectory

Description Retrieves the full path to where shared scripts reside.

Returns String The full path without a trailing backslash.

Optional

Param int/LanguageSpecific TRUE to include the language code as part of the path, FALSE otherwise.

Category JAWS Program

function GetSharedSettingsDirectory

Description Retrieves the full path to the shared settings directory currently in use. This depends on which language is being used.

Returns String The shared drive and settings directory without a trailing .

Category JAWS Program

function GetSpeechHistory

Description Obtains the Speech History either as plain text or HTML.

Returns string Either plaintext or HTML of speech history.

Optional

Param int true for HTML, false for plain text. The default is to plain text.

Param string if requesting HTML, the title of the HTML.

Category Speech History

function GetSpellString

Description Adds spaces between characters in a string so that saying the string will result in the characters being spelled out.

Returns String

Param String/sText

Category Strings

function GetStringWidth

Synopsis Returns the length of the string in the given font.

Description This function returns the length of the string in units of 1/100 of an inch using the given font.

Returns Int length of the string in 1/100 of an inch.

Param String/sString The string to be measured

Param String/sFontName the name of the font

Param Int/iPointSize The size in points of the font.

Param Int/iBold True if the font is bold.

Param Int/iItalic True if the font is italic.

Param Int/iUnderline True if the font is underlined.

Param Int/iStrikeout True if the font is strikeout.

Category Text Format

function GetSynthLanguages

Synopsis Retrieves a list of the installed synthesiser languages .

Description This function retrieves a list of the currently active synthesisers supported languages.

Returns String the list of synthesiser languages.

Param String/sDelim the delimiter to use to separate the languages in the list.

Category Voices

function GetSynthPitchRange

Description Assigns the minimum and maximum possible pitch settings to the parameters taken by reference.

Returns Void

Param Int/Min/ByRef Type the variable to receive the minimum pitch seting for your synthesizer.

Param Int/Max/ByRef Type the variable to receive the maximum pitch setting for your synthesizer.

Category Voices

function GetSynthRateRange

Description Assigns the minimum and maximum possible rate settings to the parameters taken by reference.

Returns Void

Param Int/Min/ByRef Type the variable to receive the minimum rate setting for your synthesizer.

Param Int/Max/ByRef Type the variable to receive the maximum rate setting for your synthesizer.

Category Voices

function GetSystemDefaultLang

Description Gets the three letter abbreviation of the System Default language of the Windows User Interface.

Returns String Returns a string containing the three letter abbreviation of the System Default language of the Windows User Interface.

Category System

function GetSystemLocaleInfo

Synopsis Gets default System Locale specific information.

Description this function returns Default System specific Locale information. You determine what information to return by providing an identifier defined in locale.jsh as a parameter to this function.

Returns String the Locale specific information

Param Int/iLocaleCType see constants defined in locale.jsh.

Category System

function GetSystemPowerStatus

Description Returns the percentage of full battery charge remaining. The returned value is in the range 0 to 100, or 255 if status is unknown.

Returns int Returns the percentage of full battery charge remaining.

Category System

function GetSystemVolume

Description Gets the current system volume setting.

Returns Int The current system volume setting. Volume ranges from 0 to 100.

Category System

function GetSystemVolumeRange

Description Assigns the minimum and maximum possible volume settings to the parameters taken by reference.

Returns Void

Param Int/Min/ByRef Type the variable to receive the minimum system volume.

Param Int/Max/ByRef Type the variable to receive the maximum system volume.

Category System

function GetSystemYear

Description Gets the current year. Useful where the short date does not return a year, such as the Outlook Calendar when the regional format is set to English (Canada).

Returns string the year

Category System

function GetTableCaption

Description If a table has a caption then this function returns it.

Returns String The Table Caption

Category Tables

function GetTableIndex

Synopsis Returns the 1-based index of the current table.

Description This function returns the 1-based index of the current table. Note that invisible tables are not counted. If the cursor is not within a table, returns 0.

Returns Int the 1-based table index or 0.

Category HTML

function GetTableName

Description If a table has a name then this function returns it.

Returns String The Table name

Category Tables

function GetTableNestingLevel

Synopsis Returns the nesting level of the current HTML table.

Description This function returns the nesting level of the current table. If the table is not nested then the value will be 0.

Returns Int The nesting level (top level table has nesting level 0).

Category Tables

function GetTableRowCount

Description Returns the physical number of rows in the current table column.

Returns Int 0 if not in a table column or the number of rows in the current column.

Category Tables

function GetTableSelectionRange

Description Returns by reference the coordinates and names of the first and last cells in a selection.

Param int/byRef/StartRow

Param int/byRef/StartCol

Param string/byRef/StartName

Param int/byRef/EndRow

Param int/byRef/EndCol

Param string/byRef/EndName

Category Tables

function GetTableSummary

Description If a table has a summary then this function returns it.

Returns String The Table Summary.

Category Tables

function GetTagIndex

Synopsis Returns the 1-based index of the current tag.

Description This function returns the 1-based index of the current tag. Note that invisible tags are not counted. If the cursor is not within the specified tag, returns 0.

Returns Int the 1-based tag index or 0.

Param string/sTag the tag whose index is required.

Category HTML

function GetTagWithAttributeIndex

Synopsis Returns the 1-based index of the current tag/attribute specified.

Description This function returns the 1-based index of the current tag/attribute supplied, the tag maybe empty in which case the current element or one of its ancestors must have the supplied attribute. Note that invisible tags are not counted. If the cursor is not within the specified tag/attribute, returns 0.

Returns Int the 1-based tag index or 0.

Param string/sTag the tag whose index is required (maybe empty).

Param string/sAttribute the attribute which must be present.

Optional

Param int/bAllowNesting whether tag/attribute elements may be nested. This will affect the index so the same value of this parameter must be present for related getTagWithAttributeXX functions for results to be correct.

Category HTML

function GetTestRunner

Description Used for internal testing. Returns a handle to a test object that will be used to run automated tests.

Returns Handle A handle to the test runner.

Category Test

function GetTextBetween

Description Gets the text between two horizontal points on the screen.

Returns String The text located between the two pixel locations.

Param Int/left coordinate of left edge of text to retrieve.

Param Int/right coordinate of right edge of text to retrieve.

Optional

Param Int/CoordinateSystem The Coordinate System to be used to interpret left and right. The default is to interpret them as pixel locations on the screen. See the COORDSYS_xxx constants in hjconst.jsh.

Category Screen Text

function GetTextFromClipboard

Synopsis Retrieves Text from Windows Clipboard.

Description Retrieves plain text from clipboard.

Returns String

Category Clipboard

function GetTextInFocusRects

Description Retrieves the contents of all focus rectangles into a single buffer.

Returns String The contents of the focus rectangles.

Param Handle Handle of window.

Category Window

function GetTextInFrame

Description Retrieves the text inside a specified frame.

Returns String The frame contents.

Param String/FrameName The name of the frame desired.

Optional

Param Int/bAddLineBreaks whether or not to add line breaks or to get the text as one long string.

Category Frames

function GetTextInRect

Description This function gets text inside a rectangle specified by four points on the screen representing the top, bottom, left, and right boundaries of the rectangle.

Returns String Text inside the rectangle.

Param Int/Left Left edge of rectangle.

Param Int/Top top edge of rectangle.

Param Int/Right right edge of rectangle.

Param Int/Bottom bottom edge of rectangle.

Optional

Param Int/Attributes attributes of text to include. Use 0 to include all text or use a combination of attribute flags to only return text with those attributes.

Param Int/textColor color of text to include, use IgnoreColor constant for any color.

Param Int/backgroundColor background color of text to include.

Param Int/bIncludeLineBreaks Whether or not to add line breaks or to get the text as one long string.

Param Int/CoordinateSystem The prefered coordinate system in which the value should be returned This is only a recommendation and will not work in all places. See the COORDSYS_xxx constants in hjconst.jsh.

Category Window

function GetThePartOfLineThatChanged

Description Given two strings of text which start with the same text, and where the new string contains additional text at the end which was not present in the old text, returns the newly added text. This is not a StringDiff, rather it is a function to detect newly added text at the end of a string of text.

Returns string The newly added text at the end of a string of old text.

Param string the new text which starts with the same text as the old text, but which may have additional text following the old text.

Param string The old text.

Category Strings

function GetTickCount

Description Retrieves the amount of time that has passed since Windows was started.

Returns Int Number of milliseconds that have passed since Windows was started.

Category System

function GetToEndOfLine

Description Retrieves text on the current line that is located to the right of the current cursor.

Returns String the text to the right of the current cursor.

Category Screen Text

function GetTopLevelWindow

Description Similar to GetAppMainWindow. These two functions differ however in that GetAppMainWindow will always return the handle for the main window of the application. In contrast, the GetTopLevel function can be used within dialog boxes to return the handle of the main dialog window when there may be several child windows which are also real windows. This can be useful when the GetRealWindow function does not return the handle of the main dialog. A real window refers to a window with a title.

Returns Handle The handle of the TopLevel window, as opposed to the AppMainWindow.

Param Handle This function starts with the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the handle for the starting window.

Category Window

function GetTreeInfo

Synopsis Used by TreeCapture script to traverse the window tree and retrieve informatin about each window in the tree.

Description Used by TreeCapture script to traverse the window tree and retrieve informatin about each window in the tree.

Returns string The collected technical information about all windows in the tree.

Param handle The starting window, the root of the window tree to be traversed.

Category Utility

function GetTreeViewLevel

Description Obtains the indent level of the item in a tree view that has focus. The root of the tree has the level 0.

Returns Int The level of the item with focus.

Category Dialog Controls

function GetTypeAndTextStringsForObject

Synopsis Uses MSAA to retrieve information about an MSAA object & it's children.

Description Information about each control is similar to that obtained from SayObjectTypeAndText. The order in which items appear is dictated by how they appear in the MSAA hierarchy.

Returns String The contents of the MSAA object hierarchy excluding certain control types.

Param object The object for which the information is to be retrieved.

Optional

Param int/includeInvisibleNodes TRUE if the function should retrieve text for invisible nodes.FALSE if invisible node text should be excluded. The default is true.

Category Object Model and MSAA

function GetTypeAndTextStringsForWindow

Synopsis Uses MSAA to retrieve information about a window & it's children

Description Information about each control is similar to that obtained from SayObjectTypeAndText. The order in which items appear is dictated by how they appear in the MSAA hierarchy.

Returns String The contents of the window

Param handle/Window The window containing the controls to be queried.

Category Object Model and MSAA

function GetUserDefaultLang

Description Gets the three letter abbreviation of the Default language of the Windows User Interface for the user that is currently logged into the system.

Returns String Returns a string containing the three letter abbreviation of the Default language of the Windows User Interface for the user that is currently logged into the system.

Category System

function GetUserLocaleInfo

Synopsis Gets User Locale specific information.

Description this function returns User specific Locale information. You determine what information to return by providing an identifier defined in locale.jsh as a parameter to this function.

Returns String the Locale specific information..

Param Int/iLocaleCType see constants defined in locale.jsh.

Category System

function GetUserSettingsDirectory

Description Retrieves the full path to the user settings directory currently in use. This depends on which language is being used.

Returns String The user drive and settings directory without a trailing .

Category JAWS Program

function GetVariantType

Description Determines the type of a variable. Useful with determining the type of collection members, or variables of type variant.

Returns int An integer designating the type of variable, see hjConst.jsh for the values of the different variable types.

Param variant The variable whose type you want to get.

Category Misc

function GetVerbosity

Description Used to obtain the current setting for verbosity. It returns a constant value to indicate the setting: Beginner means speak maximum information, Intermediate means speak a moderate amount of information, and Advanced means speak a minimum amount of information. These values can be used in If...Then...Else...statements.

Returns Int "BEGINNER" = 0, "INTERMEDIATE" = 1, "ADVANCED" = 2.

Category Settings

function GetVersionInfoString

Description GetVersionInfoString gets a requested string from the version table of an application.

Returns String The requested string.

Param string The path of the program for which you want the information. You can get the path by using GetAppFilePath.

Param string Identifier string specifying which piece of information is requested. Identifiers must be contained within quotation marks. You can use the following identifiers: Comments, CompanyName, FileDescription, FileVersion, InternalName, LegalCopyright, LegalTrademarks, OriginalFilename, PrivateBuild, ProductName, ProductVersion, or SpecialBuild.

Category Application Info

function GetVoiceParameters

Description Retrieves the parameters for the voice context you specify. These include Volume, Rate, Pitch, Punctuation and person.

Returns Void

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Param Int/volume/ByRef Type the variable to receive the voice volume setting.

Param Int/Rate/ByRef Type the variable to receive the voice rate setting.

Param Int/Pitch/ByRef Type the variable to receive the voice pitch setting.

Param Int/Punctuation/ByRef Type the variable to receive the voice punctuation setting.

Param String/Person/ByRef Type the variable to receive the voice person setting.

Category Voices

function GetVoicePerson

Description Using the Voice Context name, the person for the active voice is returned.

Returns String The current voice person setting.

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Optional

Param Int/iSaveWhere This parameter is optional. Setting a value of true, saves the voice settings to the application file. The default is to save it in the default.jcf.

Category Voices

function GetVoicePitch

Description Using the Voice Context name, the pitch setting for the active voice is returned.

Returns Int The current voice pitch setting.

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Optional

Param Int/iSaveWhere This parameter is optional. Setting a value of true, saves the voice settings to the application file. The default is to save it in the default.jcf.

Category Voices

function GetVoiceProfileCount

Description Returns the count of available voice profiles.

Returns int The the count of available voice profiles.

Category Voices

function GetVoiceProfileNames

Description Returns a " \007" delimited list of profile names.

Returns string The delimited list of voice profile names.

Category Voices

function GetVoicePunctuation

Description Using the Voice Context name, the punctuation setting for the active voice is returned.

Returns Int The current voice punctuation setting.

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Optional

Param Int/iSaveWhere This parameter is optional. Setting a value of true, saves the voice settings to the application file. The default is to save it in the default.jcf.

Category Voices

function GetVoiceRate

Description Using the Voice Context name, the rate setting for the active voice is returned.

Returns Int The current voice rate setting.

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Optional

Param Int/iSaveWhere This parameter is optional. Setting a value of true, saves the voice settings to the application file. The default is to save it in the default.jcf.

Category Voices

function GetVoiceVolume

Description Using the Voice Context name, the volume setting for the active voice is returned.

Returns Int The current voice volume setting.

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Optional

Param Int/iSaveWhere This parameter is optional. Setting a value of true, saves the voice settings to the application file. The default is to save it in the default.jcf.

Category Voices

function GetVoiceVolumeRange

Description Assigns the minimum and maximum possible volume settings to the parameters taken by reference.

Returns Void

Param Int/Min/ByRef Type the variable to receive the minimum volume setting for your synthesizer.

Param Int/Max/ByRef Type the variable to receive the maximum volume setting for your synthesizer.

Category Voices

function GetWindowAtPoint

Description Gets the handle of the window at the specified point. For example, this function can be used with MouseMovedEvent to get the handle of the window containing the mouse pointer.

Returns Handle The handle of the window at the point specified by x and y. The value is 0 if a valid window handle is not found.

Param Int/x The horizontal (x) value of the point.

Param Int/y The vertical (y) value of the point.

Category Window

function GetWindowBottom

Description Gets the screen coordinate for the bottom of the window of interest.

Returns Int Screen coordinate of bottom edge of window.

Param Int Handle of window of interest.

Category Window

function GetWindowClass

Description This obtains the window class name of a window. Most standard windows (non SDM windows) have a window class name and a window type name. Window class names are generally unique to specific windows in specific applications.

Returns String The string is the class name.

Param Handle This function provides information for the window that is identified by a window handle. Type a variable name or choose a script function to provide the window handle it needs.

Category Window

function GetWindowExStyleBits

Synopsis Returns the Window extended style bit flags.

Description This function returns the window extended style bit flags. See the WS constants in the standard winUser.h.

Returns Int the bit flags.

Param Handle/hWnd the window whose style bits are required.

Category Window

function GetWindowHierarchyX

Synopsis Gets the hierarchical position of the supplied window relative to the first window at the same level.

Description This function gets the hierarchical position of the supplied window relative to the first window at the same level, ie it counts the windows at the same level and returns this window's position.

Returns Int The position of the window relative to the first at the same level.

Param Handle/hWnd handle of starting window.

Category Window

function GetWindowHierarchyY

Synopsis Gets the hierarchical position of the supplied window relative to the window's first existing ancestor.

Description This function gets the hierarchical position of the supplied window relative to the first ancestor for this window, ie counts the parent, grandparent, great grandparent etc.

Returns Int The position of the window relative to the first existing ancestor.

Param Handle/hWnd handle of starting window.

Category Window

function GetWindowLeft

Description Gets the screen coordinate for the left of the window of interest.

Returns Int Screen coordinate of left edge of window.

Param Int Handle of window of interest.

Category Window

function GetWindowName

Description Obtains the title of the specified window, such as for a main application window, dialog box, or document window. Not all windows have titles.

Returns String Provides the title of the window when a title is present. When a title is not present, the null value of " ," is returned.

Param Handle Type the name of a variable or choose a script function to specify the window handle title that is desired.

Category Window

function GetWindowOwner

Synopsis Retrieves the name of the application which owns the window.

Description If possible, retrieves the name, including the full path, to the application which owns the window.

Returns string the path and name of the owning application, or null if the application could not be determined.

Param handle Type the name of a variable or choose a script function to specify the window handle title that is desired.

Category Window

function GetWindowRect

Description Gets the bounding rectangle of the window whose handle is specified.

Returns Int TRUE if the bounding rectangle is successfully retrieved.

Param Handle/hwnd The handle of the window for which the rectangle is requested. GetFocus can be used to return this value.

Param Int/nLeft The left edge of the bounding rectangle after the function is called.

Param Int/nRight The right edge of the bounding rectangle after the function is called.

Param Int/nTop The top edge of the bounding rectangle after the function is called.

Param Int/nBottom The bottom edge of the bounding rectangle after the function is called.

Category Window

function GetWindowRight

Description Gets the screen coordinate for the right of the window of interest.

Returns Int Screen coordinate of right edge of window.

Param Int Handle of window of interest.

Category Window

function GetWindowsOS

Description Provides information about which operating system is being used.

Returns Int One of the constants OS_WIN95 or OS_WIN_NT. These constants are defined in HJCONST.jsh.

Category System

function GetWindowsSystemDirectory

Synopsis Returns the current Windows System directory.

Description Returns the path to the Windows System directory as a string.

Returns String the path to the current Windows System Directory.

Category System

function GetWindowStyleBits

Synopsis Returns the Window style bit flags.

Description This function returns the window style bit flags. See the WS constants in the standard winUser.h.

Returns Int the bit flags.

Param Handle/hWnd the window whose style bits are required.

Category Window

function GetWindowSubtypeCode

Description Obtains the window subtype code number for the specified window. This function is similar to GetWindowTypeCode, but attempts to be even more specific. If no more specific information is available, returns the same thing as GetWindowTypeCode. For example, Calling GetWindowTypeCode using the window handle for the Taskbar would return WT_TABCONTROL, and calling GetWindowSubtypeCode would return WT_TASKBAR, a more specific type of tab control. See the documentation for GetWindowTypeCode for more details.

Returns Int The window subtype number for the specified window.

Param Handle This function provides information for the window that is identified by a window handle. Type a variable name or choose a script function to provide the window handle it needs.

Optional

Param int/AlwaysUseOSM TRUE to never use the DOMServer to obtain this info

Category Window

function GetWindowText

Description Retrieves the text contained in a window.

Returns String The retrieved text.

Param Handle/hwnd The handle of the window containing the requested text. GetFocus can be used to return this value.

Param Int/bHighlightOnly TRUE if only highlighted text is requested, otherwise FALSE.

Category Window

function GetWindowTextEx

Description Retrieves the text contained in a window. It functions similar to GetWindowText but allows you to select whether or not to retrieve the text in all child windows.

Returns String The retrieved text.

Param Handle/hwnd The handle of the window containing the requested text. GetFocus can be used to return this value.

Param Int/bHighlightOnly Enter TRUE if only highlighted text is requested, otherwise FALSE.

Param Int/bIncludeChildren Enter TRUE if text within child windows should be included, FALSE if only text from this window should be retrieved.

Optional

Param Int/bInhibitNewTextEvent Enter TRUE to inhibit NewTextEvent's for any new strings returned by this function that have not yet triggered a NewTextEvent. Enter FALSE if this function should not affect NewTextEvent's. The default is TRUE. (Available as of JAWS 10.0 Update 1)

Category Window

function GetWindowTop

Description Gets the screen coordinate for the top of the window of interest.

Returns Int Screen coordinate of top edge of window.

Param Int Handle of window of interest.

Category Window

function GetWindowType

Description Obtains the window type name of a window. Most standard windows (non SDM windows) have a window type name and a window class name. Examples of window types are: static text, edit field, check box, radio button, etc. The same window type names are commonly used in many different Windows applications.

Returns String The string is the window type.

Param Handle This function provides information for the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the window handle it needs.

Category Window

function GetWindowTypeCode

Description Obtains the window type code number for the specified window. These numbers are the same for English and non-English versions of JAWS. Many window type numbers have constant values assigned to them in the file HJCONST.JSH. The GetWindowType function returns these constants instead of the window type number.

Returns Int The window type number for the specified window.

Param Handle Type a variable name or choose a script function to provide the window handle it needs.

Optional

Param int/AlwaysUseOSM TRUE to never use the DOMServer to obtain this info

Category Window

function GetWord

Description Copies the word where the active cursor is positioned. The copied text can then be used by other script functions

Returns String Provides a word.

Category Screen Text

function GetWordInContext

Description When in a spell check, find, or replace dialog, this function gets the line of text from within a document that contains the active word in the dialog. Used, for example, to speak the context of a particular word which the spell check dialog thinks is misspelled.

Returns String Provides a line of text containing the word in question.

Category Screen Text

function GetWordList

Synopsis retrieves a list of unique words for the current paragraph or document

Description This function retrieves a word list (with optional occurance counts for words which occur more than once) for the current paragraph or document.

Returns string The delimited list of words with an optional occurrence count in parentheses after each word which occurs more than once.

Optional

Param string/sDelim the delimiter to use to separate each list item (defaults to the LIST_ITEM_SEPARATOR defined in hjconst.jsh).

Param int/bIncludeOccurrenceCounts TRUE to include the occurance count for words occurring more than once in the paragraph or document (defaults to FALSE).

Param int/bObtainListForParagraphOnly TRUE to only obtain the word list for the current paragraph, FALSE to retrieve the list for the entire document (defaults to FALSE).

Category Screen Text

function GotoLineNumber

Synopsis Moves the cursor to the specified line number in virtual documents.

Description this function moves the cursor to the specified line number in a virtual document.

Returns Int true if the line was successfully moved to, false otherwise.

Param Int/nLine the line number (starting at 1).

Category Navigation

function GrantAppContainerAccess

Synopsis Grants app container access to a fully qualified file such as a personalized web settings file

Description In Windows 8 and higher, with Enhance Protected Mode enabled, IE always runs so that it can't access files for which access hasn't explicitly been granted to the AppContainer user. This function allows applications running in App Container mode to read from JSI or other files.

Returns int TRUE if the access was granted, FALSE otherwise.

Param string The fully qualified name of the file.

Category System

function GraphicsEnumerate

Description For every graphic contained within a specific window, calls a specified function, passing it the coordinates of the graphic.

Returns Int Count of the number of graphics enumerated.

Param Handle/hwnd The handle of the window containing the graphics of interest.

Param String/strFunctionName The name of the function to be called with information about each graphic in the window. This function should return TRUE if the enumeration is allowed to continue, FALSE if the enumeration should stop immediately. This function should be defined as: int Function SomeName(int nLeft,int nTop,int nRight,int nBottom).

Category Graphics

function GraphicsLabeler

Description Starts the graphics labeler utility that is used to label graphic symbols. The JAWS cursor must be positioned on the graphic symbol that you wish to label before this function is used.

Category Graphics

function GraphicsListHelper

Description Assists the GraphicsList function in creating a string delimitted list of graphics labels.

Category Graphics

function GraphicsShow

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function GraphicsVerbosity

Synopsis Toggles between the graphics verbosity levels.

Description Graphics Verbosity can be set to All Graphics, Labeled Graphics, or No Graphics.

Returns String description of value to be displayed as value of Graphics Verbosity.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category Graphics

function HasFocusRect

Description Determines if the specified window has a focus rectangle (Not implemented currently).

Returns Int "True" or "False", 1 or 0.

Param Handle Handle of window to check

Category Window

function HasTitleBar

Description Determines whether a window has a title bar. If the window has a title bar, then the function returns a constant value of TRUE. If the window does not have a title bar, then a constant value of FALSE is returned. Windows that typically have title bars are dialog boxes and main application windows.

Returns Int "TRUE" = 1, "FALSE" = 0.

Param Handle This function examines the window that is identified by a window handle. Type the name of a variable or choose a script function that can provide the window handle it needs.

Category Window

function HasUserDefinedVoiceProfiles

Description Returns TRUE if there are user defined voice profiles. Returns 0 otherwise.

Returns Int Returns TRUE if there are user defined voice profiles. Returns 0 otherwise.

Category Voices

function HexToDec

Synopsis converts a hexidecimal string to a decimal integer.

Description This function converts a hexidecimal string to a decimal integer.

Returns int The decimal value

Param string/iDec hexidecimal value

Category Number conversion

function HideRectangleWindow

Description Hides, or removes from the screen, the rectangle created by ShowRectangleWindow.

Category Window

function HighWord

Description retrieves the high-order word from the specified value.

Returns Int The high-order word from the specified value.

Param Int/dwValue Specifies the value to be converted.

Category Number conversion

function HTMLButtonTextVerbosityToggle

Synopsis Toggles the verbosity for Button elements.

Description Toggles the verbosity for buttons between title, screen text/label, alt, value and longest.

Returns String description of value to be displayed as value of HTML button text verbosity item.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLDecrementLinesPerPageItem

Synopsis Decreases lines per page while in virtual cursor mode.

Description Decreases the number of lines used when the page up or page down is used in virtual cursor mode.

Returns String description of value to be displayed as value of HTML decrement lines per page option.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLDecrementMaxBlockLength

Synopsis Decrements the Max Block Length setting by 10.

Description This keystroke is used to decrement the max block length by 10 in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. This keystroke uses a minimum value of 0. If a successful change in the block length would result in a maximum block length of 0 or less, this value is reset to 255.

Returns String description of value to be displayed as value of HTML decrement max block length.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLDecrementMaxLineLength

Synopsis Increments the Max Line Length setting by 10.

Description This keystroke is used to increment the max line length by 10 in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. This keystroke uses a minimum value of 0. If a successful change in the line length would result in a maximum line length of 0 or less, this value is reset to 255.

Returns String description of value to be displayed as value of HTML decrement max line length.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLFrameIndicationToggle

Synopsis Toggles the Frame Indication Setting.

Description This keystroke is used to toggle the Frame Indication setting in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. The possible values for this JCF option are Give No indication of Frame Change, Say the name of the frame at the beginning and end of each frame, Say New Frame at the beginning of each frame.

Returns String description of value to be displayed as value of HTML frame indication option.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLGraphicReadingVerbosityToggle

Synopsis Toggles the verbosity for image elements.

Description Toggles the verbosity for reading HTML Graphics from longest, OnMouseOver, title and alt tag.

Returns String description of value to be displayed as value of HTML Graphics Reading verbosity item.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIdentifyLinkTypeToggle

Synopsis Toggles the HTML Identify Link Type Setting.

Description This keystroke is used to toggle the identification of link type in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. The possible values for this JCF option are identify link type enabled and nce link only.

Returns String description of value to be displayed as value of HTML link type.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIdentifySamePageLinksToggle

Synopsis Toggles the Identify Same Page Link Setting.

Description This keystroke is used to toggle the identification of same page links in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. The possible values for this JCF option are identify same page links on and identify same page links off.

Returns String description of value to be displayed as value of HTML Same Page Links item.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIncludeGraphicsToggle

Synopsis Toggles the HTML Include Graphics Settings.

Description This keystroke is used to toggle the graphics verbosity setting in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. The possible values for Include HTML Graphics are Labeled, None, and All.

Returns String description of value to be displayed as value of HTML Graphics Toggle.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIncludeImageMapLinksToggle

Synopsis Toggles the HTML Include Image Map Links Setting.

Description This keystroke is used to toggle the Image Map link verbosity setting in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. The possible values for this JCF option are never include image map links, include image map links that have labels, include all image map links.

Returns String description of value to be displayed as value of HTML Image Map Level.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIncludeLinksToggle

Synopsis Toggles the HTML Include Graphical Links Setting.

Description This keystroke is used to toggle the graphical link verbosity setting in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. The possible values for this JCF option are never include graphical links, include graphical links that have labels, and include all graphical links.

Returns String description of value to be displayed as value of HTML Links Level.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIncrementLinesPerPageItem

Synopsis Increases lines per page for virtual cursor mode.

Description Increases the lines per page that is used when the user uses the page up and page down in virtual cursor mode.

Returns String description of value to be displayed as value of HTML increment lines per page.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIncrementMaxBlockLength

Synopsis Increments the Max Block Length setting by 10.

Description This keystroke is used to increment the max block length by 10 in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. This keystroke uses a maximum value of 255. If a successful change in the maximum block length would result in a maximum block length of 155, this value is reset to 10.

Returns String description of value to be displayed as value of HTML increment max block length.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIncrementMaxLineLength

Synopsis Decrements the Max Line Length setting by 10.

Description This keystroke is used to decrement the max line length by 10 in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. This keystroke uses a minum value of 0. If a successful change in the line length would result in a maximum line length of 0 or less, this value is reset to 255.

Returns String description of value to be displayed as value of HTML increment max line length.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIndicateBlockQuotes

Synopsis Toggles whether or not block quotes are indicated in Virtual Cursor.

Description Turns on or off the Block Quotes indication.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIndicateElementAccessKeys

Synopsis Toggles whether or not element Access Keys are indicated in Virtual Cursor.

Description Turns on or off the Element Access Keys indication.

Returns String description of value to be displayed as value of Indicate Element Access Keys option.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLIndicateLists

Synopsis Toggles whether or not lists are indicated in Virtual Cursor.

Description Turns on or off the lists indication.

Returns String description of value to be displayed as value of Indicate lists option.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLScreenFollowsVCursorToggle

Synopsis Toggles the Screen Follows VCursor Setting.

Description This keystroke is used to toggle the Frame follows virtual cursor setting in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. The possible values for this JCF option are will automatically scroll to display the line on which the VCursor is positioned and will not scroll to display the line on which the VCursor is positioned.

Returns String description of value to be displayed as value of HTML Screen Follows Virtual Cursor option.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLSkipPastRepeatedTextToggle

Synopsis Toggles the Skip Past Repeated Text Setting.

Description This keystroke is used to toggle the Skip Past Repeated Text setting in the context of HTML Documents and Web pages. This keystroke is designed to be a part of the HTML Options dialog that is displayed by the script Adjust HTML Settings. The possible values for this JCF option are Virtual Cursor Will Skip Text that was repeated when a new page is loaded and Virtual Cursor Will Not Skip Text that was repeated when a new page is loaded.

Returns String description of value to be displayed as value of HTML Skip Repeated Text option.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLTextLinkVerbosityToggle

Synopsis Toggles the verbosity for text links.

Description Toggles the verbosity for text links between title, screen text, onMouseOver, longest and custom.

Returns String description of value to be displayed as value of HTML text link verbosity item.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLToggleFormsModeAutoOff

Synopsis Toggles the setting of FormsModeAutoOff.

Description This function toggles the setting of the FormsModeAutoOff feature. When on, Forms mode is switched off whenever a new page is loaded provided you weren't in Forms mode in that IE session previously. Forms mode is also turned off if the page is updated by the server. When this setting is off, Forms Mode is never automatically switched off once it has been turned on Unless you switch to an IE session which previously had it turned off.

Returns String description of value to be displayed as value of HTML Toggle Forms Mode Auto Off

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function HTMLToggleIgnoreInlineFrames

Synopsis Toggles the inclusion of inline frames.

Description This function toggles the inclusion of inline frames in the virtual representation of a web page. Inline frames are often used for advertisements so this function provides a way to turn off unwanted ads which are implemented using inline frames.

Returns String description of value to be displayed as value of HTML Ignore Inline Frames.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function IE4GetCurrentDocument

Synopsis Returns an object that represents the HTML document in a given browser window.

Description The document object can be used to retrieve information about the document, to examine and modify the HTML elements and text within the document, and to process events. This function obtains the document object of the document in the current window.

Returns Object An object that represents the HTML document in a given browser window.

Category Object Model And MSAA

function IE4GetFocus

Description Returns the index of the focus object in Internet Explorer in the context of the entire collection of objects in the current document object.

Returns Int The value indicating the index of the focus object in Internet Explorer.

Category HTML

function IEGetCurrentDocument

Description This function returns an object that represents the HTML document in a given browser window. The document object can be used to retrieve information about the document, to examine and modify the HTML elements and text within the document, and to process events. This function obtains the document object of the document in the current window.

Returns Object An object that represents the HTML document in a given browser window.

Category HTML

function IEGetFocus

Description Returns the index of the focus object in Internet Explorer in the context of the entire collection of objects in the current document object

Returns Int The value indicating the index of the focus object in Internet Explorer.

Category HTML

function IEGetUnrestrictedWindow

Description Gets the Internet Explorer window with full read access.

Returns Object Window with full read access.

Param object/FrameWindow

Category HTML

function IEReformatBody

Synopsis Used to reformat documents displayed in Internet Explorer_Server Windows.

Description Used to reformat an internet Web page that is composed of many graphics and multiple columns and / or frames. It reformats the Web page by converting to a single column of text. The reformatted Web page contains no graphics. However, if the graphic was related to a hyperlink, that hyperlink is included in the reformatted document. It then displays the reformatted document in the active window.

Returns Int Returns 1 if the reformatting was successful, returns 0 otherwise.

Param Handle/hndIESrvWindow The window handle of the Internet Explorer_Server Window

Category HTML

function IMEGetCharAtCursor

Description Retrieves the character under the cursor in the IME composition buffer.

Returns String

Category IME

function IMEGetCompositionString

Description Retrieves the contents of the string being composed in the IME.

Returns String

Category IME

function ImeGetConversionStatus

Synopsis Gets the IME status

Description Gets the IME status for the window that currently has focus.

Returns Int Returns and integer value that indicates the current conversion mode of the Input Method Editor. The possible return values are as follows: imeCModeUnknown (=0), imeCModeInactive (=1), imeCModeOff (=2), imeCModeAlphaHalf (=3), imeCModeAlphaFull (=4), imeCModeKatakanaHalf (=5), imeCModeKatakanaFull (=6), imeCModeHiraganaHalf (=7), and imeCModeHiraganaFull (=8).

Optional

Param Int/bRomanMode/ByRef An integer that is used to specify the current state of the Roman Mode Flag for the IME associated with the focused window. This value is set to be equal to 0 if the Roman Mode Flag is not set and 1 if the Roman Mode Flag is set. See the documentation on ImmGetConversionStatus and the IME Conversion Mode Values in Microsoft's MSDN Library for more information.

Param Int/iConversionMode/ByRef An integer that is used to specify the current conversion mode of the IME associated with the focused window. This is the unparsed value that is obtained from the Win32 API function ImmGetConversionStatus. See the documentation on ImmGetConversionStatus and the IME Conversion Mode Values in Microsoft's MSDN Library for more information.

Param Int/iSentenceMode/ByRef An integer that is used to specify the current sentence mode of the IME associated with the given window. This is the unparsed value that is obtained from the Win32 API function ImmGetConversionStatus. See the documentation on ImmGetConversionStatus and the IME Conversion Mode Values in Microsoft's MSDN Library for more information.

Category IME

function ImeGetDescription

Description Gets the name of the active IME for this window if there is one, otherwise the name of the keyboard layout being used.

Returns String Name of the active IME for this window if there is one, otherwise the name of the keyboard layout being used.

Param Handle/hWnd Which window to check.

Category IME

function ImeGetGuideLine

Description Gets Ime error message.

Returns String

Param Handle/Window The window associated with the Ime of interest.

Category IME

function ImeIsActive

Description Determines whether or not an Ime is associated with the passed window handle.

Returns Int True if an Ime is associated, False otherwise.

Param Handle/window Window to check

Category IME

function InARIAGrid

Description Used to determine if the cursor is inside an ARIA grid on a web page. An ARIA grid is generated by the role="grid" attribute on an HTML element.

Returns Int 1 (True) or 0 (false).

Category Cursors

function IndentationIndicate

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function IndicateControlState

Synopsis Identifies the scontrol state using the Speech Markup rules.

Description Allows your custom scripts to take advantage of the scheme the user has set up.

Returns Void

Param Int/iType Enter the JFW Subtype Code for which this applies. See WT_ constants in HjConst.jsh.

Param int nState Either use GetControlAttributes function or one of the CTRL_ constants from HjConst.jsh if you need to specify the state yourself.

Optional

Param String/sOptionalText If for some reason, you need to have different text spoken you can use this parameter to enter text to be spoken. It will be marked up as any other text would be.

Category Speech Markup

function IndicateControlType

Synopsis Indicates the control type using Speech Markup.

Description Pass the correct control type you want to be spoken for the window or control to speak. This will honor the speech markup.

Returns Void

Param Int/iType Enter the type of control to be spoken.

Optional

Param string sControlName Enter the name of the control to be spoken, if you have a custom name for this control. This would be true if the wrong name is spoken, or perhaps none at all, and you are customizing this control to speak. An example would be an edit that just says Edit without the control's name.

Param String/ControlText Enter the text or value of the control to be spoken, if it doesn't happen already. Most edits, lists, etc. already do it, but if you need to change this here's where.

Category Speech Markup

function InFSVoiceSettingsDialogBox

Description Used to determine whether or not one of the dialog boxes that are used to modify the voice settings is currently open.

Returns Int 1 if one of the dialog boxes that are used to modify the voice settings is currently open. 0 otherwise.

Category Voices

function InHJDialog

Description Checks to see if one of the dialog boxes generated by JFW is active. These include JAWSFind, GraphicsLabeler, DlgSelectItemInList, and DlgSysTray.

Returns Int TRUE if a dialog is active, FALSE otherwise.

Category User Interaction

function IniFlush

Description Flushes all previous writes by IniWriteInteger or IniWriteString specified for the file indicated by strFile. Flushing will guarantee that the newly written sections, keys or values will be available for subsequent reading functions.

Returns Int TRUE if flush was successful, FALSE otherwise.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will write the file under the \Settings directory.

Category Files

function IniFlushEx

Description Flushes all previous writes by IniWriteInteger or IniWriteString specified for the file indicated by strFile. Flushing will guarantee that the newly written sections, keys or values will be available for subsequent reading functions.

Returns Int TRUE if flush was successful, FALSE otherwise.

Param Int/iLocationCode Determines the directory where the file is located.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will write the file under the \Settings directory.

Category Files

function IniReadInteger

Description Reads an integer value from an ini style file. An ini style file is a file containing sections of keys with their values.

Returns Int The retrieved value or the default value if the key does not exist in the given section.

Param String/strSection The name of the section containing the desired key value. This value must either be a variable or contained in quotes.

Param String/strKey The name of the key whose value is to be retrieved. This value must either be a variable or contained in quotes.

Param Int/nDefault The value that will be returned if the key cannot be retrieved.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will read the file from the User, or if not found then shared, Settings directory.

Optional

Param int/ReadSource One of the ReadSource (rs) constants defined in HJConst.JSH. The possible values are as follows: rsStandardLayering - causes standard layering behavior to be used, the setting will be read from the transient focus file first, then the transient session file, then the user settings file, and finally the shared settings file, stopping at the first file in which the desired setting is found; rsSession - the setting will be read from the transient session settings file, no layering will be used; rsFocus - the setting will be read from the transient focus settings file, no layering will be used; rsNoTransient - the transient settings files will be ignored and the setting will be read from the user settings file layered over the shared settings file. Note that this parameter is ignored if the FileType parameter is FT_MODULE_INI, FT_JSI, FT_SHARED_DEFAULT_JCF, or FT_SHARED_CURRENT_JCF. If this parameter is not specified the default value of rsStandardLayering will be used.

Category Files

function IniReadIntegerEx

Description Reads an integer value from an ini style file. An ini style file is a file containing sections of keys with their values.

Returns Int The retrieved value or the default value if the key does not exist in the given section.

Param String/strSection The name of the section containing the desired key value. This value must either be a variable or contained in quotes.

Param String/strKey The name of the key whose value is to be retrieved. This value must either be a variable or contained in quotes.

Param Int/nDefault The value that will be returned if the key cannot be retrieved.

Param Int/iLocationCode Determines the directory where the file is located.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will read the file from the \Settings directory.

Optional

Param int/ReadSource One of the ReadSource (rs) constants defined in HJConst.JSH. The possible values are as follows: rsStandardLayering - causes standard layering behavior to be used, the setting will be read from the transient focus file first, then the transient session file, then the user settings file, and finally the shared settings file, stopping at the first file in which the desired setting is found; rsSession - the setting will be read from the transient session settings file, no layering will be used; rsFocus - the setting will be read from the transient focus settings file, no layering will be used; rsNoTransient - the transient settings files will be ignored and the setting will be read from the user settings file layered over the shared settings file. Note that this parameter is ignored if the FileType parameter is FT_MODULE_INI, FT_JSI, FT_SHARED_DEFAULT_JCF, or FT_SHARED_CURRENT_JCF. If this parameter is not specified the default value of rsStandardLayering will be used.

Category Files

function IniReadSectionKeys

Description Retrieves the keys from a section in an ini style file. An ini style file is a file containing sections of keys with their values.

Returns String The key names from the given section as a list of strings delimited by the " " character. If there no keys, an empty string is returned.

Param String/strSection The name of the section containing the desired key value. This value must either be a variable or contained in quotes.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will read the file from the User, or if not found then shared, Settings directory.

Category Files

function IniReadSectionKeysEx

Description Retrieves the keys from a section in an ini style file. An ini style file is a file containing sections of keys with their values.

Returns String The key names from the given section as a list of strings delimited by the " " character. If there no keys, an empty string is returned.

Param String/strSection The name of the section containing the desired key value. This value must either be a variable or contained in quotes.

Param Int/iLocationCode Determines the directory where the file is located.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will read the file from the \Settings directory.

Category Files

function IniReadSectionNames

Description Retrieves the section names from an ini style file. An ini style file is a file containing sections of keys with their values.

Returns String The section names as a list of strings delimited by the " " character. If there no sections, a empty string is returned.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will read the file from the User, or if not found then shared, Settings directory.

Category Files

function IniReadSectionNamesEx

Description Retrieves the section names from an ini style file. An ini style file is a file containing sections of keys with their values.

Returns String The section names as a list of strings delimited by the " " character. If there no sections, a empty string is returned.

Param Int/iLocationCode Determines the directory where the file is located.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will read the file from the \Settings directory.

Category Files

function IniReadString

Description Reads a string value from an ini style file. An ini style file is a file containing sections of keys with their values.

Returns String The retrieved value or the default value if the key does not exist in the given section.

Param String/strSection The name of the section containing the desired key value. This value must either be a variable or contained in quotes.

Param String/strKey The name of the key whose value is to be retrieved. This value must either be a variable or contained in quotes.

Param String/strDefault The value that will be returned if the key cannot be retrieved. This value must either be a variable or contained in quotes.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will read the file from the User, or if not found then shared, Settings directory.

Optional

Param int/ReadSource One of the ReadSource (rs) constants defined in HJConst.JSH. The possible values are as follows: rsStandardLayering - causes standard layering behavior to be used, the setting will be read from the transient focus file first, then the transient session file, then the user settings file, and finally the shared settings file, stopping at the first file in which the desired setting is found; rsSession - the setting will be read from the transient session settings file, no layering will be used; rsFocus - the setting will be read from the transient focus settings file, no layering will be used; rsNoTransient - the transient settings files will be ignored and the setting will be read from the user settings file layered over the shared settings file. Note that this parameter is ignored if the FileType parameter is FT_MODULE_INI, FT_JSI, FT_SHARED_DEFAULT_JCF, or FT_SHARED_CURRENT_JCF. If this parameter is not specified the default value of rsStandardLayering will be used.

Category Files

function IniReadStringEx

Description Reads a string value from an ini style file. An ini style file is a file containing sections of keys with their values.

Returns String The retrieved value or the default value if the key does not exist in the given section.

Param String/strSection The name of the section containing the desired key value. This value must either be a variable or contained in quotes.

Param String/strKey The name of the key whose value is to be retrieved. This value must either be a variable or contained in quotes.

Param String/strDefault The value that will be returned if the key cannot be retrieved. This value must either be a variable or contained in quotes.

Param Int/iLocationCode Determines the directory where the file is located.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will read the file from the \Settings directory.

Optional

Param int/ReadSource One of the ReadSource (rs) constants defined in HJConst.JSH. The possible values are as follows: rsStandardLayering - causes standard layering behavior to be used, the setting will be read from the transient focus file first, then the transient session file, then the user settings file, and finally the shared settings file, stopping at the first file in which the desired setting is found; rsSession - the setting will be read from the transient session settings file, no layering will be used; rsFocus - the setting will be read from the transient focus settings file, no layering will be used; rsNoTransient - the transient settings files will be ignored and the setting will be read from the user settings file layered over the shared settings file. Note that this parameter is ignored if the FileType parameter is FT_MODULE_INI, FT_JSI, FT_SHARED_DEFAULT_JCF, or FT_SHARED_CURRENT_JCF. If this parameter is not specified the default value of rsStandardLayering will be used.

Category Files

function IniRemoveKey

Description Removes a key and its value from an ini style file. An ini style file is a file containing sections of keys with their values.

Returns Int TRUE if the key is successfully removed, otherwise FALSE.

Param String/strSection The name of the section from which the key and its value will be removed. This value must either be a variable or contained in quotes.

Param String/strKey The name of the key that will be removed. This value must either be a variable or contained in quotes.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will write the file under the \Settings directory.

Optional

Param Int/bFlush Optional parameter. Starting with JAWS 6.2, this flag must be set to true to flush write immediately to disk. True will flush the current write and all previous writes specified for the file indicated by strFile. Flushing will be slower. Not flushing will allow the write function to return quicker, but new data may not be available for subsequent read functions. Not supplying this parameter will behave as if set to true.

Category Files

function IniRemoveKeyEx

Description Removes a key and its value from an ini style file. An ini style file is a file containing sections of keys with their values.

Returns Int TRUE if the key is successfully removed, otherwise FALSE.

Param String/strSection The name of the section from which the key and its value will be removed. This value must either be a variable or contained in quotes.

Param String/strKey The name of the key that will be removed. This value must either be a variable or contained in quotes.

Param Int/iLocationCode Determines the directory where the file is located.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will write the file under the \Settings directory.

Category Files

function IniRemoveSection

Description Removes an entire section an ini style file. An ini style file is a file containing sections of keys with their values.

Returns Int TRUE if the section is successfully removed, otherwise FALSE.

Param String/strSection The name of the section that will be removed. This value must either be a variable or contained in quotes.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will write the file under the \Settings directory.

Optional

Param Int/bFlush Optional parameter. Starting with JAWS 6.2, this flag must be set to true to flush write immediately to disk. True will flush the current write and all previous writes specified for the file indicated by strFile. Flushing will be slower. Not flushing will allow the write function to return quicker, but new data may not be available for subsequent read functions. Not supplying this parameter will behave as if set to true.

Category Files

function IniRemoveSectionEx

Description Removes an entire section an ini style file. An ini style file is a file containing sections of keys with their values.

Returns Int TRUE if the section is successfully removed, otherwise FALSE.

Param String/strSection The name of the section that will be removed. This value must either be a variable or contained in quotes.

Param Int/iLocationCode Determines the directory where the file is located.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will write the file under the \Settings directory.

Category Files

function IniWriteInteger

Description Writes an integer value to an ini style file. An ini style file is a file containing sections of keys with their values.

Returns Int The total number of characters written to the file when the write is successful. False if the value is not written successfully. If the file, section, or key does not already exist, it will be created.

Param String/strSection The name of the section where the key and value will be written. This value must either be a variable or contained in quotes.

Param String/strKey The name of the key that will hold the value. This value must either be a variable or contained in quotes.

Param Int/nValue The value that will be written to the given key.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will write the file under the \Settings directory.

Optional

Param Int/bFlush Optional parameter. Starting with JAWS 6.0, this flag must be set to true to flush write immediately to disk. True will flush the current write and all previous writes specified for the file indicated by strFile. Flushing will be slower. Not flushing will allow the write function to return quicker, but new data may not be available for subsequent read functions. Not supplying this parameter will behave as if set to true.

Param int/WriteDestination One of the WriteDestination (wd) constants defined in HJConst.JSH. The possible values are as follows: wdUser - indicates that the setting should be saved to the user settings file; wdSession - indicates that the setting should be saved to the transient session settings file; wdFocus - indicates that the setting should be saved to the transient focus settings file. Note that this parameter is ignored if the FileType parameter is FT_JSI. If this parameter is not specified the default value of wdUser will be used.

Category Files

function IniWriteIntegerEx

Description Writes an integer value to an ini style file. An ini style file is a file containing sections of keys with their values.

Returns Int TRUE if the value is successfully written. If the file, section, or key does not already exist, it will be created.

Param String/strSection The name of the section where the key and value will be written. This value must either be a variable or contained in quotes.

Param String/strKey The name of the key that will hold the value. This value must either be a variable or contained in quotes.

Param Int/nValue The value that will be written to the given key.

Param Int/iLocationCode Determines the directory where the file is located.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will write the file under the \Settings directory.

Optional

Param Int/bFlush Optional parameter. Starting with JAWS 6.0, this flag must be set to true to flush write immediately to disk. True will flush the current write and all previous writes specified for the file indicated by strFile. Flushing will be slower. Not flushing will allow the write function to return quicker, but new data may not be available for subsequent read functions. Not supplying this parameter will behave as if set to true.

Param int/WriteDestination One of the WriteDestination (wd) constants defined in HJConst.JSH. The possible values are as follows: wdUser - indicates that the setting should be saved to the user settings file; wdSession - indicates that the setting should be saved to the transient session settings file; wdFocus - indicates that the setting should be saved to the transient focus settings file. Note that this parameter is ignored if the FileType parameter is FT_JSI. If this parameter is not specified the default value of wdUser will be used.

Category Files

function IniWriteString

Description Writes a string value to an ini style file. An ini style file is a file containing sections of keys with their values.

Returns Int The total number of characters written to the file when the write is successful. False if the value is not written successfully. If the file, section, or key does not already exist, it will be created.

Param String/strSection The name of the section where the key and value will be written. This value must either be a variable or contained in quotes.

Param String/strKey The name of the key that will hold the value. This value must either be a variable or contained in quotes.

Param String/strValue The value that will be written to the given key. This value must either be a variable or contained in quotes.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will write the file under the \Settings directory.

Optional

Param Int/bFlush Optional parameter. Starting with JAWS 6.0, this flag must be set to true to flush write immediately to disk. True will flush the current write and all previous writes specified for the file indicated by strFile. Flushing will be slower. Not flushing will allow the write function to return quicker, but new data may not be available for subsequent read functions. Not supplying this parameter will behave as if set to true.

Param int/WriteDestination One of the WriteDestination (wd) constants defined in HJConst.JSH. The possible values are as follows: wdUser - indicates that the setting should be saved to the user settings file; wdSession - indicates that the setting should be saved to the transient session settings file; wdFocus - indicates that the setting should be saved to the transient focus settings file. Note that this parameter is ignored if the FileType parameter is FT_JSI. If this parameter is not specified the default value of wdUser will be used.

Category Files

function IniWriteStringEx

Description Writes a string value to an ini style file. An ini style file is a file containing sections of keys with their values.

Returns Int TRUE if the value is successfully written. If the file, section, or key does not already exist, it will be created.

Param String/strSection The name of the section where the key and value will be written. This value must either be a variable or contained in quotes.

Param String/strKey The name of the key that will hold the value. This value must either be a variable or contained in quotes.

Param String/strValue The value that will be written to the given key. This value must either be a variable or contained in quotes.

Param Int/iLocationCode Determines the directory where the file is located.

Param String/strFile The path to the ini style file. This value must either be a variable or contained in quotes. If a directory is not specified, it will write the file under the \Settings directory.

Optional

Param Int/bFlush Optional parameter. Starting with JAWS 6.0, this flag must be set to true to flush write immediately to disk. True will flush the current write and all previous writes specified for the file indicated by strFile. Flushing will be slower. Not flushing will allow the write function to return quicker, but new data may not be available for subsequent read functions. Not supplying this parameter will behave as if set to true.

Param int/WriteDestination One of the WriteDestination (wd) constants defined in HJConst.JSH. The possible values are as follows: wdUser - indicates that the setting should be saved to the user settings file; wdSession - indicates that the setting should be saved to the transient session settings file; wdFocus - indicates that the setting should be saved to the transient focus settings file. Note that this parameter is ignored if the FileType parameter is FT_JSI. If this parameter is not specified the default value of wdUser will be used.

Category Files

function InList

Synopsis determines whether the active cursor is within a List.

Description Note this function is currently only implemented to return TRUE in an HTML list.

Returns Int True if in a list, false otherwise.

Category HTML

function InputBox

Synopsis Displays a dialog box containing an edit field in which you can enter information.

Description This function displays a simple dialog box containing four controls. One control is an edit box in which you can enter information. Another control is a Static Text window containing the prompt of the edit box. The other two controls are the OK and Cancel buttons. If you enter text into the Edit box and press the OK button, the text you typed in the Edit box is returned to the calling function by way of the third variable of the function, which is a string variable that is passed by reference to the calling function.

Returns Int Returns 1 if the OK button was pressed. Returns 0 if the cancel button was pressed.

Param String/strMsg The text of the message that you would like to be displayed in the prompt of the Edit Box.

Param String/strTitle The text of the Dialog Box's title.

Param String/strInputText/ByRef This parameter is passed to the calling funcction or script by reference. If you type text in the Edit box and press the OK button, this parameter returns the text that you typed to JFW. If you do not enter text into the Edit box or you press the Cancel button, this parameter contains a NULL string,

Category User Interaction

function InsertCustomNodesInBranch

Description Inserts a node list at the beginning of the list of nodes under the branch.

Returns string The branch with the new nodes inserted at the beginning of the list of nodes under the branch name.

Param string/sBranch The branch into which you want to insert a node list.

Param string/sNewNodes The new nodes which you want to inserts. The Node list must be in the form node pipe node pipe . . . node pipe.

Category User Options

function InTable

Description Determines whether or not the active cursor is inside of a table.

Returns Int TRUE if in a table, FALSE otherwise.

Category Tables

function inTableCell

Description Returns TRUE if the cursor is in a table cel (as opposed to being anywhere in a table, e.g. the start or end string).

Returns int TRUE or FALSE.

Category Tables

function IntToPaddedString

Description pads an integer with zeros for the given width.

Returns string the padded string

Param int/val the number to pad

Param int/width the width to pad

Category Strings

function IntToString

Description Converts an integer value to a string and returns the string value.

Returns String The newly created string.

Param Int The number to be converted to a string.

Category Strings

function InvalidateCachedCursor

Description Invalidates the cached cursor to force a new cursor to be created. This affects the application's internal state and does not need to be called from the scripts.

Category Optical Character Recognition

function InvalidateRect

Synopsis The InvalidateRect function adds a rectangle to the specified window's update region.

Description The InvalidateRect function adds a rectangle to the specified window's update region. The update region represents the portion of the window's client area that must be redrawn.

Returns int If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.

Param handle/hwnd of window.

Param int/nLeft Rectangle left.

Param int/nTop Rectangle top.

Param int/nRight Rectangle right.

Param int/nBottom Rectangle bottom.

Category Window

function InvisibleCursor

Description Activates the Invisible cursor and deactivates other cursors. The mouse pointer does not move along with the Invisible cursor. The Invisible cursor can be used in situations where movements of the JAWS cursor and mouse pointer can cause the window display to change.

Optional

Param int/AllowScanCursor If true, allows activation of the Invisible Scan cursor; otherwise, the OSM Invisible cursor will be activated.

Category Cursors

function inWebDialog

Description determines if the virtual cursor is within a web dialog. Note that physical focus may or may not be in the dialog since the virtual cursor may roam away from the focus.

Returns int true or false.

Category html

function IsBrailleCursor

Description Determines whether the Braille cursor is active. It can be used in an If...Then...Else...statement to verify the active status of a cursor.

Returns Int "ACTIVE" = 1, "INACTIVE" = 0.

Category Cursors

function IsBrailleViewerEnabled

Description Determines if the Braille Viewer is enabled.

Returns int TRUE if the viewer is enabled, FALSE if disabled.

Category Braille and Text Viewer

function IsContractedBrailleInputSupported

Description Returns TRUE or FALSE whether the control with focus supports Contracted Braille input in JAWS. Use ContractedBrailleInputAllowedNow function in the scripts to return control whether or not contracted input support should be allowable.

Returns int TRUE or FALSE whether or not contracted input is supported in JAWS

Category Braille Keyboard

function IsFlexibleWebEnabled

Description Used to test if flexible web is enabled.

Returns int True if on, false if off.

Category HTML Flexible Web

function IsFormsModeActive

Synopsis Tests to see if Forms Mode is active.

Description Checks to determine if Forms Mode is active within the window containing the active cursor.

Returns Int TRUE if the Forms Mode is active, FALSE otherwise.

Category Cursors

function IsInsideARIAApplication

Description Used to determine if the virtual PC cursor is inside an ARIA application on a web page. An ARIA application is generated by the role="application" attribute on an HTML element.

Returns Int 1 (True) or 0 (false).

Category Cursors

function IsInvisibleCursor

Description Used to determine whether the invisible cursor is active. It can be used in an If...Then...Else...statement to verify the active status of a cursor.

Returns Int "ACTIVE" = 1, "INACTIVE" = 0.

Category Cursors

function IsInvisibleUIACursor

Description Determines whether the active cursor is the invisible UIA cursor, otherwise known as the Invisible Scan cursor. This can be used, if necessary, to determine if the currently active cursor is the UIA version of the invisible cursor.

Returns int True if the active cursor is the Invisible Scan cursor, false otherwise.

Category Cursors

function IsJAWSCursor

Description Determines whether the JAWS cursor is active. It can be used in an If...Then...Else...statement to verify the active status of a cursor.

Returns Int "ACTIVE" = 1, "INACTIVE" = 0.

Category Cursors

function IsJawsUIACursor

Description Determines whether the active cursor is the JAWS UIA cursor, otherwise known as the JAWS Scan cursor. This can be used, if necessary, to determine if the currently active cursor is the UIA version of the JAWS cursor.

Returns int True if the active cursor is the JAWS Scan cursor, false otherwise.

Category Cursors

function IsJFWInstall

Description Checks to see if JFW is running in Installation mode (with the /install flag).

Returns Int TRUE if in install mode, FALSE otherwise.

Category JAWS Program

function IsKeyboardAttached

Description Determines if a keyboard is attached.

Returns int True if a keyboard is attached to the device, false otherwise.

Category Keyboard

function IsKeystrokeReservedByApp

Description Determines if the supplied keystroke has been reserved by the currently active web application. The keystroke is a single letter or shift + letter combination.

Returns int TRUE if the supplied keystroke is reserved by the currently active web application, FALSE otherwise.

Param string/KeyName The string name for the key to be checked, usually a single letter or the text "shift + " followed by the letter.

Category Keyboard

function IsKeyWaiting

Description Indicates if there are other keys in the buffer that need to be processed.

Returns Int Returns TRUE if there is a key waiting to be processed, otherwise, returns FALSE.

Category Keyboard

function IsLastKeyRepeating

Synopsis Determines if the last key is still being held down.

Description This function is useful if you need to avoid running a script until the last key has actually been released . This is particularly important if the script calls into an application's object model and thus would take a long time to complete., slowing response time down.

Returns Int True the keystroke has repeated, false means it has not repeated.

Category Keyboard

function IsLeftButtonDown

Description Checks to see if the left mouse button is locked down.

Returns Int TRUE if left button is locked, FALSE otherwise.

Category Mouse

function IsMetroApp

Description Determines if the current application is a Universal, Modern or Metro app. (They're all different names for the same thing.)

Returns int True if it's a Universal app, false otherwise.

Category system

function IsMSAAWindow

Description Indicates whether or not JAWS is using MSAA to gather information about the contents of this window.

Returns Int TRUE if MSAA is used for this window, FALSE otherwise.

Param Handle/hWnd The window to check

Category Object Model And MSAA

function IsMultiPageDialog

Description Checks to see if the active cursor is positioned inside a multi-page dialog box.

Returns Int TRUE if this is a multipage dialog, FALSE otherwise.

Category Dialogs

function IsNotificationManagerEnabled

Description Tests whether or not Notification Manager is enabled.

Returns int True if Notification Manager is enabled, false otherwise.

Category Notification Manager

function IsOBUtil

Description Determines whether the script context pertains to OpenBook's OBUtil. It can be used in an If...Then...Else...statement for verification.

Returns Int "ACTIVE" = 1, "INACTIVE" = 0.

Category JAWS Program

function IsPCCursor

Description Determines whether the PC cursor is active. It can be used in an If...Then...Else...statement to verify the active status of a cursor.

Returns Int "ACTIVE" = 1, "INACTIVE" = 0.

Category Cursors

function IsRemoteAccessClientEnabled

Description Determines whether the Freedom Scientific Remote Access Client component is installed. The Remote Access Client component is typically enabled during product installation. When the component is enabled, %product% is able to recieve speech and Braille through a Citrix or Remote Desktop client session.

Returns Int TRUE if the component is installed, FALSE otherwise.

Category System

function IsRemoteAccessServerEnabled

Description Determines whether the Freedom Scientific Remote Access Server component is installed. The Remote Access Server component is typically enabled during product installation. When the component is enabled, %product% is able to run in a Remote Desktop or Citrix session.

Returns Int TRUE if the component is installed, FALSE otherwise.

Category System

function IsRightButtonDown

Description Checks to see if the right mouse button is locked down.

Returns Int TRUE if right button is locked, FALSE otherwise.

Category Mouse

function IsRtlChar

Synopsis Determines if a character is a Right to Left reading character.

Description Determines if a character is a Right to Left reading character.

Returns int true if the character is a Right to Left reading character, false otherwise.

Param string The character to be tested.

Category Text Format

function IsRTLLanguageProcessorLoaded

Description Used to detect if a Right to Left aware language processor is loaded.

Returns Int True if RTL language processor is loaded, false otherwise.

Category Misc

function IsRtlReading

Synopsis Determines if the text in the supplied window reads from right to left.

Description This function Determines if the text in the supplied window reads from right to left.

Returns int true if the window contains text which reads right to left, false otherwise.

Param handle The handle of the window to test for Right to Left reading.

Category Text Format

function IsSameKey

Description Physical keys on the keyboard can have more than one name or alias. This function determines whether two key names are referring to the same physical key.

Returns Int TRUE if both keys refer to the same physical key.

Param String/strKey1 The name of the first key.

Param String/strKey2 The name of the second key.

Category Keyboard

function IsSameScript

Description Determines if the current script has been called two or more times in a row without any intervening scripts being called and with no more than 500 milliseconds between each call. Using this function allows a script to act differently depending upon the number of consecutive times it has been called. A script is called whenever a key assigned to it has been pressed.

Returns Int The number of times the script has repeated, 0 means it has not repeated.

Category Scripts

function IsScanCursorClass

Description Tests if the supplied class name is recognized as one which is valid for the JAWS Scan or Invisible Scan cursor. The GenericUIAClasses section in the JCF file specifies class names which are used to allow scan cursor versions of the review cursors.

Returns int True if the supplied class name is valid for scan cursor activation, false otherwise.

Param string/ClassName The window class name to test. To be a valid class name for the scan cursors, the supplied class name must start with one of the class names listed as valid in the GenericUIAClasses section of the JCF file.

Category Window

function IsScriptingEditionAuthorized

Description Determines whether or not the Script Edition option is enabled.

Returns Int TRUE if the Scripting Edition option is enabled, FALSE otherwise.

Category MAGic

function IsScriptKey

Description Determines if a key is asigned to a script.

Returns int True if the passed string is the name of a key assigned to a script, false otherwise.

Param string The name of a key, including any modifiers. See the JKM files for examples of key names.

Category Scripts

function IsSecondaryFocusActive

Description Tests whether a secondary focus is active. A list of suggestions which appears for the primary focus is an example of a secondary focus.

Returns int True if a secondary focus is active, false otherwise.

Category Secondary Focus Events and Helpers

function IsSecureDesktop

Synopsis Determines if the current desktop is a secure desktop.

Description Secure desktops encompass UAC, Lock Screen, and Login Screen desktops. This function determines whether any of these desktops are active.

Returns int True if the current desktop is a secure desktop, false otherwise.

Category System

function IsSpeechOff

Description Used to determine if the synthesizer is muted.

Returns Int TRUE if the synthesizer is muted. False if the synthesizer is not muted.

Category Voices

function IsTandemInstalled

Description Checks to determine if the Tandem feature is installed.

Returns int Returns one if the Tandem feature is installed, zero otherwise.

Category Connection

function IsTextViewerEnabled

Description Determines if the Text Viewer is enabled.

Returns int TRUE if the viewer is enabled, FALSE if disabled.

Category Braille and Text Viewer

function IsTouchCapable

Description Determines if the current device is capable of supporting JAWS touch input.

Returns int True if JAWS is running on a device capable of supporting JAWS touch input, false otherwise.

Category Scripts

function IsUIAReviewCursor

Description Determines whether the active cursor is the JAWS or invisible cursor supported by UIA, otherwise known as the JAWS Scan cursor or Invisible Scan cursor.

Returns int True if the active cursor is either the JAWS Scan cursor or Invisible Scan cursor, false otherwise.

Category Cursors

function IsUnicodeJAWS

Synopsis determines if the build of JAWS is Unicode or ANSI.

Description This function determines if the build of JAWS is Unicode or ANSI.

Returns int TRUE if JAWS is a Unicode build, FALSE otherwise.

Category JAWS Program

function IsVirtualCursorOnAnnotationString

Description This function determines if the virtual cursor is on a start or end string of a table, list, region, object, or any text aded by JAWS as an annotation to the virtual buffer.

Returns int true or false.

Category HTML

function IsVirtualDocumentViewRestricted

Description Determines if the current virtual document has been restricted to a web dialog.

Returns int true or false.

Category html

function IsVirtualPCCursor

Synopsis Tests to see if the Virtual PC cursor is enabled.

Description Checks to see if the Virtual PC cursor is being used to navigate within the window with focus.

Returns Int TRUE if the Virtual PC cursor is active, FALSE otherwise.

Category Cursors

function IsVisperoConnectEnabledForSite

Description Tests whether Vispero Connect is enabled for a site, and retrieves the connected link used to send feedback if it is enabled.

Returns int True if Vispero connect is enabled for the site, false otherwise.

Param string The URL to test whether Vispero Connect is enabled for the site.

Param string/byRef The link which is used by Vispero Connect to send feedback about the site.

Category HTML

function IsWindowDisabled

Description Checks the status of the current window or control. Returns FALSE if the window is active; TRUE if the window is disabled.

Returns Int TRUE if window is disabled, FALSE otherwise.

Param Handle Handle of window to check. This can be obtained through the GetFocus or GetCurrentWindow functions.

Category Window

function IsWindowObscured

Description Checks to see if this window is covered by any others and therefore cannot be entirely seen.

Returns Int TRUE if window is at least partially covered, FALSE otherwise.

Param Handle Handle of window to check. This can be obtained through the GetFocus or GetCurrentWindow functions.

Category Window

function IsWindows10

Synopsis Determines if the current operating system is Windows 10 or above.

Description This function returns true if the OS in use is Windows 10 or above.

Returns Int true or false.

Category System

function IsWindows11

Synopsis Determines if the current operating system is Windows 11 or above.

Description This function returns true if the OS in use is Windows 11 or above.

Returns Int true or false.

Category System

function IsWindows7

Synopsis Determines if the current operating system is Windows 7 or above.

Description This function returns true if the OS in use is Windows 7 or above.

Returns Int true or false.

Category System

function IsWindows8

Synopsis Determines if the current operating system is Windows 8 or above.

Description This function returns true if the OS in use is Windows 8 or above.

Returns Int true or false.

Category System

function IsWindowVisible

Description Checks the visual status of the window. This function will return true even if the window is completely covered by other windows. See function IsWindowObscured for a way to find out if a particular window is covered. Returns TRUE if the Window is visible on the screen, FALSE if the window is not visible on the screen.

Returns Int TRUE if window on screen, FALSE otherwise.

Param Handle Handle of window to check. This can be obtained through the GetFocus or GetCurrentWindow functions.

Category Window

function IsWinNtOr95

Synopsis Distinguishes between Windows NT and 95 and Windows 98/2k.

Description This function returns true if the OS in use is either Windows 95 or Windows NT 4.0.

Returns Int true or false.

Category System

function IsWinVista

Synopsis Determines if the current operating system is Windows Vista.

Description This function returns true if the OS in use is Windows Vista.

Returns Int true or false.

Category System

function IsZoomTextReaderEnabled

Description Determines if the Reader feature is currently enabled in ZoomText.

Returns int true or false.

Category FS Product Info

function IterateLookupModules

Description Retrieves all active lookup modules and rule set combinations. Both lists are delimited by the constant LIST_ITEM_SEPARATER, found in hjConst.jsh

Returns int the number of items in the lists

Param string/byRef/szModuleNames string to receive the list of lookup modules. This may contain duplicate entries, as more than one rule set would correspond to the same lookup module. Just use iteration to walk through this bell-char-delimited list.

Param string/byRef/szRuleSets The delimited list of rule sets corresponding to the list of modules.

Param String/ByRef/szPrimary The Primary lookup module defined in Default.jcf file.

Category Research It

function JavaObjectChanged

Synopsis Event fired when a Java object changes name, value or description.

Description Since The Java UI does not lend itself to easy scripting like other UI elements this event has been created to monitor in particular, other non-focusable object changes so that these changes may be conveyed to the user.

Returns Void

Param String/lpszRole Java role of object generating change notification.

Param String/lpszName AccessibleContextInfo name.

Param String/lpszDescription AccessibleContextInfo description.

Param String/lpszValue AccessibleValue

Param String/lpszStates string of all states applicable to the object.

Category HTML Events

function JAWSBottomOfFile

Synopsis Moves to bottom of file.

Description Performs standard behavior of the control + end keystroke combination. In most cases, moves the focus to the bottom of the open file, list or document.

Category Navigation

function JAWSCursor

Description This activates the JAWS cursor and deactivates other cursors.

Optional

Param int/AllowScanCursor If true, allows activation of the JAWS Scan cursor; otherwise, the OSM JAWS cursor will be activated.

Category Cursors

function JAWSEnd

Description This performs a special version of the END keyboard command. When the PC cursor is active, the script function performs the home function for the application. When other cursors are active, the cursor moves to the last text character or graphic on the line within either the active application window or active child window (depending on the setting for cursor restriction).

Category Navigation

function JAWSFind

Description Finds text on the screen by presenting a dialog for input of text, direction, and choice to search for graphic or text.

Returns Int True if the search item was found, false otherwise.

Optional

Param int True if the find direction should be set to reverse by default, false otherwise.

Category Screen Text

function JAWSFindNext

Description Finds text on the screen after a successful initial find search.

Returns Int TRUE if successful, FALSE if not.

Optional

Param Int/bReverse set this to true to find the prior occurance.

Category Screen Text

function JAWSHome

Description This performs a special version of the HOME keyboard command. When the PC cursor is active, the script function performs the home function for the application. When other cursors are active, the cursor moves to the first text character or graphics on the line within either the active application window or child window (depending on the setting for cursor restriction).

Category Navigation

function JAWSPageDown

Description This performs a special version of the PAGE DOWN keyboard command. When the PC cursor is active, the script function performs the standard Page Down function for the application. When other cursors are active, the cursor moves to the bottom of the active application window or to the bottom of the active child window, depending on the setting for JAWS cursor restriction.

Category Navigation

function JAWSPageUp

Description This performs a special version of the PAGE UP keyboard command. When the PC cursor is active, the script function performs the standard PAGE UP command for the application. When other cursors are active, the cursor moves to the top of the active application window or to the top of the active child window (depending on the setting for JAWS cursor restriction).

Category Navigation

function JAWSTopOfFile

Synopsis Moves to top of file.

Description Performs standard behavior of the control + home keystroke combination. In most cases, moves the focus to the top of the open file, list or document.

Category Navigation

function JAWSVerbosityCore

Synopsis Helper to the AdjustJAWSVerbosity script.

Description Use in your own AdjustJAWSVerbosity script and pass your own delimited string in the format shown in common.jsm represented by the constant cStrDefaultList. Hj Dialogs, muted synthesizers and Virtual Cursor are all handled automatically. Just pass your list of items for your convenience.

Param String/sCustomItems Your specific list of items to go at the top of the AdjustJAWSVerbosity list.

Category Settings

function JAWSWindow

Description This switches the focus away from the current application and makes JAWS the active application. This is equivalent to choosing JAWS from the Windows taskbar.

Category JAWS Program

function KeyboardHelp_LaunchWindowsShortcut

Description keyboard help for Windows Shortcut.

Returns string the shortcut text

Param string The fully qualified path of a windows shortcut.

Category system

function KeyboardHelp_WindowsCmd

Description keyboard help for Windows Shortcut.

Returns string the command text

Param string The windows command number.

Category system

function LanguageDetectChange

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function LastCell

Description When inside a table or spreadsheet, moves the active cursor to the last cell.

Returns Int TRUE if the cursor moved, FALSE otherwise.

Category Tables

function LaunchCommandsSearchViewer

Description Launches JAWS Search for the window of interest or the focused window. JAWS Search provides the user with a way to search JAWS commands to find that forgotten keystroke or command.

Optional

Param handle The window for the application whose configuration to use for JAWS Search. If no window is supplied, the focused window is used, using the currently loaded JAWS configuration.

Category Settings

function LaunchQuickSettings

Synopsis Launches the QuickSettings dialog.

Description Launches the QuickSettings dialog. The QuickSettings dialog uses the xml described in the application and default qs and qsm files.

Category Settings

function LaunchShortcut

Description Invokes an Windows Shortcut.

Param string The fully qualified path of a windows shortcut.

Category system

function LeftMouseButton

Description Used to simulate the clicking of the left button on a mouse. If the function is assigned to a script key and is pressed twice within one second, then this simulates a double click of the mouse button.

Category Mouse

function LeftMouseButtonLock

Description Attaches the mouse pointer to an object so that the object can be dragged to a new location. This is equivalent to holding down the left mouse button and moving the mouse. The first use of the function attaches the JAWS cursor and the mouse pointer to the object. The object is moved with the arrow keys, and is dropped at the new location by using the function again.

Returns Int "POINTER_ATTACHED" =1, "POINTER_DETACHED" = 0.

Category Mouse

function LevenshteinDistance

Description Computes the LevenshteinDistance between two strings. This is the number of additions, deletions, and changes in order to transform string1 into string2.

Returns int the number of changes

Param string/string1 The first string

Param string/string2 The second string

Category Strings

function LoadKeymapSection

Description Loads a key map section from the key map file. The key map remains loaded until it is unloaded by calling UnloadKeymapSection, or until the configuration changes--whichever happens first.

Returns void

Param string The name of the key map section to load. The name must match a section in the JKM file, excluding the trailing portion of the section name that specifies the section as a key map. For example, "Custom" specifies the key map section called "[Custom Keys]" in the JKM file.

Category Keyboard

function LowWord

Description retrieves the low-order word from the specified value.

Returns Int The low-order word from the specified value.

Param Int/dwValue Specifies the value to be converted.

Category Number conversion

function LRL_Dialog

Description LRL_Dialog Displays the Research It dialog.

Returns int TRUE if the dialog is okayed; otherwise FALSE.

Param String/BYREF/strModuleName On okaying the dialog, strModuleName will be updated with the selected Research It module.

Param String/BYREF/strRuleSet On okaying the dialog, strRuleSet will be updated with the selected Research It rule set if one applies.

Param String/BYREF/strPhrase strPhrase is an IN/OUT parameter. When the dialog is displayed, the Word Or Phrase combo edit field is updated with the contents of this field. When the dialog is okayed, the strPhrase is updated with the contents of the combo edit.

Category Research It

function LRL_GetFirstLookupModule

Description LRL_GetFirstLookupModule is used to begin an iteration through the active lookup module/RuleSet combinations.

Returns int If the function succeeds, TRUE (1) is returned. Otherwise FALSE (0) is returned. If TRUE is returned, the return value can be passed to LRL_GetNextLookupModule to retrieve the next lookup module/rule set combination.

Param String/BYREF/strLookupModule A string that will receive the name of the first lookup module/rule set combination.

Param String/BYREF/strRuleSet A string that will receive the rule set name of the first lookup module/rule set combination. If there is no rule set, the string will be set to ",".

Category Research It

function LRL_GetNextLookupModule

Description LRL_GetNextLookupModule is used to continue an iteration through the active lookup module/RuleSet combinations.

Returns int If the function succeeds, TRUE (1) is returned. Otherwise FALSE (0) is returned.

Param String/BYREF/strLookupModule A string that will receive the name of the next lookup module/rule set combination.

Param String/BYREF/strRuleSet A string that will receive the rule set name of the next lookup module/rule set combination. If there is no rule set, the string will be set to ",".

Category Research It

function LRL_GetPrimaryLookupModule

Description The primary lookup module is the one designated to be used when the user single presses the LookupModuleInvoke keystroke. The PrimaryLookupModule key is stored in the JAWS Configuration File [options] section. The key may be application specific.

Returns int If the function succeeds, TRUE (1) is returned. Otherwise FALSE (0) is returned.

Param string/byRef/strLookupModule A string that will receive the name of the primary lookup module.

Param string/byRef/strRuleSet A string that will receive the rule set name of the primary lookup module. If there is no rule set, the string will be set to an empty string.

Category Research It

function LRL_Invoke

Description Invoke performs a request from a lookup module.

Returns int If the function succeeds, 0 is returned. Otherwise a non-zero value specifying the error is returned.

Param String/strModuleName A string that contains the name of the lookup module.

Param String/strRuleSet A string that contains the rule set specifier that the lookup module may use to perform the query. This string may be " ," if no rule set applies

Param String/strIn A string containing the input data for the query. This may be the word or phrase at the current cursor. This value may be " ," if the lookup module utilizes the Context and Offset arguments.

Param String/strContext A string containing context data for the query. For example, some lookup modules may utilize the sentence or paragraph containing the target word. This argument can be an empty string.

Param Int/nOffset The 0-based offset of the targeted word in lpszContext. -1 indicates no offset.

Param String/BYREF/strOut A string that will be populated with the returned text. If a non-zero error code is returned, strOut may be populated with additional error information.

Optional

Param String/strExtra A string that may be populated with custom formatted, lookup module specific information. For example, a translation lookup module may include information about the input and output locales for the translation. This string may be an empty string.

Category Research It

function lvGetColumnHeader

Synopsis Returns the column header for the specified listview column.

Description This function enables you to obtain the header for a given listview column.

Returns string

Param handle/ hwnd of listview.

Param int/nCol the column of the listview whose header you want.

Category Screen Text

function lvGetCRC

Synopsis Calculates a unique CRC for a listview.

Description This function is used for listview customization. This hex value corresponds to the [Listview Options] section's keys.

Returns string a unique hex string for a listview.

Param handle/hListview the handle to the listview.

Category Dialog Controls

function lvGetFocusItem

Description Retrieves the 1-based index of the item in a ListView which has focus. (Superceeded by GetCurrentItem.)

Returns Int index number of the focused item.

Param Handle The ListView window.

Category Dialog Controls

function lvGetGroupName

Description Retrieves the name of the grouping that contains an item in a listview.

Returns String The name of the group

Param Handle to the window containing a ListView.

Param Int 1-based index of the item in the ListView of interest.

Category Dialog Controls

function lvGetItemColumnRect

Description Gets the bounding rectangle of the item in specific column of listview or listcontrol.

Returns Int TRUE if the bounding rectangle is successfully retrieved.

Param Handle/hwnd The handle of the window for which the rectangle is requested.

Param Int/Index of column, starting at zero.

Param Int/nLeft The left edge of the bounding rectangle after the function is called.

Param Int/nRight The right edge of the bounding rectangle after the function is called.

Param Int/nTop The top edge of the bounding rectangle after the function is called.

Param Int/nBottom The bottom edge of the bounding rectangle after the function is called.

Category Window

function lvGetItemCount

Description Retrieves a count of items in a ListView. (Superceeded by GetItemCount.)

Returns Int the count of items.

Param Handle The ListView window

Category Dialog Controls

function lvGetItemRect

Description Gets the bounding rectangle of the specified item in a listview.

Returns Int TRUE if the bounding rectangle is successfully retrieved.

Param Handle/hwnd The handle of the ListView of interest.

Param Int/Item index of the item desired.

Param Int/nLeft The left edge of the bounding rectangle after the function is called.

Param Int/nRight The right edge of the bounding rectangle after the function is called.

Param Int/nTop The top edge of the bounding rectangle after the function is called.

Param Int/nBottom The bottom edge of the bounding rectangle after the function is called.

Category Dialog Controls

function lvGetItemState

Description Detects the current selection state of the item within a ListView. Refer to the return states for more information.

Returns Int LVIS_FOCUSED = 1. The item has the focus, so it is surrounded by a standard focus rectangle. Although more than one item may be selected, only one item can have the focus. LVIS_SELECTED = 2. The item is selected. The appearance of a selected item depends on whether it has the focus and also on the system colors used for selection. LVIS_CUT = 4. The item is marked for a cut-and-paste operation. LVIS_DROPHILITED = 8. The item is highlighted as a drag-and-drop target.

Param Handle/hwnd window handle of the List View.

Param Int/item 1-based index of the item.

Category Dialog Controls

function lvGetItemText

Description Retrieves the text of an item in a ListView. Does not work for Owner-Drawn items.

Returns String The contents of the requested item.

Param Handle to the window containing a ListView.

Param Int 1-based index of the item in the ListView of interest.

Param Int 1-based index of the column of interest (applies only to multicolumn ListViews).

Category Dialog Controls

function lvGetNumOfColumns

Description Gets the number of columns(if any) of a list control or listview.

Returns Int Number of columns in a list control or list view.

Param Handle/hwnd The handle of the list control or list view.

Category Window

function lvGetSelectionCount

Description Retrieves a count of the selected items in a ListView.

Returns Int the count of selected items.

Category Dialog Controls

function lvGetUserDefinedItemText

Synopsis Retrieves the customized text from a listview.

Description If a listview has been customized to speak or be Brailled in a particular manner, this function retrieves the text of the specified item as rendered by the customization.

Returns string the user selected column headers and column data.

Param handle/hListview the handle to the listview.

Param int/nItem a 1-based item whose text you want.

Optional

Param int/nTable use 0 for speech customization, 1 for Braille customization, if not present, assumes speech.

Category Dialog Controls

function lvIsCustomized

Synopsis Determines if the listview corresponding to the hwnd parameter has been customized for speech or Braille.

Description this function determines if the listview pointed to by the hwnd parameter has a speech or Braille customization defined for it, this includes whether there is a default customization defined as well. This function is used to determine whether or not SayHighlightedText should be used to speak a listview or whether custom code should be executed.

Returns int true or false.

Param handle/hListview the handle to the window.

Optional

Param int/nTable 0 for speech, 1 for Braille, if not present, defaults to speech.

Category Dialog Controls

function lvIsReportListStyle

Description Identifies the style of list control or list view.

Returns Int TRUE if style is Report or list, otherwise FALSE.

Param Handle/hwnd The handle of the list control or list view.

Category Window

function lvSelectItem

Description Select an item within the listview.

Returns Int True indicates that the item was selected successfully and FALSE indicates that the action failed.

Param Handle/hWnd Handle of list view.

Param Int/item 1-based index of the item.

Param Int/select 1 to select, 0 to unselect.

Category Dialog Controls

function lvSetFocusItem

Description Moves focus to a specified item in a ListView. Note that this does not bring the ListView window into focus, it simply causes a specific item within a ListView to be the focused item in that window. (Superceeded by SetCurrentItem.)

Returns Int TRUE if successful, FALSE otherwise.

Param Handle The window containing a ListView.

Param Int The 1-based index of the row in the ListView to receive focus.

Optional

Param Int/bClearAllStates TRUE-Clears focus and selection states of all items before setting focus. FALSE-leaves states untouched. Defaults to TRUE.

Category Dialog Controls

function MagGetMagnifiedRect

Description Gets the MAGic magnified rectangle

Returns Int TRUE if the magnified rectangle is successfully retrieved. FALSE otherwise.

Param Int/ByRef/nLeft The left edge of the magnified rectangle.

Param Int/ByRef/nTop The top edge of the magnified rectangle.

Param Int/ByRef/nRight The right edge of the magnified rectangle.

Param Int/ByRef/nBottom The bottom edge of the magnified rectangle.

Category MAGic

function MagGetMagnifiedView

Description Used to get current view mode in MAGic.

Returns Int One of the following constants from Magcodes.jsh: mv_Invalid, mv_Full, mv_Split, mv_Overlay, mv_Lens, or mv_Dynamic_Lens. A return value of mv_Invalid is used to indicate that an error occurred while requesting the information from MAGic.

Category MAGic

function MagGetOption

Synopsis Gets an option that is used by MAGic.

Description Options that can be retrieved are listed in MagCodes.jsh. Options are MID_ON, MID_LEVEL, MID_VIEW, LOC_ON, TID_ON, and SMOOTH_ON.

Returns Int -1 if the option value cannot be retrieved, otherwise the option value.

Param Int/nCode the code of the option to be retrieved. Codes are listed in MagCodes.jsh.

Category MAGic

function MagSendKeyEvent

Synopsis Sends a key event to the MAGic UI for processing.

Description If a MAGic key event is attached to a key in a key map file, then you can use this function to send the key event on to the MAGic Interface. For example, when the key is pressed to toggle magnification, the KI_MAGONOFF needs to be passed on to the MAGic user interface for processing.

Returns Int If MAGic is not running, or nKICode is out of range, then the function will return FALSE. Otherwise, TRUE is returned.

Param Int/nKICode The code for the key event. These codes can be found in magcodes.jsh.

Optional

Param int/codeSecondary If applicable, a secondary parameter used with the key event code.

Category MAGic

function MagSetFocusToPoint

Description Causes MAGic to set focus to a given point. If the point is not visible, then the screen is panned to make the point visible.

Returns Int TRUE if MagSetFocusToPoint is successful.

Param Int/x Horizontal (x) coordinate of the point.

Param Int/y Vertical (y) coordinate of the point.

Category MAGic

function MagSetFocusToRect

Description Causes MAGic to set focus to a given rectangle. If any point in the rectangle is not visible on the screen, the screen is panned to make that point visible.

Param Int/nLeft The left edge of the rectangle.

Param Int/nRight The right edge of the rectangle.

Param Int/nTop The top edge of the rectangle.

Param Int/nBottom The bottom edge of the rectangle.

Optional

Param Int/nType The type of control that is being tracked. Can be MTO_MOUSE, MTO_GENERIC, MTO_CARET, MTO_MENUS, or MTO_DIALOG. If nType is set to MTO_GENERIC, then view will always shift to the rectangle unless tracking is turned off. These types, and this parameter, are not supported in MAGic 10 or later. Hence this parameter is optional.

Category MAGic

function MagSetMagnifiedView

Description Used to set current view mode in MAGic.

Returns Int TRUE if the mode was set.

Param Int/nArea The requested mode. Can be one of mv_Full, mv_Split, mv_Overlay, mv_Lens, or mv_Dynamic_Lens.

Category MAGic

function MagTrackingToggle

Description Toggles MAGic tracking ON and OFF. The MAGic interface is not updated when this function is used. When the function is used, it returns a constant value representing the new setting. ON means tracking on, and OFF means tracking off.

Returns Int "ON" = 1, "OFF" = 0.

Category MAGic

function MakeCharacterFromValue

Synopsis Returns the character whose numeric value is represented by the int parameter.

Description This function returns the character whose numeric value is represented by the int parameter.

Returns String that contain the single character whose numeric value is given.

Param Int the numeric value of the desired character.

Category Strings

function MakeLong

Description creates a LONG value by concatenating the specified values

Returns Int The return value is a LONG value.

Param Int/wLow Specifies the low-order word of the new value.

Param Int/wHigh Specifies the high-order word of the new value.

Category Number conversion

function Max

Description Returns the maximum between two integers. Useful when comparing variables.

Returns Int the maximum between two integers.

Param Int Type a variable of type int to be compared.

Param Int Type the second variable or integer to be compared.

Category Misc

function MenusActive

Description This determines whether a menu is currently active. It returns a constant value of ACTIVE to indicate a menu is active and a value of INACTIVE to indicate that it is not active. These constants can be used in If...Then...Else...statements.

Returns Int "ACTIVE" = 1, "INACTIVE" = 0.

Category Menus

function MessageBox

Description This is used to make a message box pop up on the desktop. It can be included within an If...Then...Else...statement so that when a certain event occurs, the needed message pops up.

Param string This parameter must be either a text string enclosed in quotes, a variable name that contains a string value, or a script function that returns a string value.

Category User Interaction

function Min

Description Returns the minimum between two integers. Useful when comparing variables.

Returns Int the minimum between two integers.

Param Int Type a variable of type int to be compared.

Param Int Type the second variable or integer to be compared.

Category Misc

function MinimizeAllApps

Description Minimizes all windows on the Win95/98 or NT desktop. Same as WINDOWS KEY + M.

Category Misc

function MouseDown

Description Moves the Mouse Down by the specified number of pixels.

Returns Int TRUE if successful, FALSE if already at bottom of screen.

Param Int Number of pixels to move.

Category Mouse

function MouseLeft

Description Moves the Mouse Left by the specified number of pixels.

Param Int Number of pixels to move.

Category Mouse

function MouseRight

Description Moves the Mouse Right by the specified number of pixels.

Returns Int TRUE if successful, FALSE if already at right of screen.

Param Int Number of pixels to move.

Category Mouse

function MouseUp

Description Moves the Mouse Up by the specified number of pixels.

Returns Int TRUE if successful, FALSE if already at top of screen.

Param Int Number of pixels to move.

Category Mouse

function MoveSliderPos

Description Moves the position of a slider control to a different value.

Param Handle/hWnd windows handle to the slider control that you want to change the value on.

Param Int/iValue the PERCENTAGE to increase from the present position too. Negative percentages decrease the slider control.

Category Dialog Controls

function MoveTo

Description Moves the active cursor to the specified location on the screen. The location is specified in the form of a pixel position, where the top left hand corner of the screen is the point (0,0) and any point to the right and/or down has a positive x and y value. It is wise to be careful when using this function. This is because the pixel position of items in an application vary widely, depending upon the screen resolution on the computer that is running the application and the restored or maximized state of the application. It is always best to obtain the parameters that this function requires by searching for a particular object or string of text in the application and using GetCursorCol and GetCursorRow to store its position information in variables. Pass those variables to the function rather than a set integer value.

Returns Int TRUE if move was successful, FALSE if one or both coordinates are off the edge of the screen.

Param Int X-coordinate.

Param Int Y-Coordinate.

Optional

Param Int/CoordinateSystem The Coordinate System to be used to interpret X and Y. The default is to interpret them as pixel locations on the screen. See the COORDSYS_xxx constants in hjconst.jsh.

Category Cursors

Description Moves to the first, last, next or prior link regardless of whether or not the link has been marked as visited.

Returns Int true if a link was found, false otherwise.

Param Int one of s_top, s_bottom, s_next or s_prior defined in hjconst.jsh.

Category HTML Navigation

function MoveToControl

Description Moves the active cursor to a specific control within a window. Although primarily useful inside dialog boxes, the function can be used in any window where child controls have unique identifiers obtained with GetControlID. It can also be used in SDM windows with the identifiers obtained using SDMGetFirstControl, SDMGetLastControl, SDMGetFocus, and so on. If the PC cursor is on when this function is called, the JAWS cursor is turned on automatically. Otherwise, the active cursor is used

Returns Int TRUE if successful, FALSE otherwise.

Param Handle Handle of window containing the control of interest.

Param Int ID of desired control.

Category Dialog Controls

function MoveToControlledTarget

Synopsis If the focused element on a webpage has an aria-controls target this moves to that element

Description If an element on a web page has an aria-controls relationship with another element on the page, this function will cause focus to be moved to that controlled target

Returns Int TRUE if the focus was moved to the target, FALSE otherwise.

Category HTML Navigation

function MoveToControlType

Synopsis Moves the cursor to the next, prior, first or last instance of the specified control type.

Description This function Moves the cursor to the next, prior, first or last instance of the specified control type.

Returns Int true or false.

Param Int/iSearchType one of S_TOP, S_BOTTOM, S_NEXT or S_PRIOR as defined in hjconst.jsh.

Param Int/iControlType One of the WT_ window type constants defined in hjconst.jsh.

Optional

Param int/ShouldSetFocus TRUE to set the application focus to this control, FALSE to just move the virtual cursor to it. This parameter is supported in JAWS 10.0 and later.

Category HTML Navigation

function MoveToDocumentOffset

Synopsis moves the virtual cursor to the specified document offset

Description This function is used by the SkimreadMoveToDocOffset function to move the virtual cursor to the location of the match selected from the skimread summary.

Returns int TRUE if the move was successful, FALSE otherwise.

Param int/nOffset The 0-based document offset.

Category Skim-Reading

function MoveToElementOfDifferentType

Synopsis Move the virtual cursor to the next or prior element different to the current.

Description This function will move the virtual cursor to the next or prior element different to the current. Pass in True to move in a reverse direction or nothing or false to move forward.

Returns Int true if the cursor was moved.

Optional

Param Int/bReverse true to go backward, false or leave blank to go forward.

Category HTML Navigation

function MoveToElementOfSameType

Synopsis Move the virtual cursor to an occurance of the current element.

Description This function will move the virtual cursor to another occurance of the same element. The parameter determines the direction of the move, valid direction constants are listed in hjconst.jsh and include s_top, s_bottom, s_next and s_prior. For example, if you are on the header of a list you can move to the next, prior, first or last list in the document.

Returns Int true if another element with the same tag was located, false otherwise.

Param Int/searchDirection one of s_top, s_bottom, s_next or s_prior as defined in hjconst.jsh.

Category HTML Navigation

function MoveToEmail

Description This function will move the cursor to the next email based on a regular expression search. If it can't find an email header, it returns false.

Returns int true if succeeded, false if not.

Param int/Direction the direction to move (forward or backward) Directions are S_ constants from HjConst.jsh, such as S_Next and s_Prior

Param String/ByRef/sentBy The function will fill in from who the email came

Param String/ByRef/sentAt the function will fill in the date the email was sent

Category html Navigation

function MoveToFormField

Synopsis Moves the virtual cursor to a form field.

Description Depending on the value of SearchOption, positions to the first, last, next, or prior form field on the current web page.

Returns Int TRUE if a form field was found, FALSE otherwise.

Param Int/SearchOption one of S_TOP, S_BOTTOM, S_NEXT, or S_PRIOR to move to the first, last, next or prior form field respectively.

Category HTML Navigation

function MoveToFormFieldByIndex

Synopsis Moves to a particular form field by index.

Description This function moves to a specified form field on a webpage. Specify the 1-based index of the form field to move to. This is primarily used with the GetListOfFormFields function which returns a delimited string containing the prompt, type and text of all formfields.

Returns Int true if the virtual cursor was moved to a form field, false otherwise.

Param Int/index of form field.

Optional

Param int/ControlType one of the WT_ constants to match on or wt_unknown (or 0) for all. This enables a list of specific formfield types to be retrieved. Note this extra param is only available in JAWS 6.0 and higher.

Category HTML Navigation

function MoveToFrame

Description Moves the active cursor to the top left corner of the specified frame. If the PC cursor is active when this function is used, then the JAWS cursor is activated and it is moved to the new position. Otherwise, the active cursor is moved.

Returns Int "WAS_SUCCESSFUL" = 1 (frame was found), "WAS_NOT_SUCCESSFUL" = 0 (frame was not found).

Param string The name of a frame.

Category Frames

function MoveToGlanceHighlight

Description This function Moves the cursor to the next, prior, first or last instance of a glance highlight.

Returns int True if a glance highlight could be found and moved to, false otherwise.

Param int/searchType one of S_TOP, S_BOTTOM, S_NEXT or S_PRIOR as defined in hjconst.jsh.

Optional

Param int/timeBased True if searching for a glance highlight based on time of last modification, false if searching by order of appearance on the page.

Category HTML Navigation

function MoveToGlanceHighlightByIndex

Description This function Moves the cursor to a glance highlight based on the index of its appearance on the page.

Returns int True if a glance highlight of the given index could be found and moved to, false otherwise.

Param int/index The 1-based index of the glance highlight.

Category HTML Navigation

function MoveToGraphic

Description Moves the JAWS cursor, invisible cursor, or Braille cursor in a specific direction to find a graphic symbol in the active window.

Returns Int "WAS_SUCCESSFUL" = 1, "WAS_NOT_SUCCESSFUL" = 0.

Param Int Type one of the constants to indicate the direction that the cursor is to move as it searches for a graphic: GRAPHIC_FIRST, GRAPHIC_NEXT, GRAPHIC_PRIOR, or GRAPHIC_LAST.

Optional

Param int set this to TRUE to restrict the search to the window containing the active cursor, FALSE for an unrestricted search, if not supplied, defaults to FALSE, ie unrestricted. this optional parameter is only available in JAWS 6.0

Category Graphics

function MoveToHeading

Synopsis Moves the virtual cursor to a Heading.

Description Depending on the value of SearchOption, and nLevel, positions to the first, last, next, or prior heading on the current web page.

Returns Int TRUE if a heading was found, FALSE otherwise.

Param Int/SearchOption one of S_TOP, S_BOTTOM, S_NEXT, or S_PRIOR to move to the first, last, next or prior form field respectively.

Param Int/nLevel 0 to find any heading, 1 through 6 to find a heading at levels 1 through 6.

Category HTML Navigation

function MoveToHTMLFrame

Synopsis Moves to the first, last, next or prior HTML frame.

Description This function moves to the first, last, next or prior frame in an HTML document depending on the search type parameter. See hjconst.jsh for a list of constants, these constants are prefixed with s_

Returns Int true if the virtual cursor was moved to a frame, false otherwise.

Param Int/SearchDirection

Category HTML Navigation

function MoveToHTMLFrameByIndex

Synopsis Moves to a particular frame by index.

Description This function moves to a specified frame on a webpage. Specify the 1-based index of the frame to move to.

Returns Int true if the virtual cursor was moved to a frame, false otherwise.

Param Int/index of frame

Category HTML Navigation

function MoveToLandmark

Synopsis Moves the virtual cursor to an ARIA Landmark.

Description Depending on the value of SearchOption, positions to the first, last, next, or prior ARIA landmark on the current web page.

Returns Int TRUE if a landmark was found, FALSE otherwise.

Param Int/SearchOption one of S_TOP, S_BOTTOM, S_NEXT, or S_PRIOR to move to the first, last, next or prior landmark respectively.

Category HTML Navigation

function MoveToList

Synopsis Moves the virtual cursor to a list.

Description Depending on the value of SearchOption, positions to the first, last, next, or prior list on the current web page.

Returns Int TRUE if a list was found, FALSE otherwise.

Param Int/SearchOption one of S_TOP, S_BOTTOM, S_NEXT, or S_PRIOR to move to the first, last, next or prior list respectively.

Category HTML Navigation

function MoveToListByIndex

Synopsis Moves to a particular list by index.

Description This function moves to a specified list in a document. Specify the 1-based index of the list to move to. This is primarily used with the GetListOfLists function which returns a delimited string containing list information for each list currently rendered in the document.

Returns Int true if the cursor was moved to a list, false otherwise.

Param Int/index of list

Category HTML Navigation

function MoveToProofreadingElement

Synopsis moves the cursor to the first, next, previous or last proofreading element in the document.

Description This function moves the cursor to the first, next, previous or last proofreading element in the document.

Returns int TRUE for success, FALSE otherwise.

Param int/nProofreadingElementType see hjconst.jsh for the proofreading element types, peSpellingError, peGrammaticalError, peRevision

Param int/nSearchTypeFlags, see hjconst.jsh, s_top, s_bottom, s_next, s_prior

Param string/byref/sElementFound on success, is filled with the text of the element found

Category Proofreading and Annotations

function MoveToProofreadingElementByIndex

Synopsis moves to a proofreading element by its 1-based index

Description This function is used in conjunction with GetListOfProofreadingElements to move the cursor to the selected element from the list via its index.

Returns int TRUE if the move was successful, FALSE otherwise.

Param int/nProofreadingElementType see hjconst.jsh for the proofreading element types, peSpellingError, peGrammaticalError, peRevision

Param int/nIndex 1-based index

Param string/byref/sElementFound on success, is filled with the text of the element found

Category Proofreading and Annotations

function MoveToRangeInconsistency

Synopsis moves to and obtains information about an inconsistency in the requested text range

Description This function moves to and obtains information about an inconsistency in the specified text range relative to the current cursor location.

Returns int TRUE or FALSE depending on whether the move was successful.

Param int/nRange 0 line, 1 sentence, 2 paragraph

Param int/nDirection one of s_top, s_bottom, s_next or s_prior.

Param int/nInconsistencyTypeFlags The type of inconsistencies bitwise ored together that should be detected, see hjconst.jsh.

Param int/nPairedSymbolCategoryFlags the flags governing the paired symbols to check, see hjconst.jsh

Param int/byref/nTypeOfInconsistency The inconsistency type found in the specified direction, see hjconst.jsh

Param string/byref/sChars The characters of the inconsistency (eg the punctuation symbol, miscapitalized letter, etc).

Param int/byref/nOffset The offset of the inconsistency relative to the start of the line containing the inconsistency just moved to.

Category Proofreading and Annotations

function MoveToRegion

Synopsis Move the virtual cursor to an occurance of the indicated region type.

Description This function moves the virtual cursor to another occurance of the indicated region type. The first parameter determines the direction of the move, valid direction constants are listed in hjconst.jsh and include s_top, s_bottom, s_next and s_prior. The second parameter (if given) indicates the type of region to move to. If not given, then a region of any type in the indicated direction is located.

Returns Int true if a region was found, false otherwise.

Param Int/searchDirection one of s_top, s_bottom, s_next or s_prior as defined in hjconst.jsh.

Optional

Param Int/regionType one of the wt_typeCode constants.

Category HTML Navigation

function MoveToTable

Synopsis Moves the virtual cursor to a table.

Description Depending on the value of SearchOption, positions to the first, last, next, or prior table on the current web page.

Returns Int TRUE if a table was found, FALSE otherwise.

Param Int/SearchOption one of S_TOP, S_BOTTOM, S_NEXT, or S_PRIOR to move to the first, last, next or prior table respectively.

Category HTML Navigation

function MoveToTableByIndex

Synopsis Moves to a particular table by index.

Description This function moves to a specified table on a webpage. Specify the 1-based index of the table to move to. This is primarily used with the GetListOfTables function which returns a delimited string containing table information for each table currently rendered in the virtual document.

Returns Int true if the virtual cursor was moved to a table, false otherwise.

Param Int/index of table

Category HTML Navigation

function MoveToTableCell

Synopsis Moves the cursor to the specified table cell.

Description This function moves the cursor to the specified table cell. The parameters specify the column and row to move to (in 1-based coordinates).

Returns Int true if successful, false otherwise.

Param Int/nCol the column number

Param Int/nRow the row number

Category Tables

function MoveToTag

Synopsis Moves the cursor to the next, prior, first or last instance of the specified tag.

Description This function Moves the cursor to the next, prior, first or last instance of the specified tag. It is primarily useful in HTML documents.

Returns Int true or false.

Param Int/iSearchType one of S_TOP, S_BOTTOM, S_NEXT or S_PRIOR as defined in hjconst.jsh

Param String/sTag the HTML or other textual tag to locate

Category HTML Navigation

function MoveToTagByIndex

Synopsis Moves to a particular tag by its index.

Description This function moves to a specified tag on a webpage. Specify the 1-based index of the particular tag to move to. This is primarily used with the GetListOfTags function which returns a delimited string containing tag information for each tag currently rendered in the virtual document.

Returns Int true if the virtual cursor was moved to a tag, false otherwise.

Param Int/iIndex index of table

Param string/sTag the tag to move to

Category HTML Navigation

function MoveToTagWithAttribute

Synopsis Moves the cursor to the next, prior, first or last instance of the specified element with the specified attribute.

Description This function Moves the cursor to the next, prior, first or last instance of the specified element with the specified attribute. It is primarily useful in HTML documents. For example, it maybe used to move to instances of an element with an onclick or onmouseover handler.

Returns Int true or false.

Param Int/iSearchType one of S_TOP, S_BOTTOM, S_NEXT or S_PRIOR as defined in hjconst.jsh

Param String/sTag the HTML or other textual tag to locate (maybe empty).

Param string/sAttribute the attribute which must be present in the element, eg "onclick".

Optional

Param int/bAllowNesting TRUE to find nested instances, FALSE to disallow nested instances.

Category HTML Navigation

function MoveToTagWithAttributeByIndex

Synopsis Moves to a particular tag by its index.

Description This function moves to a specified tag on a webpage. Specify the 1-based index of the particular tag to move to In order for the index to correctly match elements retrieved with GetListOfTagsWithAttribute, the same attribute and nesting parameter must be supplied. This is primarily used with the GetListOfTagsWithAttribute function which returns a delimited string containing tag information for each tag currently rendered in the virtual document with the specified attribute. The page must have focus for this function to work.

Returns Int true if the virtual cursor was moved to a tag, false otherwise.

Param Int/iIndex index of tag relative to collection of tags with specified attribute present.

Param string/sTag the tag to move to

Param string/sAttr the attribute which must be present in order to count the tag as being included in the index

Param int/iAllowNesting TRUE to allow nesting when determining the instance of the element to move to, must match the value used when obtaining the list of tags with the specified attribute.

Category HTML Navigation

Description Moves to the first, last, next or prior unvisited link.

Returns Int true if an unvisited link was found, false otherwise.

Param Int one of s_top, s_bottom, s_next or s_prior defined in hjconst.jsh.

Category HTML Navigation

Description Moves to the first, last, next or prior visited link.

Returns Int true if a visited link was found, false otherwise.

Param Int one of s_top, s_bottom, s_next or s_prior defined in hjconst.jsh.

Category HTML Navigation

function MoveToWindow

Description Moves the active cursor to the specified window. If the window contains text, then the cursor is positioned on the first character. Otherwise, it is positioned at the center of the window. If the PC cursor is active when this function is used, then the JAWS cursor is activated and it is moved to the new position.

Returns Int "WAS_SUCCESSFUL" = 1 (window was found), "WAS_NOT_SUCCESSFUL" = 0 (window was not found).

Param Handle Type the name of a variable or choose a script function that indicates the window handle where the active cursor is to be moved.

Category Window

function MSAAGetDialogStaticText

Synopsis Gets static text from a Dialog using MSAA.

Description This function is useful for getting descriptive static text from dialogs which support MSAA when the dialog doesn't contain child windows for each child object.

Returns String The dialog static text.

Category Object Model and MSAA

function MSAARefresh

Synopsis Forces JAWS to reload the name/value/state/description of the object with focus from MSAA

Description This function is only needed in situations where the object with focus changes without firing MSAA events to let JAWS know to update it's cached data.

Returns int TRUE if successful, FALSE otherwise. When bSynchronous is True then a return of True means that the refresh was successful. When bSynchronous is False, a return of True simply means that the refresh was requested.

Optional

Param int/Synchronous When True the function will not return until the refresh is complete. When False, the function will return immediately and the refresh will complete at some time in the future. If you wish to simply cause a FocusChangedEvent to be called with updated info as the result of the refresh, then pass False for this parameter. If you want to immediately process the updated data and want to suppress any FocusChanged event that could result, then pass True for this parameter.

Param int/MaxMillisecondsToWait If bSynchronous is True, then MaxMillisecondsToWait determines how much time to wait for completion before returning failure. If bSynchronous is False, then this parameter is ignored.

Category Object Model and MSAA

function MSOGetMenuBarObject

Description Gets the Menu bar object in MS Office 97/2000 applications.

Returns Object The Menu bar of the current Office application.

Category Object Model And MSAA

function MuteSynthesizerToggle

Synopsis Calls for JAWS to be silent when the synthesizer is muted.

Description If using a software synthesizer, it maybe a good idea to mute JAWS when using applications such as VoiceChat programs. This will allow the sound card to be available. Running the script once will cause JAWS to be silenced. Running the script the second time will turn the speech back on. You can use the "Adjust JAWS Verbosity" dialog to mute JAWS. Next time you press the keystroke to open the dialog, it will unmute JAWS without bringing up the dialog.

Returns String description of value to be displayed as value of Mute Synth option.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category Voices

function navGetAppMainObjectID

Description Determines the object ID for the Main object of the active application.

Returns Handle Provides the object ID of the application's Main object.

Param Handle This function starts with the object that is identified by an object ID. Type the name of a variable or choose a script function that can provide the handle for the starting object.

Optional

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetCurrentObjectID

Description Retrieves the Object ID of the object at the location of the active cursor. The object ID is used in a number of functions to retrieve information about objects.

Returns Handle the Object ID or 0 if the Object ID cannot be retrieved.

Category Window

function navGetFirstChildObjectID

Description Determines the first child object of a specific parent object. This function is useful when you wish to move down through the stack of object IDs.

Returns Handle Provides the handle of the first child object or returns a value of 0 when a child object cannot be found.

Param Handle This function starts with the object that is identified by an object ID. Type the name of a variable or choose a script function that can provide the handle for the starting object.

Optional

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow will be used to provide a default handle.

Category Window

function navGetFirstObjectID

Description Obtains the Object ID of the first Object in a series of objects. It can provide the object ID that is needed by other object navigation functions.

Returns Int Provides Object ID.

Optional

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetFocusObjectID

Description Retrieves the Object ID of the object at the focus point. The object ID is used in a number of functions to retrieve information about objects.

Returns Handle the Object ID at the focus point, or 0 if the Object ID cannot be retrieved.

Category Window

function navGetLastObjectID

Description Obtains the Object ID of the last Object in a series of objects. It can provide the object ID that is needed by other object navigation functions.

Returns Int Provides Object ID.

Optional

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetNextObjectID

Description Provides the next Object ID in a series of Object IDs that are all at the same logical level. It is used to move across a list of control objects.

Returns Handle Provides the Object ID of the next object in the stack or returns a value of 0 when another object cannot be found.

Param Handle This function starts with the object that is identified by an Object ID. Type the name of a variable or choose a script function that can provide the handle for the starting object.

Optional

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetObjectContainerHelp

Description Retrieves the container help string of the object with the specified parent window and Object ID. If a parent window and object ID is not defined, then the object at the active cursor is used.

Returns String the container help string of the specified object.

Optional

Param Handle Type a variable name or choose a script function that can provide the Object ID for object whose information is to be retrieved. If a an object ID is not provided, navGetCurrentObjectID will be used to provide a default ID.

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetObjectHelp

Description Retrieves the help string of the object with the specified parent window and Object ID. If a parent window and object ID is not defined, then the object at the active cursor is used.

Returns String the help string of the specified object.

Optional

Param Handle Type a variable name or choose a script function that can provide the Object ID for object whose information is to be retrieved. If a an object ID is not provided, navGetCurrentObjectID will be used to provide a default ID.

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetObjectName

Description Retrieves the name of the object with the specified parent window and Object ID. If a parent window and object ID is not defined, then the object at the active cursor is used.

Returns String the name of the specified object.

Optional

Param Handle Type a variable name or choose a script function that can provide the Object ID for object whose information is to be retrieved. If a an object ID is not provided, navGetCurrentObjectID will be used to provide a default ID.

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetObjectTypeCode

Description Retrieves the object type code of the object with the specified parent window and Object ID. If a parent window and object ID is not defined, then the object at the active cursor is used.

Returns Int the object type code of the specified object.

Optional

Param Handle Type a variable name or choose a script function that can provide the Object ID for object whose information is to be retrieved. If a an object ID is not provided, navGetCurrentObjectID will be used to provide a default ID.

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetObjectTypeString

Description Retrieves the object type string of the object with the specified parent window and Object ID. If a parent window and object ID is not defined, then the object at the active cursor is used.

Returns String the object type string of the specified object.

Optional

Param Handle Type a variable name or choose a script function that can provide the Object ID for object whose information is to be retrieved. If a an object ID is not provided, navGetCurrentObjectID will be used to provide a default ID.

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetParentObjectID

Description Determines which object is directly above the specified child object. For Example, when a dialog box pops up, it could be used to determine the window handle of the window that created the dialog box. It can be used to move up through a list of object IDs in order to get to a specific object.

Returns Handle This is the handle of the parent object.

Param Handle This function starts with the object that is identified by an object ID. Type the name of a variable or choose a script function that can provide the handle for the starting object.

Optional

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetPrevObjectID

Description Provides the previous Object ID in a series of Object IDs that are all at the same logical level. It is used to move across a list of control objects.

Returns Handle Provides the Object ID of the prior object in the stack or returns a value of 0 when another object cannot be found.

Param Handle This function starts with the object that is identified by an Object ID. Type the name of a variable or choose a script function that can provide the handle for the last object.

Optional

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetRealObjectID

Description Moves up through the list of objects in search of a real object. A real object is one that has a title.

Returns Handle Provides the object ID of the real object.

Param Handle This function starts with the object that is identified by an object ID. Type the name of a variable or choose a script function that can provide the handle for the starting object.

Optional

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function navGetTopLevelObjectID

Description Similar to navGetAppMainObjectID. These two functions differ however in that navGetAppMainObjectID will always return the object ID for the highest level object in the application. In contrast, navGetTopLevelObjectID can be used within dialog boxes to return the object ID of the main dialog object when there may be several child windows which are also real windows. This can be useful when the navGetRealWindowObjectID function does not return the object ID of the main dialog. A real object refers to a object with a title.

Returns Handle The handle of the TopLevel object, as opposed to the AppMain Object.

Param Handle This function starts with the object that is identified by an object ID. Type the name of a variable or choose a script function that can provide the handle for the starting object.

Optional

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function NavigationQuickKeysManager

Synopsis Opens the Navigation Quick Keys Manager

Description This function opens the Navigation Quick Keys Manager which allows the user to modify the key assignments for the Quick Navigation Scripts that are available in Internet Explorer, Mozilla Firefox, Adobe Reader, Microsoft Word, and Microsoft Outlook. The Navigation Quick Keys Manager can run in three modes that are specified by the nMode parameter. In the first mode (nMode = 0), the Navigation Quick Keys Manager allows the user to edit the key assignments for the Quick Navigation Scripts that are available in HTML and PDF documents. In the second mode (nMode = 1), the Navigation Quick Keys Manager allows the user to edit the key assignments for the Quick Navigation Scripts that are available in Microsoft Word Documents. In the third mode (nMode = 2), the Navigation Quick Keys Manager allows the user to edit the key assignments for the Quick Navigation Scripts that are available in Microsoft Outlook.

Returns int Returns TRUE if the NavigationQuickKeysManager function was able to display the Navigation Quick Keys Manager dialog box. Returns False otherwise. Note: This function returns without waiting for the user to close the Navigation Quick Keys Manager dialog box.

Param int/nMode Specifies the mode that the Navigation Quick Keys Manager should run in. If this parameter is set to 0, the Navigation Quick Keys Manager will allow the user to edit the key assignments for the Quick Navigation Scripts that are available in HTML and PDF documents. If this parameter is set to 1, the Navigation Quick Keys Manager will allow the user to edit the key assignments for the Quick Navigation Scripts that are available in Microsoft Word documents. If this parameter is set to 2, the Navigation Quick Keys Manager will allow the user to edit the key assignments for the Quick Navigation Scripts that are available in Microsoft Outlook. Any other value will cause the QuickNavigationKeysManager to fail.

Category Settings

function NavigationQuickKeysSet

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function navSayObjectTypeAndText

Description Speaks the name and type of the object indicated by the function's parameters or, if called with no parameters, located at the current cursor's location. This function is similar to SayWindowTypeAndText, except that it is more specific. If a particular window contains multiple objects, this function will speak information about the one at the cursor, while SayWindowTypeAndText will speak information about the enclosing window. If the window does not contain multiple objects, then the functions operate identically. When this function is used, it marks the text it reads so that the Say Highlighted Text and Say NonHighlighted Text functions do not repeat the same information when they are triggered.

Optional

Param Handle Type a variable name or choose a script function that can provide the Object ID for object whose information is to be retrieved. If a an object ID is not provided, navGetCurrentObjectID will be used to provide a default ID.

Param Handle Type a variable name or choose a script function that can provide the window handle for the parent window. If a window handle is not provided, then GetCurrentWindow() will be used to provide a default handle.

Category Window

function NavToFlowRelations

Synopsis If the focused element on a webpage has either a FlowFrom or FlowTo IAccessible2 relationship this moves to that related element

Description If an element on a web page has either a FlowTo or FlowFrom IAccessible2 relationship to other elements on the current web page, this function will cause focus to be moved to that related element

Returns Int TRUE if the focus was moved to the target, FALSE otherwise.

Param int/flowTo 0=flowFrom;1=FlowTo

Category HTML Navigation

function NextBrailleString

Description When the Braille device is in string mode, it displays the next string of Braille characters that are in the queue of strings that have been received by the Braille device.

Returns Int "WAS_SUCCESSFUL" = 1 (another string was available for display), "WAS_NOT_SUCCESSFUL" = 0 (another string was not displayed).

Category Braille Output

function NextCell

Description When inside a table or spreadsheet, moves the active cursor to the same cell in the next column.

Returns Int TRUE if the cursor moved, FALSE otherwise.

Optional

Param int/wrapNavigation Set to true to wrap to the next row at the end of the current row. Default is not to wrap.

Category Tables

function NextCharacter

Description This performs a special version of the RIGHT ARROW or Next Character keyboard command. When the PC cursor is active, JAWS allows the application to move the cursor. When other cursors are active, then JAWS tries to move the cursor to the next character or graphic it finds to the right of the current cursor location. To speak the character at the new location, place a SayCharacter function after the NextCharacter function. Note: Once the cursor has moved to the next character, it is not spoken.

Category Navigation

function NextChunk

Description This moves the active cursor to the next chunk of text. A chunk of text is a section or block of text that is written to the screen at one time, with one function call. This would typically indicate a phrase or description that should be spoken as one unit. This is useful in reading blocks of static text, control prompts, and field names.

Category Navigation

function NextLine

Description This moves the active cursor down to the next line. In many situations, Windows does not display information in perfect horizontal rows, and the cursor may not move a uniform distance each time this function is used. To speak the information immediately after the NextLine function is used, place a SayLine function after the NextLine function.

Returns Int

Optional

Param int - 0 no input origin specified. 1 specifies that the command has originated from the keyboard. 2 specifies that the command has originated from a Braille display (i.e. Whiz wheel up/down). 3 specifies that the command has originated from a mouse click. Defaults to 0.

Category Navigation

Synopsis Positions the Virtual cursor at the next large block of nonlink text.

Description Often useful for moving past advertisement text on a Web page.

Category HTML

function NextParagraph

Description Moves the active cursor to the beginning of the next paragraph. If the PC cursor is active and the next paragraph is not already visible, then text in the window will automatically scroll to bring it into view.

Returns Int TRUE if the next paragraph was found, FALSE otherwise.

Optional

Param int - 0 no input origin specified. 1 specifies that the command has originated from the keyboard. 2 specifies that the command has originated from a Braille display (i.e. Whiz wheel up/down). 3 specifies that the command has originated from a mouse click. Defaults to 0.

Category Navigation

function NextSentence

Description Moves the active cursor to the beginning of the next sentence. If the PC cursor is active and the next sentence is not already visible, then text in the window will automatically scroll to bring it into view.

Returns Int TRUE if the next sentence was found, FALSE otherwise.

Optional

Param int - 0 no input origin specified. 1 specifies that the command has originated from the keyboard. 2 specifies that the command has originated from a Braille display (i.e. Whiz wheel up/down). 3 specifies that the command has originated from a mouse click. Defaults to 0.

Category Navigation

function NextWord

Description This performs a special version of the CONTROL + RIGHT ARROW or Next Word keyboard command. When the PC cursor is active, JAWS allows the application to move the cursor. When other cursors are active, then JAWS tries to move the cursor to the next word or graphic it finds to the right of the cursor's current location. To speak the word at the new cursor location, place a SayWord function after the NextWord function. Note: Once the cursor has moved to the next word, it is not spoken.

Category Navigation

function NotifyTouchInteraction

Description Informs windows that the user has just used touch to activate the control at the specified location on the screen. This is required in order for the system to activate the onscreen keyboard if appropriate. This is a wrapper of the Windows accNotifyTouchInteractionFunction.

Returns int True if successful, false otherwise

Param handle/window The window containing the touch point

Param int/x The x coordinate of the touch point

Param int/y The y coordinate of the touch point

Category Scripts

function Null

Synopsis Use this function to set any type of variable to its null state.

Description Returns null, allowing any type of variable to be set to null when assigned to the return value of this function.

Returns variant A null value.

Category Scripts

function OCRPdf

Description Performs OCR on the PDF document attached to the specified window, using the specified primary and secondary oCR languages.

Returns int The Job ID associated with the scheduled OCR.

Param handle/hwnd The window containing the PDF document. It must be open in Adobe Acrobat.

Param int/PrimaryLanguage The primary recognition language to use.

Param int/SecondaryLanguage The secondary language to use.

Category Optical Character Recognition

function OCRScreenArea

Synopsis Performs optical character recognition on a given rectangular area of the screen.

Description Performs optical character recognition on a given rectangular area of the screen. The OCR processing is asynchronus. When the OCR operation is complete, the OCRCompletedEvent will be sent. The OCR data is then available to the JAWS cursor.

Returns Int a job ID. This ID may be used to cancel the OCR operation in progress, or to identify a specific OCRScreenArea call in the OCRCompletedEvent function. If the OCR is not successfully initiated, the returned job ID is 0.

Param int left edge of the requested screen area.

Param int top edge of the requested screen area.

Param int right edge of the requested screen area.

Param int bottom edge of the requested screen area.

Param int primary language code. (English is 1033)

Param int secondary language code. (English is 1033)

Optional

Param int/EnableMicrosoftOcr Flag set to use the Microsoft OCR Engine

Param int/MicrosoftOcrLanguageCode Microsoft OCR language code. (English is 1033)

Category Optical Character Recognition

function OpenQuickAccessBar

Description Open Quick Access Bar on Windows 10 if ZoomText/Fusion is running.

Returns Void

Category Misc

function OptionsTreeCore

Synopsis Creates formatted string and presents the "Adjust JAWS Options" dialog box.

Description This function is equivalent to VerbosityCore, except that it formats the string for and presents the "Adjust JAWS Options" (Insert + v) dialog box.

Param string/sCustomItems List of items, wherein the list is segmented using the vertical bar ( ) symbol. Each segment is divided with the colon (:) symbol, where segment 1 is the callback function name and segment 2 is the display text, which may or may not contain a node path. You must have a callback function and a corresponding hlp callback function with the same name as segment 1 of each array slice. See UserOptions.jss and accompanying files for string and function format.

Optional

Param int/iRetNodeSettings Enter TRue for this optional parameter, if you do not want this function to update item strings which do not have node paths. If you ignore or leave this parameter FALSe, your items will be formatted with the node you specify in the strNewNode parameter. Ignoring these parameters is the fastest way to get your items in in their own group.

Param string/strNewNode Enter the explicit path in which to place all items in your list which do not have nodes.

Category User Options

function OutlookGetDisplayedDates

Synopsis Retrieves a list of dates currently displayed in the Outlook 2007 calendar.

Description This function only works in Outlook 2007 SP1 and later when a Day/Week/Month view is visible.

Returns string A list of dates separated by a .

Param object/View an instance of the active calendar view object in Outlook which must be one of Day/Week/Month

Category Object Model and MSAA

function OutputDebugString

Synopsis Sends a string to the debugger for display.

Description Sends a string to the debugger for display. The debugger may be a utility program such as DBGVIEW.EXE.

Returns Void

Param string String to be displayed.

Category Utility

function PageRefresh

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function PageSectionColumnChangedEvent

Synopsis For apps supporting SelectionContext events such as MSWord, announces changes in page, section, etc.

Description For apps supporting SelectionContext events such as MSWord, announces changes in page, section, text columns, and text column counts.

Returns Void

Param int/nPageNumber

Param int/nPrevPageNumber

Param int/nSectionNumber

Param int/nPrevSectionNumber

Param int/nTextColumnNumber

Param int/nPrevTextColumnNumber

Param int/nTextColumnCount

Param int/nPrevTextColumnCount

Category Screen Text Events

function PanTextLeft

Synopsis Pans MAGic's text viewer left.

Description Moves the MAGic Text Viewer left.

Category MAGic

function PanTextRight

Synopsis Pans MAGic's text viewer left.

Description Moves the MAGic Text Viewer right.

Category MAGic

function PanTextViewerLeft

Description If there is more text to the left on the current line, display it.

Returns int TRUE if the viewer is panned, FALSE otherwise.

Category Braille and Text Viewer

function PanTextViewerRight

Description If there is more text to the right on the current line, display it.

Returns int TRUE if the viewer is panned, FALSE otherwise.

Category Braille and Text Viewer

function ParseDateString

Description Convert a date string into month, day, year as integers in out parameters.

Param String/Date The date string formatted for the current locale. Must be formatted as Month, Day and year in the local system format as GetUserLocaleInfo (LOCALE_ILANGUAGE)

Param int/ByRef/Month Receives the month as number.

Param int/ByRef/Day Receives the day as number.

Param int/ByRef/Year Receives the year as number.

Category System

function ParseLongDate

Description Formats a locale-specific date string in a long date format into a string in the standard form YYYY/MM/DD.

Returns String The formatted date.

Param String/strDate a date string in a Locale specific format

Optional

Param String/locale The LCID representing the format of strDate. Defaults to the system LCID.

Category System

function ParseLongDateToShortDate

Description Formats a locale-specific date string in a long date format into the corresponding short date format.

Returns String The formatted date in short date format.

Param String/strDate a date string in a Locale specific long date format

Optional

Param String/locale The LCID representing the format of strDate. Defaults to the system LCID.

Category System

function ParseOutlookCalendarUIAText

Description The string is formatted with each field on its own line, and the name and field separated by a colon. When parsing each field, segment 1 where colon is the delimiter is the field, segments 2-end are the field contents. Field 1 is Status, value is Success or Failure. This is meant to be locale-agnostic in implementation, since each locale orders the string differently. To that end, the second parameter to this function provides the locale to use when creating the list of fields.

Returns string the fields in the calendar string as supplied by UIA (GetObjectName (TRUE,0)) function call in Outlook Calendar.

Param string/UIAText the text from UIA, e.g. getObjectName (TRUE,0) from calendar view.

Param string/LangTLA the language abbreviation for the regional language in use, e.g. GetUserLocaleInfo (LOCALE_SABBREVLANGNAME) where Locale.jsh is included in your source file.

Category Strings

function ParseShortDate

Description Formats a locale-specific date string in a short date format into a string in the standard form YYYY/MM/DD.

Returns String The formatted date.

Param String/strDate a short date string in a Locale specific format

Optional

Param String/strYear A year to be added to the shortDateString. If not provided then the shortDateString is assumed to be fully qualified

Param String/locale The LCID representing the format of strDate. Defaults to the system LCID.

Category System

function PassKeyThrough

Description Passes a keystroke on to the active application program without activating a JAWS script. This function is used when a JAWS script key and an application keyboard command are the same. It prevents JAWS from intercepting a keystroke so that the application program can respond.

Category Keyboard

function PathAddExtension

Description Adds a file extension to a path string.

Returns String Path with specified extension appended.

Param String/strPath Path to be modified.

Param String/strExt Extension to be appended.

Category JAWS Program

function PathFindExtension

Description Searches a path for an extension.

Returns String Extension, or empty string (",") if not found.

Param String/strPath Path to be searched.

Category JAWS Program

function PathRemoveExtension

Description Removes the file extension from a path, if there is one.

Returns String Path with extension removed.

Param String/strPath Path to be modified.

Category JAWS Program

function PathRenameExtension

Description Replaces the extension of a file name with a new extension. If the file name does not contain an extension, the extension will be attached to the end of the string.

Returns String Path with specified extension appended.

Param String/strPath Path to be modified.

Param String/strExt Replacement extension.

Category JAWS Program

function Pause

Description Stops the processing of a script so that other applications can complete tasks. When a pause function is placed in a script, JAWS yields to the time needs of other applications. Once other applications have been given the opportunity to use processing time, then JAWS resumes the script. The pause function is equivalent to using the Delay function with a value of 1. Do not place a pause command in a While loop, because this will cause the computer to freeze up.

Category Scripts

function PausePACMateRemote

Synopsis Allows use of the PAC Mate during a PAC Mate Remote session

Description While controlling a desktop session using a PAC Mate Remote session, use PausePACMateRemote to allow access to the PAC Mate without closing the active sync connection.

Returns int TRUE if in a PAC Mate Remote session and the session is paused.

Category Keyboard

function PCCursor

Description This activates the PC cursor and deactivates other cursors.

Category Cursors

function PerformActionOnElementWithID

Description This function finds an element in the DOM by its unique ID and performs an action on it such as setFocus, makeVisible or doDefaultAction.

Returns int TRUE if the element is found and the action applied, FALSE otherwise.

Param int action setFocus, makeVisible or doDefaultAction, see hjConst.jsh.

Param int uniqueID must correspond with the fsID attribute of the XML converted from hextToDec. the FSID must be obtained for the current session of the page. It is a dynamically changing value much like a window handle that changes each time the Web page loads. For an example, see the ListWebAppToolbarControls script in SharePointWeb.jss.

Optional

Param int/byref left screen left coordinate.

Param int/byref top screen top coordinate.

Param int/byref right screen right coordinate.

Param int/byref bottom screen bottom coordinate.

Category HTML XML DOM

function PerformActionOnElementWithTagAndAttribute

Description This function finds an element in the DOM by tag and attrib/value pair and performs an action on it such as setFocus, makeVisible or doDefaultAction.

Returns int TRUE if the element is found and the action applied, FALSE otherwise.

Param int action setFocus, makeVisible or doDefaultAction, see hjConst.jsh.

Param string fsTag must correspond to fsTag attribute of xml, not XML tag.

Param string attribName an attribute which must be present.

Param string attribValue the value of the attribute specified in attribName which must match.

Optional

Param int/byref left screen left coordinate.

Param int/byref top screen top coordinate.

Param int/byref right screen right coordinate.

Param int/byref bottom screen bottom coordinate.

Category HTML XML DOM

function PerformScriptByName

Description Allows dynamically calling a script whose name is passed as the first argument. This means that the script name does not need to be known at compile time and can be passed in a variable.

Returns void

Param String/ScriptName the name of the script to be run

Optional

Param Variant the script's 1st argument

Param Variant the script's second argument

Param Variant the script's third argument

Param Variant the script's 4th argument

Param Variant the script's 5th argument

Param Variant the script's sixth argument

Param Variant the script's seventh argument

Param Variant the script's eighth argument

Param Variant the script's 9th argument

Category Scripts

function PlaceMarkersEnumerate

Synopsis enumerates the placemarkers in a virtual document calling a user defined callback function for each marker.

Description this function enumerates the placemarkers in a virtual document calling a user supplied callback function for each marker. the callback function is passed the index of the marker, the marker's name and the text at the marker. The text at the marker is optionally marked up if the second parameter to this function is true. The enumeration continues until either all markers have been visited or the callback returns false. Note this is only available in JAWS 5.00.758 or higher.

Returns int true if the enumeration visited all markers, false if the enumeration failed or the callback returned false for any marker.

Param string/sCallbackFunctionName the name of the function to be called for each marker. The function must be defined as func(int nIndex, string sMarkerName, sMarkerText), where func maybe any legal function name.

Param int/bUseMarkupForMarkerText must be set to true if the text at the marker is to be passed with markup, false for no markup.

Category HTML Placemarkers

function PlayKeys

Description This function simulates the key sequence previously created by calls to PressKey and ReleaseKey. This allows for complex sequences of keystrokes to be executed by JAWS.

Returns Void

Category Keyboard

function PlaySound

Description Plays a wave file through the computer sound system. Requires one parameter, the wave filename. Use the FindJAWSSoundFile function to search JAWS sound folders in the user and shared spaces for the desired file. If a complete path is not specified, JAWS will search the system path specified in Environment Variables for the file.

Param string Includes the wave filename. Use the FindJAWSSoundFile function to search JAWS sound folders in the user and shared spaces for the desired file. If a complete path is not specified, JAWS will search the system path specified in Environment Variables for the file.

Category Sounds

function PositionInGroup

Synopsis Returns the string usually spoken on output type OT_POSITION, ie the position string for the focused control.

Description returns a string describing the focused control's selection's position relative to the collection, eg 1 of 10 items etc.

Returns String of the format 1 of 10 or 0 items.

Optional

Param handle/hwnd As of JAWS 12.0, Handle to the window for which information is desired. If not provided, defaults to the focussed control.

Category Dialog Controls

function PostMessage

Description Provides limited access to the Windows PostMessage function (See the Windows Platform SDK or a Windows programming book for details) It is only possible to use numeric values for wParam and lParam. No strings or other structures can be passed.

Param Handle/hWnd Window to which the message should be posted.

Param Int/Message Message to be sent.

Optional

Param Int/wParam wParam value for the message, defaults to 0.

Param Int/lParam lParam value for the message, defaults to 0.

Category Window

function PrependItemWithNode

Synopsis Adds node or tree branch path to traditional listitem.

Description Prepares list item string segment to be used in an array passed to the dlgSelectTreeFunctionToRun function.

Returns string the modified string segment with the path string.

Param string/strItem This is the string segment which contains the function callback, a colon, and the list item display text.

Param string/strNode This is the branch, or path of branches. Note that it should not end with the node path separator. Examples of nodes would be "General Options" or "Reading Options.Sayall Options" (note noperiod at end of example; this is added by the function.)

Category User Options

function PresentAllOccurrences

Description Presents all of the occurrences of a specified string in the current document in a virtual view for navigation and instant location.

Returns int the number of occurrences of the specified string presented.

Param string/sText the word whose occurrences and context you want displayed.

Optional

Param int/nUnit 0 line, 1 sentence, 2 paragraph: the unit of context to show for each word (defaults to line) occurrence.

Category Screen Text

function PressKey

Description Simulates pressing a key down on the keyboard. This function should be paired with calls to ReleaseKey. Once a sequence of PressKey and ReleaseKey calls is complete, call PlayKeys to have JAWS simulate the entire key sequence.

Returns Void

Param string A string value for the key name, these can include alt, control and shift.

Category Keyboard

function PriorBrailleString

Description Displays the prior string of Braille characters that are in the queue of strings that have been received by the Braille device. This function is used when the Braille device is in string mode.

Returns Int WAS_SUCCESSFUL = 1 (another string was available for display),"WAS_NOT_SUCCESSFUL = 0" (another string was not displayed).

Category Braille Output

function PriorCell

Description When inside a table or spreadsheet, moves the active cursor to the same cell in the prior column.

Returns Int TRUE if the cursor moved, FALSE otherwise.

Optional

Param int/wrapNavigation Set to true to wrap to the prior row at the start of the current row. Default is not to wrap.

Category Tables

function PriorCharacter

Description This performs a special version of the LEFT ARROW or Prior Character keyboard command. When the PC cursor is active, JAWS allows the application to move the cursor. When other cursors are active, JAWS tries to move the cursor to the prior character or graphic it finds to the left of the cursor's current location. To speak the information at the new cursor location, place a SayCharacter function after the PriorCharacter function.

Category Navigation

function PriorChunk

Description This moves the active cursor to the prior chunk. A chunk of text is a section or block of text that is written to the screen at one time, that is, with one function call. This would typically indicate a phrase or description that should be spoken as one unit. This is useful in reading blocks of static text, control prompts, and field names.

Category Navigation

function PriorLine

Description This performs a special version of the UP ARROW keyboard command. When the PC cursor is active, JAWS allows the application to move the cursor. When other cursors are active, then JAWS tries to move the cursor up to the line above its current position. To speak the line of information at the new location, place a SayLine function after the PriorLine function.

Returns Int

Optional

Param int - 0 no input origin specified. 1 specifies that the command has originated from the keyboard. 2 specifies that the command has originated from a Braille display (i.e. Whiz wheel up/down). 3 specifies that the command has originated from a mouse click. Defaults to 0.

Category Navigation

Synopsis Positions the Virtual cursor at the prior large block of nonlink text.

Description Often useful for moving back past advertisement text on a Web page.

Category HTML

function PriorParagraph

Description Moves the active cursor to the beginning of the prior paragraph. If the PC cursor is active and the prior paragraph is not already visible, then text in the window will automatically scroll to bring it into view.

Returns Int TRUE if the prior paragraph was found, FALSE otherwise.

Optional

Param int - 0 no input origin specified. 1 specifies that the command has originated from the keyboard. 2 specifies that the command has originated from a Braille display (i.e. Whiz wheel up/down). 3 specifies that the command has originated from a mouse click. Defaults to 0.

Category Navigation

function PriorSentence

Description Moves the active cursor to the beginning of the prior sentence. If the PC cursor is active and the prior sentence is not already visible, then text in the window will automatically scroll to bring it into view.

Returns Int TRUE if the prior sentence was found, FALSE otherwise.

Optional

Param int - 0 no input origin specified. 1 specifies that the command has originated from the keyboard. 2 specifies that the command has originated from a Braille display (i.e. Whiz wheel up/down). 3 specifies that the command has originated from a mouse click. Defaults to 0.

Category Navigation

function PriorWord

Description This performs a special version of the CONTROL + LEFT ARROW or Prior Word keyboard command. When the PC cursor is active, JAWS allows the application to move the cursor. When other cursors are active, JAWS tries to move the cursor to the prior word or graphic it finds to the left of the cursor's current location. To speak the word at the new location, place a SayWord function after the PriorWord function.

Category Navigation

function ProcessNewText

Description Used to force a NewTextEvent call. Can be useful if you need to call NewTextEvent before FocusChangedEvent.

Category Screen Text

function ProcessNotification

Description Retrieves the collection representing the action rules for this notification.

Returns collection The collection representing the action rules for this notification.

Param string/notificationText The text of the notification.

Param string/AppName The name of the application which sent the notification.

Category Notification Manager

function ProgressBarAnnouncementToggle

Synopsis Toggles progress bar announcement on and off.

Description Used to toggle the announcement of the progress bar. The status will revert to the default setting when JAWS is restarted.

Returns string the state of the progress bar announcement after the toggle.

Param int true if current value is to be returned, false if value is to be updated and returned.

Category Settings

function ProgressBarSetAnnouncement

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function PunctuationSetLevel

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function PunctuationToggle

Synopsis Toggles the punctuation between the choices available.

Description Changes the punctuation spoken by JFW such as: All, Some, Most, and None.

Returns String description of value to be displayed as value of Punctuation Level.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category Settings

function PushBrailleMathString

Synopsis Pushes math text to be shown on the braille display. Only valid in Braille Push mode.

Description This function is identical to PushBrailleString; however, the text is flagged as Math text, instead of plain text. The effect of this is that the braille translator will translate the string using special math rules, instead of the regular ones.

Returns void

Param string Text the text to push to the braille display.

Param int CursorPosition the position of the cursor in the text.

Optional

Param string BreakableOffsets A string containing a comma delimited list of offsets at which the string can be broken for panning (i.e. "2,5,6").

Category Braille Output

function PushBrailleString

Synopsis Pushes text to be shown on the braille display. Only valid in Braille Push mode.

Description This function will push the given text to the braille display to be shown, setting the cursor at the given position. Strings can only be pushed to the display if the active braille mode is the Push mode. While in Push mode, only text sent by PushBraille methods will be shown on the display. Push mode can be enabled by calling SetJCFOption(OPT_BRL_MODE, BRL_MODE_PUSH). Make sure it is disabled appropriately, or else the user will be stuck in a mode where their normal braille isn't displayed.

Returns void

Param string Text the text to push to the braille display.

Param int CursorPosition the position of the cursor in the text.

Optional

Param string BreakableOffsets A string containing a comma delimited list of offsets at which the string can be broken for panning (i.e. "2,5,6").

Category Braille Output

function QueueFunction

Synopsis schedules the given function to run the next time jaws stops speaking.

Description The given function will run the next time jaws stops speaking. Multiple functions may be queued. Functions are run in the order they are added to the queue. Stopping speech by pressing control or performing another such action will clear the queue.

Returns int 1 if the function was queued, 0 otherwise

Param string A string containing a function name. The function name should be followed by parentheses like a normal function call. integers and quoted strings may be included in the parameter list inside the parentheses

Category Scripts

function QuickKeyNavigationModeActive

Description Determines if the Quick Key Navigation mode is on or off.

Returns Int TRUE if on, false otherwise

Category HTML

function ReadSettingInteger

Synopsis Reads an integer value from an ini style file.

Description Reads an integer value from an ini style file or one of the transient settings files for the specified file. An ini style file is a file containing sections of keys with their values. The file that is read from is identified by the FileType parameter and an optional FileName parameter. For some values of the FileType parameter, FT_CURRENT_JCF, FT_SHARED_CURRENT_JCF, and FT_JSI, for which a file name is required, the value returned by GetActiveConfiguration will be used if a file name is not provided via the FileName parameter. When FT_CURRENT_JCF is the file type, and no file name is supplied, the domain-specific file will be used if available.

Returns int The retrieved value or the default value if the key does not exist in the given section. Before using the default value, the value from default.jcf will be checked first, if the file type is FT_CURRENT_JCF is used.

Param string/sectionName The name of the section containing the desired key value. This value must either be a variable or contained in quotes.

Param string/keyName The name of the key whose value is to be retrieved. This value must either be a variable or contained in quotes.

Param int/Default The value that will be returned if the key cannot be retrieved.

Param int/FileType One of the FileType (FT_) constants that identify the type of file and its location. The currently supported file types for reading are as follows: FT_MODULE_INI: The INI file for the current product. For JAWS this file is named JFW.INI. The module INI file is always located in the same directory in which the product is installed. The FileName parameter is ignored for this file type. FT_DEFAULT_JCF: The file Default.JCF. The FileName parameter is ignored for this file type. When reading from this file, the settings stored in the Default.JCF file found in the user settings directory will be layered over the settings stored in the Default.JCF file found in the shared settings directory. FT_CURRENT_JCF: If available, the domain-specific jcf file. Otherwise, any application JCF file. If the FileName parameter is not specified, the value returned by GetActiveConfiguration will be used. When reading from this file, the settings stored in the JCF file found in the user settings directory will be layered over the settings stored in the JCF file found in the shared settings directory. FT_JSI: A JSI file. If the FileName parameter is not specified, the name of the current application will be used. FT_SHARED_DEFAULT_JCF: The file Default.JCF found in the shared settings directory. The FileName parameter is ignored for this file type. When this file type is specified settings will only be read from the copy of the file found in the shared settings directory. FT_SHARED_CURRENT_JCF: Any application JCF file found in the shared settings directory. If the FileName parameter is not specified, the value returned by GetActiveConfiguration will be used. When this file type is specified settings will only be read from the copy of the file found in the shared settings directory.

Optional

Param int/ReadSource One of the ReadSource (rs) constants defined in HJConst.JSH. The possible values are as follows: rsStandardLayering - causes standard layering behavior to be used, the setting will be read from the transient focus file first, then the transient session file, then the user settings file, and finally the shared settings file, stopping at the first file in which the desired setting is found; rsSession - the setting will be read from the transient session settings file, no layering will be used; rsFocus - the setting will be read from the transient focus settings file, no layering will be used; rsNoTransient - the transient settings files will be ignored and the setting will be read from the user settings file layered over the shared settings file. Note that this parameter is ignored if the FileType parameter is FT_MODULE_INI, FT_JSI, FT_SHARED_DEFAULT_JCF, or FT_SHARED_CURRENT_JCF. If this parameter is not specified the default value of rsStandardLayering will be used.

Param string/FileName The name of file to read. This value must either be a variable or contained in quotes. It is unnecessary to specify the full path of the file, only the file name need be specified, since the file used will always be located in either the shared settings directory, the user settings directory, or the personalized settings directory. The FileType parameter is used to determine in which directory the file will be searched for. If this parameter is not specified and a file name is required for the specified file type, the value returned by GetActiveConfiguration will be used. It is not necessary to specify the file extension since the file extension that is appropriate for the specified file type will be added automatically.

Category Files

function ReadSettingString

Synopsis Reads a string value from an ini style file.

Description Reads a string value from an ini style file or one of the transient settings files for the specified file. An ini style file is a file containing sections of keys with their values. The file that is read from is identified by the FileType parameter and an optional FileName parameter. For some values of the FileType parameter, FT_CURRENT_JCF, FT_SHARED_CURRENT_JCF, and FT_JSI, for which a file name is required, the value returned by GetActiveConfiguration will be used if a file name is not provided via the FileName parameter.

Returns string The retrieved value or the default value if the key does not exist in the given section.

Param string/sectionName The name of the section containing the desired key value. This value must either be a variable or contained in quotes.

Param string/keyName The name of the key whose value is to be retrieved. This value must either be a variable or contained in quotes.

Param string/Default The value that will be returned if the key cannot be retrieved. This value must either be a variable or contained in quotes.

Param int/FileType One of the FileType (FT_) constants that identify the type of file and its location. The currently supported file types for reading are as follows: FT_MODULE_INI: The INI file for the current product. For JAWS this file is named JFW.INI. The module INI file is always located in the same directory in which the product is installed. The FileName parameter is ignored for this file type. FT_DEFAULT_JCF: The file Default.JCF. The FileName parameter is ignored for this file type. When reading from this file, the settings stored in the Default.JCF file found in the user settings directory will be layered over the settings stored in the Default.JCF file found in the shared settings directory. FT_CURRENT_JCF: Any application JCF file. If the FileName parameter is not specified, the value returned by GetActiveConfiguration will be used. When reading from this file, the settings stored in the JCF file found in the user settings directory will be layered over the settings stored in the JCF file found in the shared settings directory. FT_JSI: A JSI file. If the FileName parameter is not specified, the name of the current application will be used. FT_SHARED_DEFAULT_JCF: The file Default.JCF found in the shared settings directory. The FileName parameter is ignored for this file type. When this file type is specified settings will only be read from the copy of the file found in the shared settings directory. FT_SHARED_CURRENT_JCF: Any application JCF file found in the shared settings directory. If the FileName parameter is not specified, the value returned by GetActiveConfiguration will be used. When this file type is specified settings will only be read from the copy of the file found in the shared settings directory.

Optional

Param int/ReadSource One of the ReadSource (rs) constants defined in HJConst.JSH. The possible values are as follows: rsStandardLayering - causes standard layering behavior to be used, the setting will be read from the transient focus file first, then the transient session file, then the user settings file, and finally the shared settings file, stopping at the first file in which the desired setting is found; rsSession - the setting will be read from the transient session settings file, no layering will be used; rsFocus - the setting will be read from the transient focus settings file, no layering will be used; rsNoTransient - the transient settings files will be ignored and the setting will be read from the user settings file layered over the shared settings file. Note that this parameter is ignored if the FileType parameter is FT_MODULE_INI, FT_JSI, FT_SHARED_DEFAULT_JCF, or FT_SHARED_CURRENT_JCF. If this parameter is not specified the default value of rsStandardLayering will be used.

Param string/FileName The name of file to read. This value must either be a variable or contained in quotes. It is unnecessary to specify the full path of the file, only the file name need be specified, since the file used will always be located in either the shared settings directory, the user settings directory, or the personalized settings directory. The FileType parameter is used to determine in which directory the file will be searched for. If this parameter is not specified and a file name is required for the specified file type, the value returned by GetActiveConfiguration will be used. It is not necessary to specify the file extension since the file extension that is appropriate for the specified file type will be added automatically.

Category Files

function RedirectToUserBuffer

Synopsis Formats and sends text to the User Buffer and initiates a sayAll.

Description This function formats and sends text to the User Buffer and initiates a sayAll. %modifiers are processed.

Returns Void

Param String/the string to format and send to the User Buffer.

Category Virtual Viewer

function ReformatKeyName

Synopsis Reformats a valid script key name for message output.

Description Takes a valid script key name to reformat and returns a string that contains the reformatted name to use in a message.

Returns String The formatted script key name according to Documentation standards for script key names in messages.

Param string a valid script key name.

Category Scripts

function Refresh

Description Refreshes the screen.

Returns Void

Optional

Param Int/forced 1 means force the refresh, 0, only if needed.

Category Window

function RefreshWindow

Description Refreshes the contents of a window and all windows contained within it. This is much faster than refreshing the entire screen.

Returns Void

Param Handle Handle of window to be refreshed.

Category Window

function RegisterWindowMessage

Description Passes the call through to the Windows API function RegisterWindowMessage.

Returns int A system-wide unique identifier for the message.

Param string String to be registered as a defined windows message.

Category Window

function ReleaseKey

Description Simulates releasing a previously pressed key on the keyboard. This function should be proceeded with a call to PressKey. Once a sequence of PressKey and ReleaseKey calls is complete, call PlayKeys to have JAWS simulate the entire key sequence.

Returns Void

Param string A string value for the key name, these can include alt, control and shift.

Category Keyboard

function ReleaseTestRunner

Description Releases a TestRunner object that was allocated using GetTestRunner.

Param Handle/hRunner The handle of the test runner to be released. This is a handle that was generated in a call to GetTestRunner.

Category Test

function ReloadAllConfigs

Synopsis Reloads all of the current configuration files

Description This function reloads all the current configuration files. This function is useful for instance when you manually make adjustments too default.jss or default.jcf and recompile using the command line compiler and then wish to see the effects without having to restart JAWS.

Category Settings

function ReloadSystemColors

Synopsis Configure JAWS recognition of colors based on the present palette and system colors.

Description JAWS monitors for palette change messages and reloads the system colors appropriately when this message is sent. If, however, an application changes the palette or system colors without broadcasting notification, this function can be used to force JAWS to recognize the modified colors.

Category Colors

function RemoteAccessIsConnected

Synopsis Returns True if JAWS is running in a remote session. Returns FALSE otherwise.

Description This function returns JAWS is running in a remote session such as a Terminal Services session or a Citrix session or is being controlled via PAC Mate Remote. This function returns FALSE otherwise. returns int True if JAWS is running in a remote session. Returns FALSE otherwise.

Category Connection

function RemoveHook

Description Removes a hook function put in place by AddHook.

Param Int The type of hook to be removed. Use the same hook type that was used by AddHook for this parameter. Hook types are defined in HJConst.JSH.

Param string The name of the function to be removed as a hook.

Category Scripts

function ResetEmailInformation

Description Forces the email finder to reset itself. It'll now re-initialize itself when you try to move to the next email.

Returns int 1 is successful, 0 is not.

Category html

function ResetKeyboard

Description When a sequence of PressKey and ReleaseKey calls have been made this function allows the queue of keys to be cleared without executing the key sequence.

Returns Void

Category Keyboard

function ResetSpeechMarkupAttributes

Description This function resets the supplied speech attributes for the last item spoken. After this call, all supplied attributes of the next spoken item are announced.

Optional

Param int/fieldsToReset this is a combination of the attribField constants in hjconst. AttribFields values included here will be reset. Other attributes will be left at their current state.

Category Speech Markup

function ResetSynth

Description Reinitializes the synthesizer with the proper volume, rate, and pitch settings. Used to bring the synthesizer back to normal if it has gotten out of sync with JAWS.

Category Voices

function RestoreCursor

Description Reactivates the cursor that was saved when the SaveCursor function was last used. If the cursor being restored is the JAWS cursor, Invisible cursor, or Braille cursor, then the cursor is also returned to its previous position on the desktop. If the cursor currently in use is different than the cursor that was in use when the SaveCursor function was used, then it is deactivated and the previous cursor is reactivated.

Category Cursors

function RestoreSoundBalance

Description Restores sound balance, so both JAWS and other sounds come from both channels again

Returns int 0 if the operation failed, 1 if it succeeds

Category Sounds

function RestrictViewToEnclosingType

Description Restricts the virtual cursor to the enclosing type.

Returns int True if the virtual cursor was restricted, false otherwise.

Param int The enclosing type to which the virtual cursor will be restricted.

Category HTML

function RGBDecToHex

Synopsis Converts an RGB decimal string to an RGB hex string, eg "240241242" to "#f0f1f2"

Description This function converts a Decimal RGB string to a Hex RGB string.

Returns string The Hex RGB string.

Param string/sRGBDec the Decimal RGB string.

Category Colors

function RGBHexToColor

Synopsis Converts a hex RGB string to its int equivalent.

Description This function converts a hex RGB string to its int color value.

Returns int the color

Param string/sRGBHex the hex string eg "#rrggbb" or "rrggbb"

Category Colors

function RGBHexToDec

Synopsis Converts an RGB Hex string to an RGB Decimal string, eg "#f0f1f2" or "f0f1f2" to "240241242".

Description This function converts a Hex RGB string to a Decimal RGB string.

Returns string the decimal string.

Param string/sRGBHex the hex string to convert.

Category Colors

function RGBStringToColor

Description Converts a 9-digit string of the form "255255255" to a color value.

Returns Int A color value suitable for comparison with the values returned by GetColorText or GetColorBackground.

Param string The 9-digit RGB value to be converted.

Category Colors

function RightMouseButton

Description Used to simulate the clicking of the right button on a mouse. If the function is assigned to a script key and is pressed twice within one second, then this simulates a double click of the mouse button.

Category Mouse

function RightMouseButtonLock

Description This is equivalent to holding down the right mouse button and moving the mouse. It locks the right button down while other tasks are carried out.

Returns Int "POINTER_ATTACHED" = 1, "POINTER_DETACHED" = 0.

Category Mouse

function RouteBrailleToJAWS

Description Repositions the Braille cursor so that it is in the same position as the JAWS cursor.

Category Cursors

function RouteBrailleToPc

Description Repositions the Braille cursor so that it is in the same position as the PC cursor.

Category Cursors

function RouteInvisibleToJAWS

Description Moves the Invisible cursor to the location of the JAWS cursor and activates the Invisible cursor.

Category Cursors

function RouteInvisibleToPc

Description Moves the Invisible cursor to the location of the PC cursor and activates the Invisible cursor.

Category Cursors

function RouteJAWSSoundLeft

Description Routes JAWS sound to the left, and all other sounds to the right.

Returns int 0 if the operation failed, 1 if it succeeds

Category Sounds

function RouteJAWSSoundRight

Description Routes JAWS sound to the right, and all other sounds to the left.

Returns int 0 if the operation failed, 1 if it succeeds

Category Sounds

function RouteJAWSToBraille

Description Repositions the JAWS cursor so that it is in the same position as the Braille cursor.

Category Cursors

function RouteJAWSToInvisible

Description Moves the JAWS cursor to the location of the Invisible cursor and activates the JAWS cursor.

Category Cursors

function RouteJAWSToPc

Description This repositions the JAWS cursor so that it is in the same position as the PC cursor. The JAWS cursor is usually connected to the mouse pointer, so when this function is used, it places the mouse pointer on top of the caret or the highlighted selection cursor, or on whatever other type of pointer that is currently being used.

Category Cursors

function RoutePCToBraille

Description Repositions the PC cursor so that it is in the same position as the Braille cursor.

Category Cursors

function RoutePcToInvisible

Description This attempts to move the PC cursor to the position of the Invisible cursor. This function is the same as a single click of the left mouse button at the position of the invisible cursor, which instructs Windows to move its insertion point to the position of the mouse pointer. The successful use of this function is related to the Windows operating system. There are often situations where Windows cannot move the PC cursor to the mouse pointer.

Category Cursors

function RoutePcToJAWS

Description This attempts to move the PC cursor to the position of the JAWS cursor. This function is the same as a single click of the left mouse button, which instructs Windows to move its insertion point to the position of the mouse pointer. The successful use of this function is related to the Windows operating system. There are often situations where Windows cannot move the PC cursor to the mouse pointer.

Category Cursors

function RoutePCToVirtual

Synopsis Moves the application focus to the location of the virtual cursor

Description This function moves the location of the aplication focus to the location of the virtual cursor.

Returns Int TRUE if the PC cursor's location was successfully moved, FALSE otherwise.

Category Cursors

function RouteVirtualToMouse

Synopsis Moves the Virtual cursor to the position of the mouse cursor in some documents.

Description This function moves the Virtual cursor to the position of the Mouse cursor in documents that are supported by the FS DOM Server.

Category Cursors

function RouteVirtualToPc

Synopsis Moves the Virtual cursor to the position of the PC cursor in an HTML document.

Description This function moves the Virtual cursor to the position of the PC cursor in an HTML document. For example, when a new page loads and a SayAll is initiated and you want to move back to the formfield with the focus, use this function.

Category Cursors

function Run

Description The Run function is used as if you had entered its name and parameters in the Windows Run dialog. If the file name passed as an argument is the name of a program, then that program is run. If it is the name of a directory, then Windows Explorer is run to explore that directory. If the file is not a program but has an extension associated with a particular application, then that application is run to display the file. For example, passing changes.txt as the parameter to the Run function will open Notepad to edit the file changes.txt.

Param string This parameter must be either a text string enclosed in quotes, a variable name that contains a string value, or a script function that returns a string value. In any case, the string needs to be the name of the program you wish to run. It may be necessary to include a path and filename extension. To get the  into the path name, you must actually use two  characters. For example, write c: \jfw32 \jframe.exe. This is very important. Failure to include two  characters will cause the compiler to fail and jscript.exe to perform an illegal operation.

Category System

function RunLookupModuleQuery

Description Run Query either based on the supplied lookup module / rule set combination, or one or more of the optional parameters. You can leave both Rule set and Module blank to use the primary lookup module, or fill in one or both parameters. Fill in just he rule set parameter if you want to use the FS Lookup module. This is the case unless you have written or been supplied with a module dll using the Live Resource Lookup API. Most rule sets that apply to web services will use FSLookup (the default).

Param string/strQuery The text to send to the lookup module and rule set combination.

Optional

Param string/sRuleSet The rule set to apply to the supplied Lookup module. If no module was supplied, the FSLookup module will be used. Leave this param blank if you are using the primary (default) or your module does not accept rule sets.

Param string/sModule Optional lookup module to use. If not supplied, the FSLookup Module will be used.

Param string/strError optional error string to use if the query causes Invoke to return 0 or the string is empty

Category Research It

function RunLookupModuleQueryUsingListOfModules

Description Generates a list of rule set - lookup module combinations, and generates a query based on the incoming text and the user's choice from the list.

Param string The query to use - generally the word or selection at the active cursor.

Category Research It

function RunSelectionContextEvents

Synopsis enables the scripter to force the selection context events to be rerun

Description This function may be called from SayFocusedWindow or other places when it is necessary for the Selection Context Events to be rerun

Returns void

Category Object Model and MSAA

function RunTestSuite

Description Run a suite of automated tests.

Param Handle/hRunner The handle of the test runner to be released. This is a handle that was generated in a call to GetTestRunner.

Category Test

function SALModeButton

Description Speaks the appropriate "SAL mode" representation of a braille cell

Param Int/Column number Number of the braille cell to speak

Param Int/Type 0 to speak the character at the cell location, 1 to speak and spell the word at the location.

Category Braille Keyboard

function SaveCurrentLocation

Synopsis Remembers the current location for a subsequent operation

Description This function remembers the current location for a subsequent operation such as selection between this and a subsequent location.

Returns void

Category Cursors

function SaveCursor

Description Saves the name of the active cursor. If the JAWS cursor, Invisible cursor, or Braille cursor is being used, then the position of the cursor is also saved. Scripts that use the SaveCursor function usually use the RestoreCursor function.

Category Cursors

function Say

Description Speak a string of text using a specific set of speech characteristics called output modes. It is possible to use separate output modes to speak title lines, dialog controls, menu items, etc. By using the SayMessage function instead, you will be able to assign short and long messages to many output types for JAWS Help and other information. With Desktop JAWS 5 and later, we suggest that you no longer speak control type and state information with this function. Instead, use IndicateControlType and IndicateControlState. Type information includes messages such as "edit" or "button." State information includes messages such as "checked" or "not checked." Note that in JAWS 12 or later, Settings Center replaces Configuration Manager.

Param string Type the text that is to be spoken, or specify a variable name or script function that can provide the required text string. Text strings that are typed must be enclosed within quotation marks.

Param Int Type the constant name that represents the output mode to be used when speaking this text. See the JFW documentation for specific uses of different output modes. In many cases, these are specific, and can be disabled from within Settings Center, should the user select not to hear a specific type of information. Examples of output modes are: OT_HELP, OT_JAWS_MESSAGE or OT_STATUS. Note that in JAWS 12 or later, Settings Center replaces Configuration Manager.

Optional

Param Int With Desktop JAWS 5 or later, enter TRUE if your string is marked up with behaviors, e.g. you used any of the SMM functions.

Category Say

function SayActiveCursor

Description This speaks the name of the active cursor, for example, PC, JAWS, Invisible, or Braille.

Category Cursors

function SayAll

Description This says the active window from the position of the active cursor to the bottom of the window. The cursors move as text is read. If the PC cursor is active the window will scroll to display additional text.

Optional

Param Int/bUseSayAllSynthesizer This parameter may be used to indicate whether or not the Say All speech synthesizer should be used. The default value of this parameter if FALSE which causes JAWS to use the primary speech synthesizer for the Say All operation.

Category Screen Text

function SayAllBy

Synopsis Determines what method of Say All is used.

Description Determines whether say all will read by line, sentence, or paragraph.

Returns String description of value to be displayed as value of SayAllBy

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned

Category Screen Text

function SayAllInProgress

Description determines if sayAll is active.

Returns Int TRUE or FALSE

Category Voices

function SayAllReadsBy

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function SayCell

Description When in a table or spreadsheet, speaks the contents of the current cell.

Returns Int TRUE if in a table, FALSE otherwise

Category Tables

function SayCharacter

Description This says the character or graphic located at the position of the active cursor.

Optional

Param Int/IncludeMarkup This optional parameter was added in JAWS 10.0. The default value for the parameter is TRUE. This parameter controls whether markup information is included when the text of the character is returned.

Category Screen Text

function SayCharacterByExample

Description Says a character by example.

Optional

Param String character to speak. If not provided, speaks the character at the current cursor.

Category IME

function SayCharacterPhonetic

Description Uses special pronunciation rules to read the character located at the position of the active cursor. For example, A is pronounced alpha, B bravo, etc. The association between characters and their phonetic pronunciations are made in the [PhoneticSpell] section of .JCF files.

Category Screen Text

function SayChunk

Description Says the chunk of information to which the active cursor is pointing. A chunk is text and graphic information that was written to the screen in a single operation. SayChunk is similar to SayField. However, the SayField function uses logic to determine the text that is to be spoken, while SayChunk simply reads the text that was stored in the off screen model as a single unit.

Returns Void

Category Screen Text

function SayColor

Description Speaks the names of the foreground and background colors of the text at the location of the active cursor.

Returns Int "TRUE" = 1, Text was found. "FALSE" = 0, cursor was not pointing to text.

Optional

Param int/bSpeakRGB if true, speaks the RGB value of the colors, otherwise speaks the name. If an exact match on name isn't found, an approximation is used. This optional parameter is only available in JAWS 5.10 or higher.

Category Colors

function SayColumnHeader

Description When in a table or spreadsheet, speaks the contents of the column header.

Returns Int TRUE if in a table, FALSE otherwise.

Category Tables

function SayControl

Description Used in dialog boxes to speak the contents of a child window along with its prompt. It reads Edit fields, list boxes, check boxes, radio buttons, etc.

Param Handle The information that is spoken by this function is determined by the window handle that is used as a parameter. Type a variable name or choose a script function that can provide a window handle.

Category Dialog Controls

function SayControlEx

Synopsis Handles the speaking of controls for which SayWindowTypeAndText and related functions do not sufficiently describe the control.

Description This function is designed to be used in the script language to speak a control that requires custom processing (any control for which SayWindowTypeAndText does not properly speak the name and type of the control). This function is designed to honor the user's output mode settings for each component of the control's description. This function takes nine parameters, eight of which are string parameters. The first parameter is the window handle of the control that is to be spoken. The next eight parameters include one parameter for each component of a control's description. Each string parameter has a corresponding Output Mode. The eight string parameters are String strControlName = Either OT_DIALOG_NAME, OT_DOCUMENT_NAME, or OT_CONTROL_NAME, depending on the type of window that is to be spoken, String strControlType = OT_CONTROL_TYPE, String strControlState = OT_ITEM_STATE, String strContainerName = OT_CONTROL_GROUP_NAME, String strContainerType = OT_CONTROL_TYPE, String strValue = OT_SELECTED_ITEM, String strPosition = OT_POSITION, String strDialogText = OT_DIALOG_TEXT. This function works by building a string based upon the five components of the control description, adding each component only if the user has specified that this item should speak in the current verbosity level. Then this function calls Say with the constructed string as the first parameter and OT_NO_DISABLE as the second parameter. If any portion of the control description is not specified, JFW will obtain the default value for that component of the control description and will add the default value of that component to the control description string. Therefore, if SayWindowTypeAndText speaks every part of a control correctly other than the Control Type, you can call SayControlEx and pass it the Window Handle and the text you would like to be spoken and pass a null string (",") to the function for the remainder of the parameters. SayControlEx will obtain the default values for the control type, control st. ate, container name, container type, control value, control positional information, and the dialog text if the specified window is the top level window of a dialog box using the same methods as SayWindowTypeAndText and it will include these values in the control description string that is spoken.

Returns Int Returns 1 if the function sucessfully assembled the control description string and spoke the control description (i.e. the length of the control description string was equal to 0). If for some reason the function failed to assemble the control description string, the function returns 0. One reason why this function would return 0 is that the user has specified that all the output modes be turned off in the current verbosity level.

Param Handle/hwndControl The window handle of the control.

Optional

Param String/strControlName The name of the control. This parameter is assigned an Output Mode of either OT_DIALOG_NAME, OT_DOCUMENT_NAME, or OT_CONTROL_NAME, depending on the type of window that is to be spoken. If the window that is to be spoken has a window type of WT_DIALOG, this parameter is assigned an Output Mode of OT_DIALOG_NAME. If the specified window is the App Main Window or Real Window, it is assigned an Output Mode of OT_DOCUMENT_NAME. Otherwise it is assigned an Output Mode of OT_CONTROL_NAME.

Param String/strControlType The control type. This parameter is assigned an Output Mode of OT_CONTROL_TYPE.

Param String/strControlState The control state. This parameter is assigned an Output Mode of OT_ITEM_STATE.

Param String/strContainerName The name of the control container box. For example, if this control is part of a group box, this paramater would be the name of the group box. This parameter is assigned an Output Mode of OT_CONTROL_GROUP_NAME.

Param String/strContainerType The control type of the control container. This parameter is assigned an Output Mode of OT_CONTROL_TYPE. It is only spoken if the user has specified that both OT_CONTROL_GROUP_NAME and OT_CONTROL_TYPE are enabled.

Param String/strValue The current value of the control. For example, if the specified control is a list box, the current value of the control is the text of the selected item in the list box. This parameter is assigned an output mode of OT_SELECTED_ITEM.

Param String/strPosition Any relevant positional information for the control. For example if the specified control is a list box, the relevant positional information for the control is the index of the selected item in the list box. This parameter is assigned an output mode of OT_POSITION.

Param String/strDialogText If the specified control is the top level window of a dialog box, this parameter specifies the text that is to be spoken as the static text of the dialog box. This parameter is assigned an output mode of OT_DIALOG_TEXT.

Category Dialog Controls

function SayControlExWithMarkup

Synopsis Handles the speaking of controls for which SayWindowTypeAndText and related functions do not sufficiently describe the control. this function however uses Speech Markup and assumes all parameters are correctly marked up.

Description This function is designed to be used in the script language to speak a control that requires custom processing (any control for which SayWindowTypeAndText does not properly speak the name and type of the control). This function is designed to honor the user's output mode settings for each component of the control's description. This function takes nine parameters, eight of which are string parameters. The first parameter is the window handle of the control that is to be spoken. The next eight parameters include one parameter for each component of a control's description. Each string parameter has a corresponding Output Mode. The eight string parameters are String strControlName = Either OT_DIALOG_NAME, OT_DOCUMENT_NAME, or OT_CONTROL_NAME, depending on the type of window that is to be spoken, String strControlType = OT_CONTROL_TYPE, String strControlState = OT_ITEM_STATE, String strContainerName = OT_CONTROL_GROUP_NAME, String strContainerType = OT_CONTROL_TYPE, String strValue = OT_SELECTED_ITEM, String strPosition = OT_POSITION, String strDialogText = OT_DIALOG_TEXT. This function works by building a string based upon the five components of the control description, adding each component only if the user has specified that this item should speak in the current verbosity level. Then this function calls Say with the constructed string as the first parameter, OT_NO_DISABLE as the second parameter and specifies that the string contains Speech Markup. If any portion of the control description is not specified, JFW will obtain the default value for that component of the control description and will add the default value of that component to the control description string. Therefore, if SayWindowTypeAndText speaks every part of a control correctly other than the Control Type, you can call SayControlExWithMarkup and pass it the Window Handle and the text you would like to be spoken and pass a null string (",") to the function for the remainder of the parameters. SayControlExWithMarkup will obtain the default values for the control type, control state, container name, container type, control value, control positional information, and the dialog text if the specified window is the top level window of a dialog box using the same methods as SayWindowTypeAndText and it will include these values in the control description string that is spoken. Note that this version of the function assumes that all parameters are using speech markup, ie they contain correct xml markup including symbol replacement (eg < with < etc. This allows a control's type or state or value to be marked up to play sounds, change voice etc.

Returns Int Returns 1 if the function successfully assembled the control description string and spoke the control description (i.e. the length of the control description string was equal to 0). If for some reason the function failed to assemble the control description string, the function returns 0. One reason why this function would return 0 is that the user has specified that all the output modes be turned off in the current verbosity level.

Param Handle/hwndControl The window handle of the control.

Optional

Param String/strControlName The name of the control. This parameter is assigned an Output Mode of either OT_DIALOG_NAME, OT_DOCUMENT_NAME, or OT_CONTROL_NAME, depending on the type of window that is to be spoken. If the window that is to be spoken has a window type of WT_DIALOG, this parameter is assigned an Output Mode of OT_DIALOG_NAME. If the specified window is the App Main Window or Real Window, it is assigned an Output Mode of OT_DOCUMENT_NAME. Otherwise it is assigned an Output Mode of OT_CONTROL_NAME.

Param String/strControlType The control type. This parameter is assigned an Output Mode of OT_CONTROL_TYPE.

Param String/strControlState The control state. This parameter is assigned an Output Mode of OT_ITEM_STATE.

Param String/strContainerName The name of the control container box. For example, if this control is part of a group box, this paramater would be the name of the group box. This parameter is assigned an Output Mode of OT_CONTROL_GROUP_NAME.

Param String/strContainerType The control type of the control container. This parameter is assigned an Output Mode of OT_CONTROL_TYPE. It is only spoken if the user has specified that both OT_CONTROL_GROUP_NAME and OT_CONTROL_TYPE are enabled.

Param String/strValue The current value of the control. For example, if the specified control is a list box, the current value of the control is the text of the selected item in the list box. This parameter is assigned an output mode of OT_SELECTED_ITEM.

Param String/strPosition Any relevant positional information for the control. For example if the specified control is a list box, the relevant positional information for the control is the index of the selected item in the list box. This parameter is assigned an output mode of OT_POSITION.

Param String/strDialogText If the specified control is the top level window of a dialog box, this parameter specifies the text that is to be spoken as the static text of the dialog box. This parameter is assigned an output mode of OT_DIALOG_TEXT.

Category Dialog Controls

function SayControlInformation

Synopsis Handles the speaking of controls for which SayWindowTypeAndText and related functions do not sufficiently describe the control.

Description This function is designed to be used in the script language to speak a control that requires custom processing (any control for which SayWindowTypeAndText does not properly speak the name and type of the control). This function is designed to honor the user's output mode settings for each component of the control's description. This function takes six parameters, five of which are string parameters. The first parameter is the window handle of the control that is to be spoken. The next five parameters include one parameter for each component of a control's description. Each string parameter has a corresponding Output Mode. The 5 string parameters are String strControlName = Either OT_DIALOG_NAME, OT_DOCUMENT_NAME, or OT_CONTROL_NAME, depending on the type of window that is to be spoken, String strControlType = OT_CONTROL_TYPE, String strControlState = OT_ITEM_STATE, String strContainerName = OT_CONTROL_GROUP_NAME, and String strContainerType = OT_CONTROL_TYPE. This function works by building a string based upon the five components of the control description, adding each component only if the user has specified that this item should speak in the current verbosity level. Then this function calls Say with the constructed string as the first parameter and OT_NO_DISABLE as the second parameter.

Returns Int Returns 1 if the function successfully assembled the control description string and spoke the control description (i.e. the length of the control description string was equal to 0). If for some reason the function failed to assemble the control description string, the function returns 0. One reason why this function would return 0 is that the user has specified that all the output modes be turned off in the current verbosity level.

Optional

Param String/strControlName The name of the control. This parameter is assigned an Output Mode of either OT_DIALOG_NAME, OT_DOCUMENT_NAME, or OT_CONTROL_NAME, depending on the type of window that is to be spoken. If the window that is to be spoken has a window type of WT_DIALOG, this parameter is assigned an Output Mode of OT_DIALOG_NAME. If the specified window is the App Main Window or Real Window, it is assigned an Output Mode of OT_DOCUMENT_NAME. Otherwise it is assigned an Output Mode of OT_CONTROL_NAME.

Param String/strControlType The control type. This parameter is assigned an Output Mode of OT_CONTROL_TYPE.

Param String/strControlState The control state. This parameter is assigned an Output Mode of OT_ITEM_STATE

Param String/strContainerName The name of the control container box. For example, if this control is part of a group box, this paramater would be the name of the group box. This parameter is assigned an Output Mode of OT_CONTROL_GROUP_NAME.

Param String/strContainerType The control type of the control container. This parameter is assigned an Output Mode of OT_CONTROL_TYPE. It is only spoken if the user has specified that both OT_CONTROL_GROUP_NAME and OT_CONTROL_TYPE are enabled.

Category Dialog Controls

function SayCurrentScriptKeyLabel

Synopsis Speaks the key name attached to the script.

Description Speaks the Key Name attached to the current script, honoring both the typing echo setting and the label as defined in DEFAULT.JCF.

Category Scripts

function SayCursorPos

Description This speaks the row and column position of a cursor. The row and column spoken is based upon the number of pixels of the active cursor position from the top left corner of the screen.

Param Int Type the constant value that represents a cursor, type a variable name, or choose a script function. Cursor constants are: CURSOR_JAWS, CURSOR_PC, CURSOR_INVISIBLE, CURSOR_Braille. A script function such as GetActiveCursor also can provide the constant.

Optional

Param int desired units of measure, see hjconst.jsh smmUnitsOfMeasure constants. (This optional parameter added in JAWS 9.0.

Category Cursors

function SayDebugger

Synopsis Used to debug various say functions.

Description Call SayDebugger in various say functions to add the debug info to the say debug log when it is on.

Param string The name of the function calling the debugger.

Optional

Param variant/Param1, the first parameter used by the calling function.

Param variant/Param2, the second parameter used by the calling function.

Param variant/Param3, the third parameter used by the calling function.

Param variant/Param4, the fourth parameter used by the calling function.

Param variant/Param5, the fifth parameter used by the calling function.

Param variant/Param6, the sixth parameter used by the calling function.

Param variant/Param7, the seventh parameter used by the calling function.

Param variant/Param8, the eighth parameter used by the calling function.

Param variant/Param9, the ninth parameter used by the calling function.

Category Utility

function SayField

Description This says the field of text where the active cursor is pointing. A field of text is a section or block of text that has a common attribute such as bold, underlined, italics, or strikeout. The use of the attribute must be contiguous. The SayField function uses logic to determine the text that is to be spoken, while the SayChunk function simply says what JAWS considers to be a single block of text.

Optional

Param int If true, and the cursor is at the offset just after the last character of text in the field, jaws speaks the preceding field.

Category Screen Text

function SayFocusRect

Description Says the contents of focus rectangle. Returns TRUE if any text was spoken, FALSE otherwise.

Returns Int "True" or "False", 1 or 0.

Param Handle Handle of window.

Category Window

function SayFocusRects

Description Says the contents of focus rectangles. If there is only one such rectangle, this acts like SayFocusRect, which says only the first one. If there is more than one, says the contents of all of them.

Returns Int TRUE if text was spoken, FALSE otherwise.

Param Handle Handle of window.

Category Window

function SayFont

Description Identifies the font name, font size, and font attributes (For example: bold, underline, italic) that are associated with the character at the active cursor. The information that is reported is for the font that appears on the desktop, and usually does not correspond to the size of the font that will be printed on a printer. Refer to "FONTSIZE.TXT" in the \JFWxx \TECNOTES subdirectory for tips on working with fonts.

Category Text Format

function SayFormattedMessage

Synopsis Formats the messages which are passed, and speaks a message based on the specified output type.

Description This function takes short and long messages and speaks the appropriate message based on the given output type. The messages which are passed may have formatting strings such as %KeyFor() in them, as they will be formatted by the function. If using the output mode OT_USER_BUFFER, to place text in the User Buffer, do not include the short message as it will be ignored. With Desktop JAWS 5 and later, we suggest that you no longer speak control type and state information with this function. Instead, use IndicateControlType and IndicateControlState. Type information includes messages such as "edit" or "button." State information includes messages such as "checked" or "not checked."

Param Int/iOutputType The constant representing the desired output type for the given set of messages. A list of available output type constants can be found in hjconst.jsh.

Param String/sLong A quoted string of text, a message constant, or a string variable containing the desired long message. If you require only one message, enter it for this parameter and leave the third parameter blank

Optional

Param String/sShort A quoted string of text, a message constant, or a string variable containing the desired short message. If you would like the short message to speak nothing, enter the constant msgSilent for this parameter. If using the output type OT_USER_BUFFER, enter nothing at all.

Param Variant item to be substituted in place of %1 every time it appears in Message.

Param Variant item to be substituted in place of %2 every time it appears in Message.

Param Variant item to be substituted in place of %3 every time it appears in Message.

Param Variant item to be substituted in place of %4 every time it appears in Message.

Param Variant item to be substituted in place of %5 every time it appears in Message.

Param Variant item to be substituted in place of %6 every time it appears in Message.

Param Variant item to be substituted in place of %7 every time it appears in Message.

Param Variant item to be substituted in place of %8 every time it appears in Message.

Param Variant item to be substituted in place of %9 every time it appears in Message.

Category Strings

function SayFormattedMessageWithvoice

Description This function speaks long and short messages in the desired voice and output type.

Param String/sVoiceType One of the VCTX voice type constants.

Param Int/iOutputType One of the available output types for speaking messages.

Param String/SMsgLong The long message to be spoken.

Optional

Param String/smsgShort The short message to be spoken.

Param Variant item to be substituted in place of %1 every time it appears in Message.

Param Variant item to be substituted in place of %2 every time it appears in Message.

Param Variant item to be substituted in place of %3 every time it appears in Message.

Param Variant item to be substituted in place of %4 every time it appears in Message.

Param Variant item to be substituted in place of %5 every time it appears in Message.

Param Variant item to be substituted in place of %6 every time it appears in Message.

Param Variant item to be substituted in place of %7 every time it appears in Message.

Param Variant item to be substituted in place of %8 every time it appears in Message.

Param Variant item to be substituted in place of %9 every time it appears in Message.

Category Strings

function SayFrame

Description Speaks the contents of a specific frame.

Returns Int TRUE if the desired frame exists, FALSE otherwise.

Param string The name of the frame to speak.

Category Frames

function SayFrameAtCursor

Description Speaks the contents of the frame that surrounds the location of the current cursor.

Returns Int TRUE if a frame surrounds the current cursor, FALSE otherwise.

Category Frames

function SayFromCursor

Description Reads text on the current line that is located to the right of the current cursor. It will read the character that is being pointed to by the insertion point or active cursor.

Category Screen Text

function SayInteger

Description This speaks a string of numeric data.

Param Int Type a variable name or choose a script function that will provide numeric data.

Optional

Param int/Base Allows the number to be spoken in something other than base 10. Acceptable values are 2 through 16.

Category Say

function SayLine

Description This says a line of text where the active cursor is located. JAWS must interpret whether text that has a similar vertical position is on the same line. When the PC cursor is active, it only reads the information that is within the active child window. When it is used with other cursors, then it reads from one edge of the application window to the other.

Optional

Param Int/iDrawHighlights Optional parameter added in JAWS 7.1. Used to indicate whether or not the line should be highlighted as the text is being spoken. The possible values are as follows: If the parameter is not present or is equal to 0, do nothing; If the parameter is equal to 1, highlight each word as it is being spoken; If the parameter is equal to 2, highlight the entire line.

NOTES (1) This functionality is not currently supported in all applications. (2) The highlight rectangles will only be drawn if MAGic is running.

Param int/bDoNotUseObjInfo Set this parameter to TRUE to avoid speaking object information such as the prompt of an object as part of this line. This parameter is most often set to true when this function is called from the SayNextLine and SayPriorLine scripts to avoid speaking the prompt when arrowing over forms mode controls whose prompt is already spoken from the prior line. This parameter is available starting with JAWS version 10.

Category Screen Text

function SayMessage

Synopsis Speaks the given message based on the specified output type.

Description This function takes short and long messages and speaks the appropriate message based on the given output type. If using the output type of OT_USER_BUFFER, which is designed to present text in the User buffer, do not use the short message as it will be ignored. With Desktop JAWS 5 and later, we suggest that you no longer speak control type and state information with this function. Instead, use IndicateControlType and IndicateControlState. Type information includes messages such as "edit" or "button." State information includes messages such as "checked" or "not checked"

Param Int/iOutputType The constant representing the desired output type for the given set of messages. A list of available output type constants can be found in hjconst.jsh.

Param String/sLong A quoted string of text, a message constant, or a string variable containing the desired long message. If you require only one message, enter it for this parameter and leave the third parameter blank

Optional

Param String/sShort A quoted string of text, a message constant, or a string variable containing the desired short message. If you would like the short message to speak nothing, enter the constant cmsgSilent for this parameter. For the user buffer (OT_USER_BUFFER), enter nothing at all.

Category Say

function SayObjectActiveItem

Description Says the active element in certain controls. For example in a list view, it will say the selected item. In a menu, it will say the active menu item. In a dialog box, it will say the selected tab.

Returns Void

Optional

Param int/AnnouncePosition As of JAWS 8.0, TRUE if you wish to have JAWS announce positional information such as n of m items, FALSE otherwise.

Category Object Model And MSAA

function SayObjectTypeAndText

Description Speaks the name and type of the object located at the current cursor's location. It is the most reliable way of obtaining such information. It should be used instead of SayWindowTypeAndText which has been retained for backward compatibility. The two functions are similar, but SayObjectTypeAndText is able to handle objects supported by MSAA, and the case where multiple objects are contained within the same window. When this function is used, it marks the text it reads so that the Say Highlighted Text and Say NonHighlighted Text functions do not repeat the same information when they are triggered.

Optional

Param int/nLevel Which object in the hierarchy should be spoken. 0, which is the default, refers to the object with focus. 1 refers to the parent of the focus object, 2 refers to the grandparent, etc.

Param int/includeContainerName if not supplied, assumed to be true.

Param Int/drawHighlight Optional parameter used to indicate whether or not the line should be highlighted by the Visual Tracking, ZoomText or Fusion as the text is being spoken. The possible values are as follows: If the parameter is not present or is equal to false, do nothing; If the parameter is true, highlight the object being spoken.

NOTES (1) This functionality is not currently supported in all applications. (2) The highlight rectangles will only be drawn if Visual Tracking is enabled or ZoomText/Fusion is running.

Category Object Model And MSAA

function SayParagraph

Description Reads the paragraph containing the character on which the active cursor is positioned.

Returns Int TRUE if a paragraph was found at the current cursor location, FALSE otherwise.

Optional

Param int/bOnlyUseEditInterfaces If true, and we fail to get paragraph information by using more advanced interfaces, don't attempt to read paragraph text using the information written on the screen. This is useful for quelling extra verbiage in specific situations. Setting this parameter to true is not recommended. The default value, if the parameter is not specified, is FALSE. Please note this parameter is only available in JAWS versions later than 8.0, with a build number greater than 1000.

Category Screen Text

function SayPhraseByExample

Description Says a phrase by example.

Optional

Param String phrase to speak. If not provided, speaks the phrase at the current cursor.

Category IME

function SayRowHeader

Description When in a table or spreadsheet, speaks the contents of the row header.

Returns Int TRUE if in a table, FALSE otherwise.

Category Tables

function SaySentence

Description Reads the sentence containing the character on which the active cursor is positioned.

Returns Int TRUE if a sentence was found at the current cursor location, FALSE otherwise.

Category Screen Text

function SayString

Description The SayString makes the speech synthesizer speak a message. This function is now obsolete since the implementation of the sayMessage function. This function remains for the purpose of testing and debugging. If you are developing new scripts, it is recommended that you do not use this function. Instead, use the SayMessage function.

Param string This parameter must be either a text string enclosed in quotes, a variable name that contains a string value, or a function that returns a string value.

Category Say

function SayTextBetween

Description Says the text between two points on the screen.

Returns Int TRUE if text spoken, FALSE otherwise.

Param Int/left coordinate of left edge of area to speak.

Param Int/right coordinate of right edge of area to speak.

Optional

Param Int/CoordinateSystem The Coordinate System to be used to interpret left and right. The default is to interpret them as pixel locations on the screen. See the COORDSYS_xxx constants in hjconst.jsh.

Category Screen Text

function SayToBottom

Description Says the active window from the position of the active cursor to the bottom of the window. The cursors do not move as text is read, the window will not scroll to display additional text.

Returns Void

Category Window

function SayToCursor

Description Reads text on the current line that is located to the left of the active cursor. It does not read the character that is being pointed to by the insertion point or active cursor.

Category Screen Text

function SayToPunctuation

Description Speaks text between the current cursor and the end of the line or the next punctuation symbol, which ever comes first.

Category Screen Text

function SayUsingVoice

Description Speak a string of text using a specific synthisizer voice.

Param String Type in the constant representing the voice to be used. These constants are defined in the file hjconst.jsh and are listed below: VCTX_GLOBAL, VCTX_MESSAGE, VCTX_KEYBOARD, VCTX_SCREEN, VCTX_PCCURSOR, VCTX_JAWSCURSOR

Param String Type the text that is to be spoken, or specify a variable name or script function that can provide the required text string. Text strings that are typed must be enclosed within quotation marks.

Param Int Type in one of the following constants that represent the output mode to be used: OT_STRING, OT_LINE, OT_WORD, OT_CHAR, OT_FIELD, OT_CHUNK, OT_SAYALL, OT_SPELL, OT_PHONEMIC, OT_APP_NAME, OT_DIALOG_NAME, OT_CONTROL_NAME, OT_MDI_NAME, OT_WINDOW_NAME, OT_GRAPHIC, OT_HELP, OT_STATUS, OT_SELECTED, OT_TEXT, OT_POSITION, OT_STATIC, OT_FONT, OT_KEYBOARD, OT_CURSOR, OT_DEBUG.

Optional

Param Int If true, indicates that the text contains speech markup. The default is false.

Category Voices

function SayWindow

Description Reads the specified window. It reads either highlighted text or all text in the window.

Param Handle Type the name of a variable or choose a script function that provides the handle of the window that is to be spoken.

Param Int Type a constant to determine how much information is to be read: "READ_EVERYTHING" = 0, "READ_HIGHLIGHTED" = 1.

Category Window

function SayWindowTypeAndText

Description Reads a specified series of information from a window. It reads the window title (when one is present), the window type, the contents in the window, and provides related information about the current dialog option. This function marks the text it reads so that the Say NonHighlighted text and Say Highlighted text functions do not repeat the same information when they are triggered.

Param Handle Type the name of a variable or choose a script function that provides the handle of the window that is to be read.

Category Window

function SayWord

Description This says the word or graphic located at the position of the active cursor.

Category Screen Text

function ScheduleFunction

Description Runs a user defined function in a set period of time. Useful when you want to perform a task and then check on the results at a later time. Once this function is used, you can call UnScheduleFunction to cause the user-defined event not to run.

Returns Int An ID that can be used to call UnScheduleFunction. If 0 is returned, then the timer was not successfully set.

Param String/FunctionName Name of function to be executed.

Param Int/Time Amount of time to elapse before the function is executed. Time is measured in tenths of a second. A value of 10 is one second.

Optional

Param int/autoKillOnKeyPressOrFocusChange This parameter ensures that the function is automatically unscheduled if a focus change or menu mode change occurs, or a key is pressed, prior to the scheduled function being run.

Category Scripts

function ScheduleFunctionAfterWindowGainsFocus

Synopsis Schedules a function to run the next time a given window gains focus.

Description This function may be used to schedule a function to run the next time a given window gains focus. The function is scheduled using the same mechanism that is used by the ScheduleFunction function. The ScheduleFunction function will be called to schedule the function specified by the FunctionName parameter the next time a Focus Changed Event occurs and the window handle of the window that just gained focus is the same as the window handle specified by the hwnd parameter. Unlike the ScheduleFunction function, the value returned by the ScheduleFunctionAfterWindowGainsFocus is not an ID that can be used for a latter call to UnScheduleFunction. Instead the value returned by this function indicates whether or not the function was scheduled successfully. Currently there is no mechanism for un-scheduling a function that is scheduled using this function. Another key difference between this function and the ScheduleFunction function is only one function can be scheduled at a time using this mechanism. If ScheduleFunctionAfterWindowGainsFocus is called when a function that was previously scheduled using this function has not yet been called, the function will not be scheduled and this function will return FALSE. The function specified by the FunctionName parameter will be scheduled at the end of focus change event processing, after any necessary scripts have been loaded and the FocusChangedEvent function has been called.

Returns int TRUE when the specified function was successfully scheduled. FALSE otherwise.

Param Handle/hwnd The window handle of the window to wait to gain focus before scheduling the function.

Param String/FunctionName Name of function to be executed.

Param Int/TimeOut Maximum amount of time, in milliseconds, that the function should wait before canceling the scheduled function. Note that this script function returns immediately without waiting for the specified amount of time. Instead, whenever a Focus Changed event is processed a check is performed to determine whether or not there is an unprocessed request to schedule a function after a given window gains focus. If there is and the function has timed out, the scheduled function is canceled.

Category Scripts

function ScreenEcho

Description Cycles through the various settings for screen echo. The screen echo setting determines the amount of information that is to be read as the information is displayed on the desktop. The Say NonHighlighted text and Say Highlighted text functions often check the setting for screen echo before deciding how much information to speak.

Category Screen Text

function ScreenEchoSet

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function ScreenEchoToggle

Synopsis Switches the screen echo between echoing Highlighted text, All text, and None.

Description Toggles the screen echo. The default is Highlighted, which speaks only highlighted text when it appears on the screen. "All" speaks all the text that gets written to the screen, and "None" speaks none of the text.

Returns String description of value to be displayed as value of Screen Echo.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category Screen Text

function ScreenGetHeight

Description Gets the height of the screen in pixels.

Returns Int The height of the screen in pixels.

Category System

function ScreenGetWidth

Description Gets the width of the screen in pixels.

Returns Int The width of the screen in pixels.

Category System

function ScreenStabilizedEvent

Synopsis Called when the screen has become stable.

Description This event is triggered after no screen writes have occured within a reasonable amount of time. The window handle of the last window to which text was written is passed as the parameter to this event.

Returns Void

Param Handle/hwndLastTextWrite the window handle where the last text write occured.

Category Screen Text Events

function SDMGetControlActiveItem

Description Used with SDM windows to get an item's text. This function is only used with SDM windows and not with regular dialog windows.

Returns String Provides the item's text. When an item's text is not present, the null value of " ," is returned.

Param Handle Type the name of a variable or choose a script function that provides the handle of the window that is to be read. The GetFocus function is often used to provide the handle of the SDM window.

Param Int Use the SDMGetFocus function to provide the control ID for the active child window of the dialog box.

Category Dialog Controls

function SDMGetControlName

Description Used with SDM windows to get an item's control name. This function is only used with SDM windows and not with regular dialog windows.

Returns String Provides the item's control name. When an item's text is not present, the null value of " ," is returned.

Param Handle Type the name of a variable or choose a script function that provides the handle of the window that is to be read. The GetFocus function is often used to provide the handle of the SDM window.

Param Int Use the SDMGetFocus function to provide the control ID for the active child window of the dialog box.

Category Dialog Controls

function SDMGetControlSubtypeCode

Description Obtains the window subtype code number for the specified window and control ID.

Returns Int The window subtype number for the specified window and control ID.

Param Handle This function provides information for the window that is identified by a window handle. Type a variable name or choose a script function to provide the window handle it needs.

Param Int Use the SDMGetFocus function to provide the control ID for the active child window of the dialog box.

Category Dialog Controls

function SDMGetControlValue

Description Used with SDM windows to get an edit field's contents. This function is only used with SDM windows and not with regular dialog windows.

Returns String Provides the item's value

Param Handle Type the name of a variable or choose a script function that provides the handle of the window that is to be read. The GetFocus function is often used to provide the handle of the SDM window.

Param Int Use the SDMGetFocus function to provide the control ID for the active child window of the dialog box.

Category Dialog Controls

function SDMGetCurrentControl

Description Retrieves the ID of the control on which the active cursor is positioned inside an SDM dialog box.

Returns Int The ID of the SDM control in which the active cursor is positioned, or 0 if not inside an SDM dialog box.

Category Dialog Controls

function SDMGetFirstControl

Description Obtains the control ID of the first dialog option in an SDM dialog box. It can provide the control ID that is needed by the SDMSayControl function.

Returns Int Provides control ID.

Param Handle Type a variable name or choose a script function that can provide the window handle for the SDM dialog box. The GetFocus function is often used to provide the handle.

Category Dialog Controls

function SDMGetFocus

Description Used to get the control ID of the active dialog option or control in an SDM dialog box. This function is most often used as a parameter for the SDMSayWindowTypeAndText function to provide it with a control ID.

Returns Int Provides The control ID within an SDM dialog.

Param Handle Use the GetFocus function to obtain the handle of the current SDM window.

Category Dialog Controls

function SDMGetLastControl

Description Provides the control ID for the last option in an SDM dialog box. It can provide the control ID that is needed by the SDMSayControl function.

Returns Int Provides control ID.

Param Handle Type a variable name or choose a script function that can provide the window handle of the SDM dialog. The GetFocus function is often used to provide the handle.

Category Dialog Controls

function SDMGetNextControl

Description Obtains the control ID for the next option in an SDM dialog box. It can provide the control ID that is needed by the SDMSayControl function.

Returns Int A control ID is returned when the next control ID is found, 0 is returned when a control ID does not exist.

Param Handle Type a variable name or choose a script function that can provide the window handle of the SDM dialog box. The GetFocus function is often used to provide the handle.

Param Int Type a variable name or choose a script function that indicates the control ID for the child window which is the starting point for the script function in the SDM dialog.

Category Dialog Controls

function SDMGetPrevControl

Description Provides the control ID for the previous option in an SDM dialog box. It can provide the control ID that is needed by the SDMSayControl function.

Returns Int A control ID is returned when the previous control ID is found, 0 is returned when a control ID does not exist.

Param Handle Type a variable name or choose a script function that can provide the window handle of the SDM dialog box. The GetFocus function is often used to provide the handle.

Param Int Type a variable name or choose a script function that indicates the control ID for the child window which is the starting point for the script function in the SDM dialog.

Category Dialog Controls

function SDMSayControl

Description Speaks the contents of a child window along with its prompt in an SDM dialog box. It reads edit fields, list boxes, check boxes, radio buttons, etc. This function is equivalent to SayControl, but is exclusively designed for SDM dialog boxes. All child windows in an SDM dialog box have the same window handle, and the control ID is used to distinguish between the various options in the dialog box.

Param Handle Type a variable name or choose a script function that can provide the window handle for the dialog box. The GetFocus function is often used to provide the handle.

Param Int Type a variable name or choose a script function that can provide the control ID for the child window which is to be spoken. Various SDM control ID functions can be used to identify the child window.

Category Dialog Controls

function SDMSayStaticText

Description Reads a type of text called static text that may be displayed in an SDM dialog box. It does not read the text in edit fields, check boxes, and so on, or the titles or prompts that are often associated with dialog options

Param Handle Use the GetFocus function to obtain the handle of the current SDM window.

Category Dialog Controls

function SDMSayWindowTypeAndText

Description Used with SDM windows to read the window title (when one is present), the window type, the contents in the window, and related information about the current dialog box option. When this function is used, it marks the text it reads so that the SayNonHighlightedText and SayHighlightedText functions do not repeat the same information when they are triggered. This function is only used with SDM windows and not with regular dialog windows.

Param Handle Type the name of a variable or choose a script function that provides the handle of the window that is to be read. The GetFocus function is often used to provide the handle of the SDM window.

Param Int Use the SDMGetFocus function to provide the control ID for the active child window of the dialog box.

Category Dialog Controls

function SelectFromSavedLocationToCurrent

Synopsis Selects text between the saved and current location

Description This function selects text between the cursor's saved location (at the time when SaveCurrentLocation was called) and the new current location.

Returns int TRUE or FALSE.

Category Selection

function SelectFromStartOfLine

Description When the PC cursor is active, JAWS allows the application to select from the start of the current line to the PC cursor. When a portion of text is selected, JAWS automatically speaks the newly highlighted text if screen echo is set to Highlighted or All

Category Selection

function SelectFromTop

Description When the PC cursor is active, JAWS allows the application to select from the top of the document to the PC cursor. When a portion of text is selected, JAWS automatically speaks the newly highlighted text if screen echo is set to Highlighted or All.

Category Selection

function SelectHierarchicalElement

Synopsis Selects an HTML element's contents

Description this function selects the text contained in an HTML element. For example, if you are on the table introduction (table with x columns and y rows) and you call this function then the entire table will be selected. If however you are in a table cell then just the table cell will be selected.

Category HTML

function SelectNextCharacter

Description When the PC cursor is active, JAWS allows the application to select the next character. When a character is selected, JAWS automatically speaks the character if screen echo is set to Highlighted or All.

Category Selection

function SelectNextLine

Description When the PC cursor is active, JAWS allows the application to select the next line. When a line is selected, JAWS automatically speaks the line if screen echo is set to Highlighted or All.

Category Selection

function SelectNextParagraph

Description Selects the next paragraph in the focused application. Assumes that the next paragraph is selected by sending Shift + Ctrl + DownArrow.

Category Selection

function SelectNextScreen

Description When the PC cursor is active, JAWS allows the application to select the next page beginning at the PC cursor. When a portion of text is selected, JAWS automatically speaks the newly highlighted text if screen echo is set to Highlighted or All.

Category Selection

function SelectNextSoundCard

Description switches JAWS to the next sound card in the internal list of sound cards it keeps. To see the sound cards, go to the JAWS menu, Utilities - > Sound Cards.

Returns string the friendly name of the sound card JAWS switched to, or an empty string if the operation fails.

Category Sounds

function SelectNextWord

Description When the PC cursor is active, JAWS allows the application to select the next word. When a word is selected, JAWS automatically speaks the word if screen echo is set to Highlighted or All.

Category Selection

function SelectPreviousSoundCard

Description switches JAWS to the previous sound card in the internal list of sound cards it keeps. To see the sound cards, go to the JAWS menu, Utilities - > Sound Cards.

Returns string the friendly name of the sound card JAWS switched to, or an empty string if the operation fails.

Category Sounds

function SelectPriorCharacter

Description When the PC cursor is active, JAWS allows the application to select the prior character. When a character is selected, JAWS automatically speaks the character if screen echo is set to Highlighted or All.

Category Selection

function SelectPriorLine

Description When the PC cursor is active, JAWS allows the application to select the prior line. When a line is selected, JAWS automatically speaks the line if screen echo is set to Highlighted or All.

Category Selection

function SelectPriorParagraph

Description Selects the prior paragraph in the focused application. Assumes that the prior paragraph is selected by sending Shift + Ctrl + UpArrow.

Category Selection

function SelectPriorScreen

Description When the PC cursor is active, JAWS allows the application to select the prior page ending at the PC cursor. When a portion of text is selected, JAWS automatically speaks the newly highlighted text if screen echo is set to Highlighted or All.

Category Selection

function SelectPriorWord

Description When the PC cursor is active, JAWS allows the application to select the prior word. When a word is selected, JAWS automatically speaks the word if screen echo is set to Highlighted or All.

Category Selection

function SelectToBottom

Description When the PC cursor is active, JAWS allows the application to select from the PC cursor to the end of the document. When a portion of text is selected, JAWS automatically speaks the newly highlighted text if screen echo is set to Highlighted or All.

Category Selection

function SelectToEndOfLine

Description When the PC cursor is active, JAWS allows the application to select to the end of the current line starting at the PC cursor. When a portion of text is selected, JAWS automatically speaks the newly highlighted text if screen echo is set to Highlighted or All.

Category Selection

function SendMessage

Description Provides limited access to the Windows SendMessage function (See the Windows Platform SDK or a Windows programming book for details) It is only possible to use numeric values for wParam and lParam. No strings or other structures can be passed. The return value is always treated as an integer.

Returns Int result of the SendMessage call.

Param Handle/hWnd Window to which the message should be sent.

Param Int/Message Message to be sent.

Optional

Param Int/wParam wParam value for the message, defaults to 0.

Param Int/lParam lParam value for the message, defaults to 0.

Category Window

function SetActiveVoiceProfileByIndex

Description Sets the active voice profile to the one with the given index.

Param int The index of a voice profile.

Optional

Param Int/persist This optional parameter was added in JAWS 10.0. The default value for the parameter is FALSE. This parameter controls whether or not JAWS makes the change permanent by saving the change in active voice profile to Default.jcf.

Category Voices

function SetActiveVoiceProfileByName

Description Sets the active voice profile to the one with the given name.

Param string The name of a voice profile.

Optional

Param Int/persist This optional parameter was added in JAWS 10.0. The default value for the parameter is FALSE. This parameter controls whether or not JAWS makes the change permanent by saving the change in active voice profile to Default.jcf.

Category Voices

function SetAlternateUserDirectoryMode

Description Sets the Alternate User Directory Mode. The Alternate User Directory Mode provides control over the location that will be used as the user settings directory.

Param int/DirectoryMode The possible values are as follows. AlternateUserDirMode_Off (0): Causes the standard user directory for the product to be used. AlternateUserDirMode_Default (1): Causes user settings to be saved in a subdirectory of the temp directory; files saved in this directory are transient and the contents of this directory are deleted when the product enters or exits the mode. AlternateUserDirMode_Roam (1): Causes user settings to be saved in a subdirectory of the ProgramData directory; files saved in this directory are persistent.

Category Settings

function SetBrailleControlKeyProcessingMode

Description Puts the braille keyboard driver into control key processing mode. In that state the next key pressed is sent to the OS as a control character.

Param Int/bState Non-zero to turn the mode on, zero to turn mode off.

Category Braille Keyboard

function SetBrailleMessageStatusText

Synopsis Enables the user to define the text to be shown either in the status area of the Braille display or prepended to a Flash message during the display of a Flash message.

Description This function enables the user to define the text to be shown either in the status area of the Braille display or prepended to a Flash message during the display of a Flash message. If the string parameter is not supplied or is NULL, the default status message as defined in the jcf file will be restored and used.

Returns int TRUE if the function succeeds, false otherwise.

Optional

Param string sStatusMsg the text to be shown in the status cell area of the display or prepended to a Flash message if the display has no status cells.

Category Braille Output

function SetBraillePanSize

Description Sets the amount of text that is passed to the braille logic that the user can pan around.

Param Int/Size 0-Display current line. 1-Start at current line and go to the end of the current paragraph.

Category Braille Keyboard

function SetBrailleRestriction

Synopsis Specifies the area within which the Braille cursor is free to move.

Description selects the area within which the Braille cursor is fre to move. Note has no effect if Tether Braille To Active is on.

Returns Int TRUE if the resttriction was set, false if the Braille cursor is tethered to another cursor.

Param Int one of the constants beginning with Restrict defined in hjconst.jsh. Use RestrictNone to allow the cursor to roam the screen, RestrictAppWindowto restrict to the application window, RestrictRealWindow to restrict to the real window or RestrictWindow to restrict to the current window.

Category Cursors

function SetColumnHeader

Description Sets the row to be used when announcing column headers.

Param int/row Specifies the row containing column headers.

Category Tables

function setCountedSelectionContextItems

Description Sets the bits in the flagset representing the context itemms for which you want counts spoken. See the SelCtxCount constants in HJConst.jsh.

Returns int True if the current location is valid for setting the context flags, false otherwise.

Param int The flagset of context items to be spoken.

Category Speech Markup

function SetCurrentItem

Description Moves focus to a specified item in a ListView or combobox. Note that this does not bring the ListView or combobox window into focus, it simply causes a specific item to be the focused item in that window. This function expands the functionality of lvSetFocusItem to also work for comboboxes.

Returns Int TRUE if successful, FALSE otherwise.

Param Handle The window containing a ListView or combobox.

Param Int The 1-based index of the row in the ListView or combobox to receive focus.

Category Dialog Controls

function SetDefaultJCFOption

Description Changes the currently stored default value for an option in memory.

Returns Int "WAS_SUCCESSFUL" = 1 (the value was changed), "WAS_NOT_SUCCESSFUL" = 0 (it was not changed).

Param Int Type the constant value that names the option you wish to change. Constant values are listed in HJCONST.JSH, and begin with the prefix "OPT_" or "OPTBRL_." Constants beginning with "OPTBRL_" are for Braille devices.

Param Int Type the number to be used as the setting for the option.

Category Settings

function SetFocus

Description Moves the focus to a specified window.

Param Handle Handle of window to which focus should be moved.

Category Window

function SetFocusToWindowAndScheduleFunction

Synopsis Sets focus to a window and schedules a function to run after that window gains focus.

Description This function may be used to set focus to a window and schedules a function to run after that window gains focus. This function first uses the ScheduleFunctionAfterWindowGainsFocus function to schedule the function and then uses the SetFocus function to set focus to the window. All the comments in the description of the ScheduleFunctionAfterWindowGainsFocus function apply to this function.

Returns int TRUE when the function was successfully scheduled and focus was set to the window. FALSE otherwise.

Param Handle/hwnd The window handle of the window to wait to gain focus before scheduling the function.

Param String/FunctionName Name of function to be executed.

Param Int/TimeOut Maximum amount of time, in milliseconds, that the function should wait before canceling the scheduled function. Note that this script function returns immediately without waiting for the specified amount of time. Instead, whenever a Focus Changed event is processed a check is performed to determine whether or not there is an unprocessed request to schedule a function after a given window gains focus. If there is and the function has timed out, the scheduled function is canceled.

Category Scripts

function SetGestureMode

Description Loads the gestures associated with the given gesture mode.

Returns void

Param int Mode number corresponding to one of the GestureMode_* constants in HJConst.

Category Scripts

function SetGraphicLabel

Description Adds a graphic label to the specified graphics file (jgf).

Returns Int TRUE if the label is successfully added.

Param Int/nGraphicID The ID of the graphic. GetGraphicID returns this value.

Param String/nLabel The label to be assigned to the graphic.

Param Int/bApp If bApp is TRUE, then the graphic label is added to the application-specific graphic file. If FALSE, then it is added to the default graphic file.

Category Graphics

function SetJAWSFindText

Description Sets the text to be located when JAWSFindNext runs.

Param string The text to be used with JAWSFindNext.

Category Screen Text

function SetJAWSLanguage

Description In the international versions of JFW, changes the JAWS operating environment to the specified language.

Returns Int TRUE if change was successful, FALSE otherwise.

Param string A 3-character Windows language abbreviation (ENU for English, DEU for German, and so on.)

Category Settings

function SetJCFOption

Description Changes the currently stored value for the active application. A new JCF file is loaded each time a different application is used. When a JCF is not available for the application, then the settings in the DEFAULT.JCF are used. The SetDefaultOption is used to change the currently stored default JCF option in memory.

Returns Int "WAS_SUCCESSFUL" = 1 (the value was changed), "WAS_NOT_SUCCESSFUL" = 0 (it was not changed).

Param Int Type the constant value that names the option you wish to change. Constant values are listed in HJCONST.JSH, and begin with the prefix "OPT_" or "OPTBRL_." Constants beginning with "OPTBRL_" are for Braille devices.

Param Int Type the number to be used as the setting for the option.

Category Settings

function SetJTControllerMode

Synopsis Set the JAWS Tandem Controller Mode

Description In Window mode, the Tandem Controller window has a system menu and can be sized according to the user's preferences. In Full Screen mode, Tandem Window consumes the entire screen. Pass one of the following values to SetJTControllerMode. JTCONTROLLER_MODE_WINDOW sets the mode to Window Mode. In this mode, system keys are passed through to the controller system. JTCONTROLLER_MODE_FULL sets the mode to Full. In this mode, only the Alt + Control + Break (ToggleTandemMode) keystroke is handled by the controller. All other keystrokes are passed to the target. JTCONTROLLER_MODE_SLEEP allows all keystrokes to be process by the controller. JTCONTROLLER_MODE_TOGGLE toggles the Tandem Controller mode.

Returns int TRUE if the mode was successfully set. Returns FALSE otherwise.

Param int/nMode

Category Connection

function SetLastScriptKey

Description Sets the name of the last key used for a script. Useful when it is necessary to assign a specific key name to be retrieved by GetCurrentScriptKeyName.

Returns int True if the set was successful, false otherwise.

Param string The key name to use.

Category Scripts

function SetMovementUnit

Description If necessary, this function is used to let the JAWS internal code know what kind of navigation movement is being performed. It is not normally necessary to call this function when a movement is being performed.

Param int One of the Movement Unit Values constants from hjConst.jsh.

Category Misc

function SetPassThroughNextGesture

Description Sets whether or not the next gesture will get passed through to Windows.

Returns void

Param int 1 for enable, 0 for disable

Category Scripts

function SetQuickKeyNavigationMode

Synopsis allows scripter to manually turn on or off the Quick Key Navigation mode..

Description The Quick Key Navigation mode is linked to the Virtual Cursor automatically however it may be manually turned on in other applications which don't use the Virtual cursor. Applications which use this mode must have overriding scripts to handle the movement and reading functions supported by this mode. this mode is linked to the JCF option OPT_QUICK_KEY_NAVIGATION_MODE so turning it on manually when the jcf option is set to 0 will have no effect.

Returns Int true if the mode was enabled or false otherwise.

Param Int true to turn the mode on, false to turn it off.

Category HTML

function SetRegistryEntryDWORD

Synopsis Sets a DWORD entry into the registry, first parameter represents root key.

Description Use to set DWORD entries in registry.

Returns int 1 if successful, otherwise 0.

Param int 0=HKEY_CLASSES_ROOT, 1=HKEY_CURRENT_USER, 2=HKEY_LOCAL_MACHINE, 3=HKEY_USERS.

Param String/byRef/Name of SubKey.

Param String/byRef/Name of Variable

Param int/DWORD to be Assigned variable.

Category System

function SetRegistryEntryString

Synopsis Sets a string entry into the registry, first parameter represents root key.

Description Use to set string entries in registry.

Returns int 1 if successful, otherwise 0.

Param int 0=HKEY_CLASSES_ROOT, 1=HKEY_CURRENT_USER, 2=HKEY_LOCAL_MACHINE, 3=HKEY_USERS.

Param String/byRef/Name of SubKey.

Param String/byRef/Name of Variable.

Param String/byRef/String to be Assigned variable.

Category System

function SetRestriction

Synopsis Specifies the area within which the current cursor is free to move.

Description For all cursors except the PC cursor, selects the area within which the cursor is fre to move.

Returns Int FALSE when the PC cursor is on, TRUE otherwise.

Param Int one of the constants beginning with Restrict defined in hjconst.jsh. Use RestrictNone to allow the cursor to roam the screen, RestrictAppWindowto restrict to the application window, RestrictRealWindow to restrict to the real window or RestrictWindow to restrict to the current window.

Category Cursors

function SetRestrictionToFrame

Synopsis Restricst the active cursor to within a specific frame.

Description For all cursors except the PC cursor, selects the area within which the cursor is fre to move.

Returns Int FALSE if the PC cursor is on or if the specified frame does not exist, TRUE otherwise.

Param String/strFrame The name of the frame whose borders will serve as restricting boundaries for the cursor.

Category Cursors

function SetRestrictionToRect

Synopsis Restricst the active cursor to within a specific rectangle.

Description For all cursors except the PC cursor, selects the area within which the cursor is fre to move.

Returns Int FALSE if the PC cursor is on or if the rectangle is invalid, TRUE otherwise.

Param Int/Left Left edge of rectangle.

Param Int/Top top edge of rectangle.

Param Int/Right right edge of rectangle.

Param Int/Bottom bottom edge of rectangle.

Category Cursors

function SetRowHeader

Description Sets the column to be used when announcing row headers.

Param int/column Specifies the column containing row headers.

Category Tables

function SetSelectionContextFlags

Synopsis Enables the user to determine which contextual information to indicate when navigating.

Description This function enables the user to choose which selection context information to indicate when navigating (in documents supporting this feature). See the selCtx* constants in hjconst.jsh for a list of the flags which may be enabled. Note that the behaviour of the indication if enabled is controlled via the Speech and Sounds Scheme in effect., however this function enables the flags to be toggled on the fly independent of scheme behavior.

Returns int TRUE if successful, FALSE otherwise.

Param int/nFlags The flags ored together.

Optional

Param int nFlagsOfItemsToBeIndicatedPrior Set this to the selCtx items you want to be spoken prior to text when navigating, eg selCtxPageSectionColumnBreaks selCtxTables selCtxStyles selCtxBorders.

Category Speech Markup

function SetSynth

Description Causes JFW to switch to the specified synthesizer.

Returns Int TRUE if change was successful, FALSE otherwise.

Param String/strShortName The short name of the synthesizer found in JFW.INI. This name must be in quotes. For example, you can find the short name for Eloquence by looking in JFW.INI for the entry "Synth1Name=eloq." You would then use the line SetSynth("eloq") in your script or function.

Category Voices

function SetSynthLanguage

Description For synthesizers that support multiple languages, changes the synthesizer to the specified language.

Returns Int TRUE if change was successful, FALSE otherwise.

Param String Enter the language to be switched to, exactly as it appears in the Synthesizer Language submenu of the Language menu. Example; SetSynthLanguage ("American English")

Category Voices

function SetSystemVolume

Description Sets the system volume.

Returns Void

Param Int/NewValue The new value to which you wish to set the volume. Volume ranges from 0 to 100.

Category System

function SetTableTitleReading

Synopsis Updated the Table Titles element in the Adjust JAWS Verbosity list box.

Description The Table Title Reading option allows either column titles, row titles, both or none to be spoken.

Returns String the new value for the element in the list.

Param Int/iRetCurVal Passed by JAWS to instruct the function whether or not to update.

Category Tables

function SetTypingEchoLanguage

Synopsis Sets the synth language which should be used for typing echo.

Description This function allows the user to change the language JAWS uses for typing echo. If a valid language abbreviation is supplied, that language will be used (if supported by the Synthesiser in use) otherwise the global language will be used. Note this is only available in JAWS 5.0 International (v 5.00.709 or higher).

Returns int True if we were able to switch the typing echo language, FALSE otherwise.

Optional

Param string/sLanguageCode any language code for which a language alias is defined for the current synth or a language string understood by the current synth. Note this function only supports aliases which map to an actual language switch (rather than a voice switch).

Category Keyboard

function SetVoiceParameters

Description sets the parameters for the voice context you specify. These include Volume, Rate, Pitch, Punctuation and person.

Returns Void

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Param Int/volume/ Type the variable to setthe voice volume setting.

Param Int/Rate Type the variable to set the voice rate setting.

Param Int/Pitch Type the variable to set the voice pitch setting.

Param Int/Punctuation Type the variable to set the voice punctuation setting.

Param String/Person Type the variable to set the voice person setting.

Category Voices

function SetVoicePerson

Description Sets the person of the voice you specify to the amount passed to the second parameter.

Returns Void

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Param String/NewPerson The new person to which you wish to set the voice context.

Category Voices

function SetVoicePitch

Description Sets the pitch of the voice you specify to the amount passed to the second parameter.

Returns Void

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Param Int/NewValue The new value to which you wish to set the pitch.

Category Voices

function SetVoicePunctuation

Description Sets the punctuation of the voice you specify to the amount passed to the second parameter.

Returns Void

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Param Int/NewValue The new value to which you wish to set the punctuation.

Category Voices

function SetVoiceRate

Description Sets the rate of the voice you specify to the amount passed to the second parameter.

Returns Void

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Param Int/NewValue The new value to which you wish to set the rate.

Optional

Param int/bMakePermanent Use true if the speech rate change should be permanent, false if it should be temporary. Default value is false.

Category Voices

function SetVoiceVolume

Description Sets the volume of the voice you specify to the amount passed to the second parameter.

Returns Void

Param String/VoiceContextName The name of the voice context as defined in HjConst.jsh with the prefix VTX_.

Param Int/NewValue The new value to which you wish to set the volume.

Optional

Param int/bMakePermanent Use true if the speech rate change should be permanent, false if it should be temporary. Default value is false.

Category Voices

function SetVPCApplicationMode

Synopsis Enables the user to tell JAWS that if this mode is supported by the current virtual document, then honor it, or, ignore it so that the user can still browse the virtual document as a virtual document.

Description By default, this support is always enabled, that is, if the application requests application mode then the current document will be presented in PCCursor mode only. If however the user wishes to override the application's setting of this mode, they can pass FALSE to this function to ignore the mode and still view the document as a virtual representation.

Returns int TRUE or FALSE, the new state as requested by the caller.

Param int TRUE or FALSE, TRUE to honor this mode if requested by the application or FALSE to ignore it even if requested.

Category HTML

function ShiftEnterKey

Synopsis The SHIFT + ENTER key is passed to the application.

Description Passes the SHIFT + ENTER key through to the application. If the Virtual PC cursor is active and on a link then the link is opened in a new browser window.

Returns Void

Category Keyboard

function ShiftLeftMouseClick

Description Sends a SHIFT + LEFT Mouse Click to the system, useful for selecting contiguous text or items in a list with the mouse pointer.

Category Mouse

function ShiftTabKey

Synopsis Passes the SHIFT + TAB keystroke through to the application.

Description The SHIFT + TAB keystroke is passed to the application. If the Virtual PC cursor is active, it is moved to the previous link or control in the tab order.

Category Keyboard

function ShouldItemBraille

Synopsis Determines if a string with a given Output Mode should be Brailled.

Description This function is used to determine whether or not the user has specified that items spoken with a given Output Mode should also be Brailled in the current Braille verbosity level.

Returns Int Returns 0 if the item should not be Brailled. Returns a non 0 value if the item should be Brailled.

Param Int/iOutputMode The Output Mode of the item you wish to determine if it should be Brailled.

Category Settings

function ShouldItemSpeak

Synopsis Determines if a string with a given Output Mode should be spoken.

Description This function is used to determine whether or not the user has specified that items spoken with a given Output Mode should be spoken in the current verbosity level.

Returns Int Returns 0 if the item should not be spoken. Returns a non 0 value if the item should be spoken.

Param Int/iOutputMode The Output Mode of the item you wish to determine if it should be spoken.

Category Settings

function ShowHelpByID

Description Opens up WinHelp using a specified file and topic ID.

Returns Int TRUE if the help file was successfully displayed.

Param String/strHelpFile The name of a help file. If a complete path is given, then it is used. If only a file name is given, then the default JFW help path is build around it and used.

Param Int/nID The ID of the help topic.

Category Help

function ShowHelpByName

Description Opens up WinHelp using a specified file and index topic.

Returns Int TRUE if the Help file was successfully displayed.

Param String/strHelpFile The name of a help file. If a complete path is given, then it is used. If only a file name is given, then the default JFW help path is build around it and used.

Param String/strKey The index string of the Help topic.

Category Help

function ShowNotificationHistory

Description Shows the notification history of Notification Manager.

Optional

Param int/invokedBy Indicates the method of invocation when calling this function. Use one of the constants from hjConst.jsh indicated as one to be used for Script invocation contexts.

Category Notification Manager

function ShowRectangleWindow

Description When first called, creates a transparent window with a red rectangle border. Subsequent calls moves the window using the new size and location specified by the coordinate parameters. All keystrokes and mouse clicks are passed through this window.

Param Int/nLeft the left edge of the rectangle.

Param Int/nTop the top edge of the rectangle.

Param Int/nRight the right edge of the rectangle.

Param Int/nBottom the bottom edge of the rectangle.

Category Window

function ShutDownJAWS

Description Closes or quits the JAWS application. The JAWS user is automatically prompted to confirm the intention to terminate JAWS before speech stops.

Category JAWS Program

function ShutDownMAGic

Synopsis Shuts down the MAGic program.

Description Finds the MAGic window and sends a WM_CLOSE to it.

Returns Int FALSE if the MAGic window could not be shut down. Otherwise TRUE.

Category MAGic

function SimulateKey

Synopsis simulates performing the key.

Description If the key name is attached to a script, performs the script; otherwise, sends the key to the application.

Returns int if the key simulation was successful, false otherwise.

Param string the key name to be performed.

Category Keyboard

function SkimRead

Synopsis Starts skimreading from the cursor.

Description Skimreading allows the user to read out certain portions of a document while skipping over irrelevant information. The Skimreading mode maybe specified along with an optional text expression which determines which information is read.

Optional

Param int/iMode Modes are defined in HJConst.jsh and include srmOff (equivalent to a SayAll), srmFirstLineOfParagraph (just read the first line of each paragraph), srmFirstSentenceOfParagraph (just the first sentence of each paragraph) or srmTextMatchingRegularExpression (read just the units of text which match the supplied Regular Expression.

Param int/bIndicateSkimming TRUE to indicate JAWS is skimming, a beep will be heard every 20 units skimmed. The unit will depend on the current SayAll mode.

Param string/sRegularExpression Is a regular expression defining what text should be present or absent in the text unit in order for it to be spoken. Some examples include Joe Blogs Fred (read units including the names Joe, Blogs or Fred), Joe& ~BLogs (text units containing Joe but not Blogs), etc. See the documentation for the full regular expression syntax as it is very powerful.

Param int/nTextRuleUnit when srmTextMatchingRegularExpression is used, the text unit to which the rule is applied and the unit spoken on a match.

Param int/bSilentSkimSummarizeAtEnd if true, does not read each match but adds the text to the User Buffer and presents all matches at once when the SkimRead is stopped or completes (JAWS 6.10 and higher) defaults to FALSE.

Param int/nAttributeMask use attrib constants in hjConst.jsh

Param string/sRGBTextColor use empty string (or don't pass) for any text color

Param string/sRGBBackColor use empty string (or don't pass) for any back color

Param int/bUseRegularExpressionParser if TRUE or not supplied, the text string will be treated as a regular expression as in prior versions of JAWS, if FALSE, a simple case insensitive check for text inclusion of the string will be performed.

Category Skim-Reading

function SkimReadShouldSpeakText

Synopsis Used to determine if the current unit should be spoken when skimreading is being controlled by scripts (eg in MSWord).

Description This function is only used when skimreading is being controlled externally by scripts as in MSWord.

Returns int true or false

Param string/sText text of unit to be checked against the current skimreading parameters. If skimreading is set to srmTextMatchesRegularExpression then the regular expression will be applied to this text and the function will return true if it should be spoken, false otherwise. If the skimreading mode is set to anything other than srmTextMatchesRegularExpression, the function will return TRUE unless a skimread is not in progress.

Category Skim-Reading

function SmartWordReadingSet

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function smmGetBehavior

Synopsis Obtains the current behavior for a given scheme property.

Description This function allows the scripter to obtain a scheme behavior.

Returns int the behavior for the given table and key.

Param string/sBehaviorTableName the category of behaviors you wish too query. This is taken from the section name in the SMF file (minus the "Behavior table" suffix), for example, if you wish to query an Attribute behavior, the value of this parameter should be set to "Attribute".

Param string/sKey the key from the behavior table you wish to query.

Param string/byRef/sData the data for the behavior. This piece of data will correspond to data1 through data4 for that given table and key, see the smf files for more detail. for example, if the behavior is speak item then the data will contain the optional text and voice alias used to speak the item. If the behavior is to change language then the data will contain the language alias etc.

Optional

Param string/byRef/sData2 the second set of data for the behavior. For example, if you are retrieving data for the behavior speak and play sound, the behavior may contain both overriding text for the speak behavior and a sound file for the sound behavior. When the bahavior is set to speak and play sound sData will contain the overriding text stored in data1 and sData2 will contain the sound file stored in data2.

Category Speech Markup

function smmGetBehaviorForControlState

Synopsis Gets the behavior which will be used for the specified control state.

Description See hjconst.jsh for the list of valid behavior constants.

Returns Int a constant representing the behavior.

Param Int/iControlstate the control state whose behavior you want.

Category Speech Markup

function smmGetBehaviorForControlType

Synopsis Gets the behavior which will be used for the specified control type.

Description See hjconst.jsh for the list of valid behavior constants.

Returns Int a constant representing the behavior.

Param Int/iControltype the control type whose behavior you want.

Category Speech Markup

function smmGetDesiredUnitsOfMeasure

Synopsis Gets the units of measure used for reporting indentation and other measurements.

Description This function is used to get the units of measure JAWS uses for speaking measurements such as indentation etc.

Returns int the unit of measure currently set in the Speech Markup Engine (see smmSetDesiredUnitsOfMeasure), one of smmPixels, smmSpaces, smmPoints, smmMM, smmCM or smmInches.

Category Speech Markup

function smmGetEndMarkupForAllCaps

Synopsis Returns the end Speech Markup mapping for a capitalized word.

Description This function returns the end markup which will be used for a capitalized word.

Returns String the end Speech Markup which will be used to indicate a capitalized word. Note that some behaviors don't require an end tag and hence this will be blank.

Category Speech Markup

function smmGetEndMarkupForAttributes

Synopsis Returns the end Speech Markup mapping for the given attributes.

Description If an attribute or set of attributes is mapped to a Speech Behavior, this function returns the end markup for the font name. See the Attribute Behavior Table in default.jcf. Note some mappings don't require an end markup tag hence the mapping will be blank.

Returns String the Speech Markup which will be used to indicate the end of text in this attribute.

Param Int/iAttributeKey this int must represent the attributes to lookup ored together.

Category Speech Markup

function smmGetEndMarkupForColor

Synopsis Returns the end Speech Markup mapping for the given color.

Description If a text/background color combination is mapped to a Speech Behavior, this function returns the end markup for the color. See the Color Behavior Table in default.jcf.

Returns String the Speech Markup which will be used to indicate the end of text in this color. Note that not all behaviors require an end tag.

Param Int/iTextColor

Param Int/iBackgroundColor

Category Speech Markup

function smmGetEndMarkupForControlState

Synopsis Returns the end Speech Markup mapping for the given control state.

Description If a control state is mapped to a Speech Behavior, this function returns the end markup for the control state. See the ControlState Behavior Table in default.jcf. Note that since only sounds or speak item maybe assigned to a control state, you never need to use or get the end markup for control state behaviors.

Returns String the Speech Markup which will be used to indicate the control state. Note that it is generally unlikely that a control state will be mapped to a behavior requiring an end markup tag.

Param Int/iControlType (required to determine the appropriate state)

Param Int/iControlState state of control, see hjconst.jsh for control states.

Category Speech Markup

function smmGetEndMarkupForControlType

Synopsis Returns the end Speech Markup mapping for the given control type.

Description If a control type is mapped to a Speech Behavior, this function returns the end markup for the control type. See the ControlTypes Behavior Table in default.jcf.

Returns String the Speech Markup which will be used to indicate the end of the control. Note that not all behaviors require an end tag.

Param Int/iControlType (must match one of the WT_ constants in hjconst.jsh).

Category Speech Markup

function smmGetEndMarkupForFontName

Synopsis Returns the end Speech Markup mapping for the given font name.

Description If a font is mapped to a Speech Behavior, this function returns the end markup for the font name. See the Font Name Behavior Table in default.jcf. Note some mappings don't require an end markup tag hence the mapping will be blank.

Returns String the Speech Markup which will be used to indicate the end of text in this font.

Param String/sFontName the font name

Category Speech Markup

function smmGetEndMarkupForFontSize

Synopsis Returns the end Speech Markup mapping for the given font size.

Description If a font size is mapped to a Speech Behavior, this function returns the end markup for the font size. See the Font Size Behavior Table in default.jcf. Note some mappings don't require an end markup tag hence the mapping will be blank.

Returns String the Speech Markup which will be used to indicate the end of text in this font.

Param Int/iPointSize the font size marking the upper bound of a given range of font sizes.

Category Speech Markup

function smmGetEndMarkupForSingleCap

Synopsis Returns the end Speech Markup mapping for a single capitalized letter.

Description This function returns the end markup which will be used for a single capitalized letter.

Returns String the end Speech Markup which will be used to indicate a single capital letter. Note that some behaviors don't require an end tag and hence this will be blank.

Category Speech Markup

function smmGetMarkupForSymbol

Synopsis Returns the appropriate markup for a symbol.

Description for example, this function will return & for the & sign.

Returns String the markup for the given symbol.

Category Speech Markup

function smmGetSpeechMarkupTextOptions

Synopsis Retrieves the text options appropriate for the current jcf settings and supplied output type.

Description When using the smmMarkupString function, the result of this function maybe used as the TextOptions parameter. This function sets the text options appropriately according to the currently selected jcf option values and Output type.

Returns Int the bit flags of the appropriate text options for the given output type.

Param Int/iOutputType the output type to use to retrieve the appropriate text options.

Category Speech Markup

function smmGetStartMarkupForAllCaps

Synopsis Returns the Speech Markup mapping for a capitalized word (or letter group).

Description This function returns the markup which will be used to introduce a capitalized word or letter group.

Returns String the Speech Markup which will be used to indicate a capitalized word.

Category Speech Markup

function smmGetStartMarkupForAttributes

Synopsis Returns the Speech Markup mapping for the given attributes.

Description If an attribute or set of attributes is mapped to a Speech Behavior, this function returns the start markup for the attributes. See the attributes Behavior Table in default.jcf.

Returns String the Speech Markup which will be used to indicate the beginning of text in this attribute.

Param Int/iAttributeKey this int must represent the attributes to lookup ored together.

Category Speech Markup

function smmGetStartMarkupForColor

Synopsis Returns the Speech Markup mapping for the given text/background color combination.

Description If a text/background color combination is mapped to a Speech Behavior, this function returns the start markup for the color. See the Color Behavior Table in default.jcf.

Returns String the Speech Markup which will be used to indicate the beginning of text in this color.

Param Int/iTextColor

Param Int/iBackgroundColor

Category Speech Markup

function smmGetStartMarkupForControlState

Synopsis Returns the Speech Markup mapping for the given control state.

Description If a control state is mapped to a Speech Behavior, this function returns the start markup for the control state. See the ControlState Behavior Table in default.jcf.

Returns String the Speech Markup which will be used to indicate the control state.

Param Int/iControlType (required to determine the appropriate state).

Param Int/iControlState state of control, see hjconst.jsh for control states.

Category Speech Markup

function smmGetStartMarkupForControlType

Synopsis Returns the Speech Markup mapping for the given control type.

Description If a control type is mapped to a Speech Behavior, this function returns the start markup for the control type. See the ControlTypes Behavior Table in default.jcf

Returns String the Speech Markup which will be used to identify this control type.

Param Int/iControlType (must map to one of the WT_ constants in hjconst.jsh

Category Speech Markup

function smmGetStartMarkupForFontName

Synopsis Returns the Speech Markup mapping for the given font name.

Description If a font is mapped to a Speech Behavior, this function returns the start markup for the font name. See the Font Name Behavior Table in default.jcf.

Returns String the Speech Markup which will be used to indicate the beginning of text in this font.

Param String/sFontName the font name.

Category Speech Markup

function smmGetStartMarkupForFontSize

Synopsis Returns the Speech Markup mapping for the given font size.

Description If a font size is mapped to a Speech Behavior, this function returns the start markup for the font size. See the Font Size Behavior Table in default.jcf. Note that the entries mark the upperbound for the font size, so, if there are two consequtive entries, one for 10 points and the next for 20, the first entry means 0 to 10 and the next means 11 to 20.

Returns String the Speech Markup which will be used to indicate the beginning of text in this font size.

Param Int/iPointSize point size marking upper bound of sizes in this range.

Category Speech Markup

function smmGetStartMarkupForSingleCap

Synopsis Returns the Speech Markup mapping for a single capitalized letter.

Description This function returns the markup which will be used for a single capitalized letter.

Returns String the Speech Markup which will be used to indicate a single capital letter.

Category Speech Markup

function smmGetSymbolForMarkup

Synopsis Returns the symbol for the specified markup.

Description For example, this function will return the & sign for the markup &

Returns String the symbol for the given markup.

Category Speech Markup

function smmMarkupString

Synopsis Marks up a string according to a set of text options, attributes etc.

Description This function marks up a string using information supplied as optional parameters.

Returns String the string marked up ready for speaking with the say command specifying true for the ContainsMarkup optional parameter

Param String/sText text to mark up

Optional

Param Int/iTextOptions see bit flags defined in hjconst.jsh, TextOptions.

Param Int/iControlType see wt_ constants.

Param Int/iControlState see control states in hjconst.jsh.

Param Int/iAttributes bit flags specifying the attributes of this text, see hjconst.jsh.

Param String/sFontName the font name of all characters in the string.

Param Int/iPointSize the size of the font for this text.

Param Int/iTextColor the color of the text.

Param Int/iBackgroundColor the backround color of this text.

Param String/sLanguage the language code for this text.

Param string/sStyle The style description (eg heading 1, normal, etc) for this text (only optional in 5.10)

Category Speech Markup

function smmReplaceSymbolsWithMarkup

Synopsis Replaces all the symbols in a string with the correct markup.

Description This function processes a string containing symbols and replaces each occurance of a symbol with the correct markup so that the string maybe enhanced with other markup tags and spoken obeying the markup.

Returns String the original string with all symbols replaced by appropriate markup.

Param string/sText Enter the text whose symbols should be replaced by markup symbols.

Category Speech Markup

function smmSchemeDefinesBehaviorFor

Synopsis Determines if the active scheme defines a behavior for any of the specified text option flags.

Description This function is used to determine if the current scheme defines a behavior for any of the specified text option flags. For example, calling this function with a parameter of toAttributes will return 0 for classic since the classic scheme ignores any text attributes. Calling this function with a parameter of toAttributes with the Proofreading or Classic with Attributes schemes loaded however will return 1.

Returns int true if the current scheme will act upon the supplied text options, false otherwise.

Param int iTextOptions any number of text options bitwise ored together (see HJConst.jsh) for the list of text options.

Category Speech Markup

function smmSetBehavior

Synopsis Allows the adjustment of a scheme behavior via scripts.

Description This function allows the scripter to change a scheme behavior on the fly. the setting is only temporary similar to SetJCFOption however it is very useful when you need to change the behavior of a scheme programmatically.

Returns int true if the behavior was successfully changed, false otherwise.

Param string/sBehaviorTableName the category of behaviors you wish too change. this is taken from the section name in the SMF file (minus the "Behavior table" suffix), for example, if you wish to change an Attribute behavior, the value of this parameter should be set to "Attribute".

Param string/sKey the key from the behavior table you wish to modify (or add).

Param int/iBehavior the new behavior, 0 ignore, 1 speak item, 2 play sound, 3 change voice, 4 change language, or 5 speak and play sound. (See hjconst.jsh).

Optional

Param string/sData the new data for the behavior. For example, if you are changing the behavior to change language and you wish to specify the new language, use this parameter to provide the data for the behavior. Note this data corresponds to data1 through data4 in the SMF file depending on the behavior you set. If you do not provide the data, the behavior will inherit the current data from the active scheme.

Param string/sData2 a second set of new data for the behavior. For example, if you are changing the behavior to speak and play sound, you may need to supply overriding text for the speak behavior and will need to supply a sound file for the sound behavior. When the bahavior is set to speak and play sound sData will correspond to data1 and sData2 will correspond to data2.

Category Speech Markup

function smmSetDesiredUnitsOfMeasure

Synopsis Sets the units of measure used for reporting indentation and other measurements.

Description This function is used to set the units of measure JAWS uses for speaking measurements such as indentation etc.

Returns void

Param int iUnit one of smmPixels, smmSpaces, smmPoints, smmMM, smmCM or smmInches.

Category Speech Markup

function smmStripMarkup

Synopsis Strips speech markup from a string.

Description This function strips all speech markup commands and replaces all markup symbols with their correct symbols.

Returns String the original string with all markup removed and all &sym; replaced with the correct symbols.

Param String/sMarkup the string containing markup.

Category Speech Markup

function smmToggleTrainingMode

Synopsis Toggles the Speech and Sounds Manager training mode on and off.

Description When the Speech and Sounds Manager Training Mode is on, any item which is indicated by a sound or voice change also speaks the item as with the classic scheme. This enables a user of a new scheme to familiarize themself with the sounds and voices chosen to indicate a particular item.

Returns void

Param int/bFlag set to 1 to turn training mode on, set to 0 to turn it off.

Category Speech Markup

function smmTrainingModeActive

Synopsis Determines if the Speech and Sounds Manager training mode is on or off.

Description This function returns 1 if the training mode is on, 0 if it is off.

Returns int 1 or 0

Category Speech Markup

function SpeakPlaceMarkerByIndex

Synopsis speaks the text at the nth placemarker and optionally moves the cursor to the placemarker.

Description This function speaks the text at the nth placemarker and optionally moves the cursor to the placemarker.

Returns Int True or False, depending if the nth placemarker was found.

Param Int/nIndex the 1-based index of the place marker to speak and optionally move to.

Param Int/bMove True if the cursor should be relocated to the placemarker, False to speak but not move to the placemarker.

Category HTML Placemarkers

function SpeechInUse

Description Checks to see if speech output is being used.

Returns Int TRUE if synthesizer is active, FALSE otherwise.

Category Voices

function SpeechOff

Description Causes the synthesizer to be muted. This is particularly useful when you need to free the synthesizer so that a wave file can be played. You can reverse this action with SpeechOn

Optional

Param int True if speech is to be turned off and stay off until specifically turned back on with the SpeechOn(True) method, false otherwise. Setting this parameter to true will allow speech to remain off even if an application switches voice profiles. Note that true will cause SpeechOff to respond more slowly since the synthesizer is unloaded, so if you are temporarily turning speech off then back on again in a script process then do not set this parameter to True. This optional parameter is available as of JAWS 11 update 1.

Category Voices

function SpeechOn

Description UnMutes the synthesizer. Reverses the action of SpeechOff.

Optional

Param int True if speech is to be turned back on after having been turned off by the SpeechOff(true) method, false otherwise. This optional parameter is available as of JAWS 11 update 1.

Category Voices

function SpeechToggledEvent

Synopsis Is called whenever speech is turned on or off

Description This function is called whenever speech is turned on or off. It is passed a boolean value indicating whether speech has been turned on or off.

Param Int/bSpeechOn This is the boolean value whether speech has been turned on or off.

Category Settings Events

function SpellFromCursor

Synopsis Spellls the contents of the current line from the cursor to the end of the line.

Description This function spells the contents of the current line from the cursor to the end of the line.

Returns Void

Category Screen Text

function SpellLine

Synopsis Spellls the contents of the current line.

Description This function spells the contents of the current line.

Returns Void

Category Screen Text

function SpellModeSet

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category Settings

function SpellModeToggle

Synopsis Toggles mode for SpellLine, SpellWord, etc. between Phonetic and standard spelling.

Description Sets the OPT_SPELL_PHONETIC JCF option monitored by internal spell functions.

Returns String The new option (text).

Param Int/iRetCurVal Pass True to keep the value the same, false to update it.

Category Screen Text

function SpellString

Description Spells a string of text. This is similar to the SayString function. However, it spells the string letter by letter instead of speaking words.

Param string Type the text that is to be spelled, or specify a variable name or script function that can provide the required text string. Text strings that are typed must be enclosed within quotation marks.

Category Say

function SpellToCursor

Synopsis Spellls the contents of the current line upto the cursor.

Description This function spells the contents of the current line upto the cursor.

Returns Void

Category Screen Text

function SpellWord

Description Spells the word at the active cursor.

Category Screen Text

function SpellWordPhonetic

Synopsis Spells the word at the cursor using phonetics.

Description This function spells the word at the active cursor using Phonetic alphabet.

Returns Void

Category Screen Text

function StartJAWSTaskList

Description The JTL allows the user to minimize, maximize, close, start, and switch to applications

Returns Int The value is 0 if JAWSTaskList.dll can not be loaded, or 1 if the function is called from the dll successfully.

Category User Interaction

function StartMAGicSayAll

Synopsis Notifies JAWS that MAGic is starting a SayAll

Description This function sets IsSayAllInProgress to TRUE. This function was introduced in JAWS 8.0 update1.

Returns int TRUE if successful, FALSE otherwise.

Param Int/bUseSayAllSynthesizer This parameter may be used to indicate whether or not the Say All speech synthesizer should be used. The default value of this parameter if FALSE which causes JAWS to use the primary speech synthesizer for the Say All operation.

Category MAGic

function StartOfRow

Description When inside a table or spreadsheet, moves the active cursor to the start of the current row.

Returns Int TRUE if the cursor moved, FALSE otherwise.

Category Tables

function StepOutOfCurrentElement

Synopsis Moves to the beginning or end of the ancestor element.

Description This function moves to the beginning or end of the ancestor element, effectively stepping out of the element or moving up one level in the element hierarchy. This can be used for stepping out of a nested list either to the beginning or end of the nested list. Repeated calls will keep stepping out of the element at that level until you reach the top level body. The single parameter specifies whether you are moved to the end or beginning of the element. A second optional parameter allows you to specify how many levels you are stepped out. The default is 0 which means the function will determine the appropriate number of levels for the current element.

Returns Int true if the function relocated the virtual cursor, false otherwise.

Param Int/bFindTheEnd true to move to the end or false to move to the beginning.

Optional

Param Int/nLevels how many levels to step out. Use a value of 0 to force the function to automatically determine the appropriate number of levels to step out. For example, if you are in a table cell and you want to step out of the table then nLevels should be at least 2 because the first level will only refer to the row containing the cell element.

Category HTML Navigation

function StopSpeech

Description Silences the synthesizer. Same as pressing the CTRL key.

Category Voices

function StoreNotification

Description Stores the notification text so that it can be used later in the scripts.

Param string/NotificationText The text of the notification.

Param string/AppName The name of the application which sent the notification.

Category Notification Manager

function stringChopLeft

Synopsis Chops the first part of a string by the specified number of characters.

Description This function chops the first part of a string by the specified number of characters and returns the remainder.

Returns String chopped by supplied number of characters.

Param String/sStr string to chop.

Param Int/iChop by how many characters.

Category Strings

function stringChopRight

Synopsis Chops the last part of a string by the specified number of characters.

Description This function chops the last part of a string by the specified number of characters and returns the remainder, ie the first part.

Returns String chopped by supplied number of characters.

Param String/sStr string to chop.

Param Int/iChop by how many characters.

Category Strings

function StringCompare

Description Compares two string with case sensitivity optional

Returns int 0 if the two strings are equal, a negative number if the first string is less than the second, or a number greater than 0 if the first string is greater than the second.

Param string the first string in the comparison.

Param string the second string in the comparison.

Optional

Param int true if the compare is to be case sensitive, false otherwise. The default is false.

Category Strings

function StringContains

Description Determines whether a specified text string is contained within another text string.

Returns Int An integer is returned to indicate the position in string 1, where the two strings begin to match. If a value of 5 is returned, this means that the string in parameter 2 is present in parameter 1 and the matching characters begin at the fifth character in the string. If a value of 0 is returned, this means that the string in parameter 2 is not contained within the string in parameter 1.

Param string This parameter specifies the string that is to be searched. The search starts at the beginning of this string. Type the text string, type a variable name, or choose a script function. Text strings must be enclosed within quotation marks.

Param string This parameter contains the string you are trying to locate. Type the text string, type a variable name, or choose a script function. Text strings must be enclosed within quotation marks.

Category Strings

function StringContainsChars

Synopsis determines if a string contains any of the characters in the second string

Description this function returns TRUE if any of the characters in string 2 appear in string 1.

Returns int True if string1 contains any of the characters in string2

Param string/sStr the string to search

Param string/sCharList the list of characters to look for in sStr

Category Strings

function StringDiff

Description Retrieves the parts of a string which precede or follow the contents of a second string.

Returns String A concatenation of the parts of s1 which come before and after the contents of s2. If s2 is not contained within s1, then the empty string is returned.

Param String/s1 The string to be searched.

Param String/s2 The string to search for.

Category Strings

function StringIsBlank

Synopsis Determines if a string is blank.

Description This function returns true if the specified string only contains spaces, tabs or newline characters. It returns false if the string contains any printable character. This is useful for determining if strings returned from the object model of an application are blank as far as JAWS speaking is concerned.

Returns Int true or false.

Param String/sStr the string to test.

Category Strings

function StringLeft

Description Extracts a specified number of leftmost characters from a string.

Returns String The string that is extracted from strString.

Param String/strString The string from which the leftmost characters will be extracted.

Param Int/nCount The number of leftmost characters that will be extracted.

Category Strings

function StringLength

Description Used to find the length of a string.

Returns Int Returns an integer value specifying the length of the string.

Param String The string for which the length is requested.

Category Strings

function StringLower

Description Converts a mixed case string to all lower case.

Returns String The converted string.

Param String/strString The string to be converted.

Category Strings

function StringMixedCaseToMultiword

Synopsis Converts a mixed case word to multiple words.

Description This function converts a mixed case string to multiple words. For example ScreenSensitiveHelp is converted to Screen Sensitive Help.

Returns String the mixed case string with spaces inserted before each capital letter.

Param String/sMixedCase the string containing mixed case words.

Category Strings

function StringRemoveCharsInRange

Synopsis Removes characters that are in the range FirstChar & LastChar, inclusive

Description Each Unicode character, in addition to having a printable representation, has an ordinal value. For example uppercase A has an ordinal value of 65, uppercase Z has an ordinal value of 90, and all other uppercase letters have ordinal values between these two. Calling StringRemoveChars("Hello There",65,90) would return "ello here" (The quote marks surrounding the returned value are not actually returned.)

Returns string the resultant string

Param string/source the string from which characters should be removed

Param int/FirstChar the ordinal value of the first character to be removed

Param int/LastChar the ordinal value of the last character to be removed

Category Strings

function StringReplaceChars

Synopsis Replaces all characters in the character list with the specified character.

Description For example stringReplaceChars("hello", "lo","-") would result in he---

Returns string the resultant string

Param string/sSource the string to search

Param string/sCharList string of characters you want to replace occurrences of.

Param string/sChar the char to replace each of the characters in sCharList if found.

Category Strings

function StringReplaceSubstrings

Synopsis Replaces occurances of one substring with another.

Description For example, StringReplaceSubstrings("hello there everyone", "there", an empty string) would result in hello everyone.

Returns string the resultant string

Param string/sSource source string

Param string/sSubstringToReplace the substring in source to replace.

Param string/sReplacement the string to replace any occurances of above string with (maybe null to remove occurances).

Category Strings

function StringReverse

Synopsis Reverses a string.

Description This function reverses a string, useful when you need to look at the differences between the ends of two strings.

Returns String the reversed string.

Param String/sSource string to reverse.

Category Strings

function StringRight

Description Extracts a specified number of rightmost characters from a string.

Returns String The string that is extracted from strString..

Param String/strString The string from which the rightmost characters will be extracted.

Param Int/nCount The number of rightmost characters that will be extracted.

Category Strings

function StringSegment

Description When a string contains delimiters, StringSegment can be called to extract a segment of the string. One is the index of the first string. As of JAWS 7.0, negative numbers extract segments from the right end of the string. So -1 will return the last segment, -2 the second to the last etc.

Returns String The string segment specified by nIndex.

Param String/strString The string that is delimited by some character or characters.

Param String/strDelimiters The delimiter or set of delimiters. This string must be enclosed in quotation marks.

Param Int/nIndex The index of the segment to be retrieved. One is the index of the first segment. -1 is the index of the last segment

Category Strings

function StringSegmentCount

Description Retrieves a count of segments in a string.

Returns Int The count of segments in the string

Param String/strString The string that is delimited by some character or characters.

Param String/strDelimiters The delimiter or set of delimiters. This string must be enclosed in quotation marks.

Category Strings

function StringSegmentIndex

Description When a string contains delimiters, StringSegmentIndex can be called to determine the index of a particular segment.

Returns Int the 1-based index of the specified segment (0 if the segment wasn't found).

Param String/strString The string that is delimited by some character or characters.

Param String/strDelimiters The delimiter or set of delimiters. This string must be enclosed in quotation marks.

Param String/strSegment the segment whose index you want.

Optional

Param Int/iExactMatch true if the segment should match exactly, false to just check that the segment contains the specified string.

Category Strings

function StringSplit

Description Splits a string into an array of strings, with the delimiter excluded from the array.

Returns stringArray An array containing the individual strings into which the original string has been split.

Param string The string to be split.

Param string The delimiter used to split the string. The delimiter will not be included in the array of strings.

Param int True if the array of string should not contain null strings as a result of the split, otherwise specify false to include the null strings.

Category Strings

function StringStartsWith

Description Determines if s1 starts with s2. For example, if s = "Hello there" and s2 = "hello", then the function will return true. Note that the function will also return true if the strings are identical.

Returns int true if s1 starts with s2, false otherwise.

Param string/s1 The first string

Param string/s2 the second string

Optional

Param int true if the compare is to be case sensitive, false otherwise. The default is false.

Category Strings

function stringStripAllBlanks

Synopsis Strips all blanks from a string.

Description this function strips leading, embedded and trailing blanks from a string.

Returns String The string without blanks.

Param String/sStrTOStrip string containing blanks to strip.

Category Strings

function StringToHandle

Description Converts a string value to a handle. It is assumed that the string contains atextual representation of an actual handle value.

Returns Handle The converted string.

Param string The string to be converted to a handle.

Category Strings

function StringToInt

Description Converts a string value to an integer and returns the integer value.

Returns Int The newly created integer.

Param string The string to be converted to an integer.

Category Strings

function StringTrimCommon

Synopsis Compares two strings and trims common characters from either the start, the end or both start and end returning the difference between the strings by reference.

Description This function compares two strings and trims the common characters from either the start, the end or both the start and end. The user specifies which end to trim by setting the third parameter to 0 for both ends, 1 for the start or 2 for the end. For example, if string 1 is "hello world" and string 2 is "hello fred", StringTrimCommon(s1, s2, 1) would return world in s1 and fred in s2 and the return value would be 1. If the strings are identical then the function returns FALSE since there is nothing left after trimming common characters.

Returns int TRUE if the function trimmed common characters and either s1 or s2 contain something after the comparison, FALSE if s1 and s2 are identical.

Param string/ByRef/s1 the first string to compare. Note after calling this function this parameter is replaced by the piece of s1 which is not contained in s2.

Param string/ByRef/s2 the second string to compare. Note after calling this function, s2 is replaced by the piece of s2 which is not contained in s1.

Optional

Param int/nTrimWhat 0 both start and end, (default), 1 trim start, 2 trim end.

Category Strings

function StringTrimLeadingAndTrailingBlanks

Description strips both leading and trailing blanks from a string.

Returns String the string with both leading and trailing blanks trimmed.

Param String/sSource string to trim.

Category Strings

function StringTrimLeadingBlanks

Synopsis Removes leading blanks from a string.

Description strips leading blanks from a string.

Returns String the string with leading blanks trimmed.

Param String/sSource string to trim.

Category Strings

function StringTrimTrailingBlanks

Synopsis Removes trailing blanks from a string.

Description strips trailing blanks from a string.

Returns String the string with trailing blanks trimmed.

Param String/sSource string to trim.

Category Strings

function StringUpper

Description Converts a mixed case string to all upper case.

Returns String The converted string.

Param String/strString the string to be converted.

Category Strings

function SubString

Description Extracts part of a string from another string. It could be used to read a portion of the information that appears on a status line.

Returns String Provides a substring of text for use by other functions.

Param string Type a string to be processed, or specify a variable name or script function that can provide the text string. Text strings must be enclosed within quotation marks.

Param Int Type a number to indicate the position of the first character in the substring which is to be extracted. The index number of the first character in the string is 1.

Param Int Type an integer to indicate the number of characters that are to be extracted from the string. If the int is greater than the number of characters remaining in the string, then the number is silently rounded down.

Category Strings

function SupportsEditCallbacks

Synopsis tests to see if the current control supports the edit callbacks interface

Description Checks the current control to determine if there is an edit callback interface available to handle the caret movement

Returns Int TRUE if edit callback interface is being used, FALSE otherwise.

Category Screen Text

function SuppressG2TranslationForNextStructuredModeSegment

Description Suppresses the translation of the next Braille segment in a set of components for a structured line. Call from a BrailleAddObjectXX callback method which corresponds to a Braille structure component that precedes the component to always be untranslated.

Category Braille Output

function SwitchTextViewerMonitor

Synopsis Moves MAGic's text viewer between multiple monitors.

Description Used to move MAGic's to the next available monitor in a multiple-monitor setup.

Category MAGic

function SwitchTextViewerPosition

Synopsis Switches Text Biewer between top and bottom of screen.

Description Switches MAGic's Text Viewer's position between the top and bottom of the screen.

Category MAGic

function SwitchToConfiguration

Description When this function is called, the currently loaded set of configuration files is unloaded from memory and the specified set of configuration files is loaded in its place.

Returns Int TRUE if the argument passed in is a valid string (not an empty string). FALSE if an invalid string is passed into the function.

Param String/strConfiguration The base name of the set of Configuration files to load. Calling this function with MyConfigurations, for example, would load the Configuration, Keymap, Script, Dictionary, Graphics, Symbols, and Frame files that have base name MyConfiguration.

Category Settings

function SwitchToNextColorScheme

Description MAGic-specific function for switching schemes in MAGic. These functions write to the default.mcf MAGic configuration file.

Category MAGic

function SwitchToNextCursorScheme

Description MAGic-specific function for switching schemes in MAGic. These functions write to the default.mcf MAGic configuration file.

Category MAGic

function SwitchToNextMouseScheme

Description MAGic-specific function for switching schemes in MAGic. These functions write to the default.mcf MAGic configuration file.

Category MAGic

function SwitchToPreviousApp

Synopsis Switches to the nth most recently used application window.

Description This simulates holding down the ALT key and pressing TAB a specified number of times.

Optional

Param int/nTimes The number of times the Tab key should be simulated. This defaults to 1, which which is the equivalent of pressing ALT + TAB.

Category System

function SwitchToPriorColorScheme

Description MAGic-specific function for switching schemes in MAGic. These functions write to the default.mcf MAGic configuration file.

Category MAGic

function SwitchToPriorCursorScheme

Description MAGic-specific function for switching schemes in MAGic. These functions write to the default.mcf MAGic configuration file.

Category MAGic

function SwitchToPriorMouseScheme

Description MAGic-specific function for switching schemes in MAGic. These functions write to the default.mcf MAGic configuration file.

Category MAGic

function SwitchToScheme

Synopsis Switches to the specified Speech Manager Scheme.

Description This function switches to the specified Speech Manager Scheme. If the scheme exists then the function returns TRUE, if it doesn't it returns FALSE and no scheme change occurs.

Returns Int TRUE or FALSE.

Param string sScheme the scheme name (no extention or path required).

Category Speech Markup

function SwitchToScriptFile

Description When this function is called, the currently loaded binary script file (A file with a .JSB extension) is unloaded from memory and one of the two script files specified by the functions parameters is loaded in its place. The first parameter to the function is the name of the first JSB file you wish for JFW to attempt to load into memory and the second parameter gives the name of an alternative binary script file that will only be loaded if the first file cannot be found.

Param String/strScriptFileName1 The name of the binary script file you wish to be loaded into memory. This parameter must be a script file name in quotes or the name of a variable in which the script file name is stored. This parameter must be the script file name with or without a .jsb extension. An attempt to use a .jss extension in the file name will result in an error and a warning dialog box.

Param String/strScriptFileName2 The name of the binary script file you wish to be loaded into memory if the first file does not exist. This parameter must be a script file name in quotes or the name of a variable in which the script file name is stored. This parameter must contain the script file name with or without a .jsb extension. An attempt to use a .jss extension in the file name will result in an error and a warning dialog box.

Category Scripts

function SynthCount

Description Retrieves the number of synthesizers configured in JAWS

Returns Int the number of synthesizers configured in JAWS

Category Settings

function SynthDisplayLoadErrors

Description Retrieves whether or not JAWS displays an error to the user when the synthesizer at the specified index fails to load

Returns Int TRUE if the error should be displayed, FALSE otherwise

Param int/nIndex the index of the synthesizer

Category Settings

function SynthDriver

Description Retrieves the driver name of the synthesizer at the specified index

Returns String The driver name of the requested synthesier, or " ," if there is not a synthesizer at that index.

Param int/nIndex the index of the synthesizer whose driver name is to be retrieved

Category Settings

function SynthDriverInformation

Description Retrieves the driver information of the synthesizer at the specified index

Returns String The driver information string of the requested synthesier, or " ," if there is not a synthesizer at that index.

Param int/nIndex the index of the synthesizer whose driver information string is to be retrieved

Category Settings

function SynthesizerMute

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function SynthLongName

Description Retrieves the descriptive name of the synthesizer at the specified index

Returns String The descriptive name of the requested synthesier, or " ," if there is not a synthesizer at that index.

Param int/nIndex the index of the synthesizer whose name is to be retrieved

Category Settings

function SynthName

Description Retrieves the name of the synthesizer at the specified index

Returns String The name of the requested synthesier, or " ," if there is not a synthesizer at that index.

Param int/nIndex the index of the synthesizer whose name is to be retrieved

Category Settings

function SynthPort

Description Retrieves the port name of the synthesizer at the specified index

Returns String The port name of the requested synthesier, or " ," if there is not a synthesizer at that index.

Param int/nIndex the index of the synthesizer whose port name is to be retrieved

Category Settings

function SynthPortString

Description Retrieves the port string of the synthesizer at the specified index

Returns String The port string of the requested synthesier, or " ," if there is not a synthesizer at that index.

Param int/nIndex the index of the synthesizer whose port string is to be retrieved

Category Settings

function SysGetDate

Description Obtains a string representing the given date in the specified format.

Returns String A string representing the given date, or the current system date if no month, day and year are provided.

Optional

Param String/strFormat The desired date format. For example "dd/MM/yyyy."

Param Int/month A value between 1 and 12.

Param Int/day A value between 1 and the number of days in the month of interest.

Param Int/year Four digits year number.

Category System

function SysGetTime

Description Obtains a string representing the given time in the specified format.

Returns String A string representing the given time, or the current system time if no hour, minute and second are provided.

Optional

Param String/strFormat The desired time format. For example "hh:mm tt."

Param Int/hour A value between 0 and 23.

Param Int/min A value between 0 and 59.

Param Int/sec A value between 0 and 59.

Category System

function SysTrayGetItemCount

Description Obtains the number of items in the System Tray.

Returns Int iIem count.

Category System

function SysTrayGetItemToolTip

Description This function is used in ListTaskTrayIcons to obtain the ToolTip that corresponds to a specific Task tray icon. This function takes a single parameter, the index of the Task tray icon for which the ToolTip is desired. It returns a string value that is the text of the ToolTip in question.

Returns String The text of the tool tip of the specified Task tray icon.

Param Int/nIdx The index of the Task tray icon in question.

Category System

function SysTrayMoveToItem

Description Moves the JAWS cursor to the location of an item in the System Tray.

Returns Int TRUE if Successful.

Param Int/ItemNumber the index number of the item.

Category System

function TabKey

Synopsis Passes the TAB key through to the application.

Description The TAB key is passed to the application. If the Virtual PC cursor is active, it is moved to the next link or control in the tab order.

Category Keyboard

function TandemAcceptConnections

Description Initiates a Tandem target session. Same as going to JAWS menu - Utilities - Tandem - "Allow Control Of My PC".

Returns int returns zero in case of failure, non-zero otherwise.

Category Connection

function TandemDisconnect

Description Break current Tandem connection. Same as going to JAWS menu - Utilities - Tandem - Disconnect.

Returns int Returns zero in case of failure, and non-zero otherwise.

Category Connection

function TandemIsConnected

Description Checks if any type of Tandem session is in progress.

Returns int Returns zero is there is no connections, non zero otherwise.

Category Connection

function tbGetItemRect

Description Gets the bounding rectangle of the specified item in a ToolBar.

Returns Int TRUE if the bounding rectangle is successfully retrieved.

Param Handle/hwnd The handle of the ToolBar of interest.

Param Int/Item index of the item desired.

Param Int/nLeft/ByRef The left edge of the bounding rectangle after the function is called.

Param Int/nRight/ByRef The right edge of the bounding rectangle after the function is called.

Param Int/nTop/ByRef The top edge of the bounding rectangle after the function is called.

Param Int/nBottom/ByRef The bottom edge of the bounding rectangle after the function is called.

Category Dialog Controls

function tbGetItemState

Description Retrieves the state of an item on a ToolBar. Refer to the return states for more information.

Returns Int a combination of state flags. See the TBSTATE_* values in HJCONST.JSH.

Param Handle/hwnd window handle of the ToolBar.

Param Int/item 1-based index of the item.

Category Dialog Controls

function tbGetItemText

Description Retrieves the text of an item in a Toolbar.

Returns String The contents of the requested item. If the item is a graphic, text will only be returned if that graphic has a JAWS graphic label.

Param Handle to the window containing a ToolBar.

Param Int 1-based index of the item in the ToolBAr.

Category Dialog Controls

function TextToHTML

Synopsis converts a plain text string containing URLS to HTML.

Description This function is useful for obtaining text from the output of a script, converting it to HTML and then passing that HTML to the results viewer so that URLS within plain text can be invoked from the results viewer.

Returns string HTML

Param string text to convert

Param string title of HTML document

Category strings

function TextViewerPanLeft

Description When there is more text on a line than can be completely displayed in the Text Viewer, TextViewerPanLeft brings into view text that precedes the currently displayed range of text. If the disable line panning option is unchecked in the Text Viewer Settings dialog, TextViewerPanLeft will move to the previous line if activated while displaying the left-most text on the current line.

Category MAGic

function TextViewerPanRight

Description When there is more text on a line than can be completely displayed in the Text Viewer, TextViewerPanRight brings into view text that follows the currently displayed range of text. If the disable line panning option is unchecked in the Text Viewer Settings dialog, TextViewerPanRight will move to the next line if activated while displaying the right-most text on the current line.

Category MAGic

function TimedMessageBox

Synopsis Displays a message box for a given length of time.

Description Use to assert a message box for a given amount of time while awaiting processing.

Param Int/nButtons Enter the desired MB_ constants from HjConst.jsh, or simply 0 for default behavior. You can use the ICONERROR or other ICON constants to provide known graphics and system beeps.

Param String/strText Enter the text of the message box window.

Param String/strTitle Enter the text for the title of the window.

Param Int/iTimer Enter the time in milliseconds to have the message box stay on the screen.

Category User Interaction

function ToggleBrailleViewerEnable

Description If the Braille Viewer is currently disabled, enable it. If the Braille Viewer is currently enabled, disable it.

Returns int TRUE if the viewer enabled state is toggled, FALSE otherwise.

Category Braille and Text Viewer

function ToggleExpandAbbreviations

Synopsis Toggles the expansion of abbreviations on web pages.

Description This function toggles the expansion of abbreviations on web pages (using the abbr tag) on and off.

Returns String description of value to be displayed as value of Expand abbreviations.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function ToggleExpandAcronyms

Synopsis Toggles the expansion of acronyms on web pages.

Description This function toggles the expansion of acronyms on web pages (using the acronym tag) on and off.

Returns String description of value to be displayed as value of Expand acronyms.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function ToggleHomeRow

Description Toggles Home Row mode ON/OFF. Home Row mode is a shifted state for the keyboard. It is analogous to the NUM LOCK on the numeric keypad. When it is on, the alphabet keys and number keys can be used to perform script functions. When Home Row mode is turned OFF, the keys perform their standard functions.

Returns Int "ON" = 1, "OFF" = 0.

Category Utility

function ToggleLanguageDetection

Synopsis Toggles the language detection.

Description Toggles whether JAWS recognizes language changes.

Returns String description of value to be displayed as value of Language Detection.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category Settings

function ToggleLocatorMode

Description Toggles the current state of the MAGic Locator.

Returns Void

Optional

Param Int 1 if MAGic should restore the original cursor position if exiting the locator.

Category MAGic

function ToggleOutputType

Synopsis cycles the Spoken or Braille output type message level

Description This function cycles the spoken or Brailled output type message length from 0 (don't speak/Braille, 1 use long messages or 2 use short messages). You determine whether the cycling affects Speech or Braille by using the second optional parameter. If this parameter is not specified the function defaults to cycling the Speech message length.

Returns int the new value

Param int/iOutputType the Output Type to cycle.

Optional

Param int/iDestination 0 speech, 1 Braille

Category Braille Settings

function ToggleRestriction

Description This toggles JAWS between restricted and unrestricted mode. These modes do not affect the movement of the PC cursor. When unrestricted mode is used, the other cursors can be freely moved within the active application window. When restricted mode is used, the movement of these cursors is limited to a child window. When the function is used, it returns a constant value representing the new setting. ON indicates that the restriction is on, and OFF indicates that the restriction is off.

Returns Int "ON" = 1, "OFF" = 0.

Category Cursors

function ToggleTextViewer

Synopsis Turns the MAGic Text Viewer on and off.

Description Turns the MAGic Text Viewer on and off.

Returns Int "ON" = 1, "OFF" = 0.

Category MAGic

function ToggleTextViewerEnable

Description If the Text Viewer is currently disabled, enable it. If the Text Viewer is currently enabled, disable it.

Returns int TRUE if the viewer enabled state is toggled, FALSE otherwise.

Category Braille and Text Viewer

function ToggleUseVirtualInfoInFormsMode

Synopsis Toggles the use of information from the Virtual Document when in Forms Mode.

Description This function toggles the use of information from the Virtual Document when in Forms Mode. There are times when the Virtual Document and real document get out of synchronization due to errors in the HTML which will cause erroneous information in Forms Mode when this setting is enabled. If the HTML is correct however, this setting will ensure that prompts spoken for controls in Forms Mode will be identical to the prompts spoken in Virtual Mode.

Returns String description of value to be displayed as value of Use Virtual info for Forms Mode Labels.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category HTML User Settings

function TopAndBottomEdgeIndicate

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function TopOfColumn

Description When inside a table or spreadsheet, moves the active cursor to the top of the current column.

Returns Int TRUE if the cursor moved, FALSE otherwise.

Category Tables

function TrapKeys

Description Turns Trap key mode On or Off. When Trap Key mode is on, any keys not attached to scripts are simply ignored and not passed on to the current application. The primary use for this feature is in the Keyboard Help, where keys not attached to scripts should be ignored.

Param Int TRUE to enable trapping, FALSE to disable it.

Optional

Param Int TRUE to enable trapping of keystrokes used in combination with delayed modifier keys. Set to FALSE, for example, if you want system keys such as Alt to be sent through to the system, even though trap keys is enabled.

Category Keyboard

function TreeCoreGetDefaultBrailleMarkingList

Synopsis Returns the Braille Marking options for the JAWS tree view.

Description Returns the list of options for marking with dots 7 and 8 on the Braille display. This string is formatted for the JAWS tree view.

Returns String the list of options.

Category User Options

function TreeCoreGetDefaultBrailleOptions

Synopsis Returns the list of the default Braille Options.

Description returns all the default Braille options with their complete node paths. These are the options for your Braille display.

Returns String the list of options.

Optional

Param int True if the root node is to be discarded when building the branch to display, false otherwise. Default is false.

Category User Options

function TreeCoreGetDefaultEditingOptions

Description Constructs the branch of the Options tree belonging to Editing Options.

Returns string The branch of the Options tree belonging to Editing Options.

Category User Options

function TreeCoreGetDefaultGeneralOptions

Description Constructs the branch of the Options tree belonging to General Options.

Returns string The branch of the Options tree belonging to General Options.

Category User Options

function TreeCoreGetDefaultNumbersOptions

Description Constructs the branch of the Options tree belonging to Numbers Options.

Returns string The branch of the Options tree belonging to Numbers Options.

Category User Options

function TreeCoreGetDefaultOptions

Synopsis Default options for AdustJawsOptions dialog box.

Description This function returns the string list of all the default options with node paths for the AdjustOptions dialog.

Returns String the list of options.

Category User Options

function TreeCoreGetDefaultReadingOptions

Description Constructs the branch of the Options tree belonging to Reading Options.

Returns string The branch of the Options tree belonging to Reading Options.

Category User Options

function TreeCoreGetDefaultSayAllOptions

Description Constructs the branch of the Options tree belonging to SayAll Options.

Returns string The branch of the Options tree belonging to SayAll Options.

Category User Options

function TreeCoreGetDefaultSpellingOptions

Description Constructs the branch of the Options tree belonging to Spelling Options.

Returns string The branch of the Options tree belonging to Spelling Options.

Category User Options

function TreeCoreGetDefaultVCursorFormsOptions

Description Constructs the branch of the Options tree belonging to Forms Options under the Virtual Options branch.

Returns string The branch of the Options tree belonging to Forms Options under the Virtual Options branch.

Category User Options

function TreeCoreGetDefaultVCursorGeneralOptions

Description Constructs the branch of the Options tree belonging to General Options under the Virtual Options branch.

Returns string The branch of the Options tree belonging to General Options under the Virtual Options branch.

Category User Options

function TreeCoreGetDefaultVCursorGraphicsOptions

Description Constructs the branch of the Options tree belonging to Graphics Options under the Virtual Options branch.

Returns string The branch of the Options tree belonging to Graphics Options under the Virtual Options branch.

Category User Options

function TreeCoreGetDefaultVCursorHeadingAndFrameOptions

Description Constructs the branch of the Options tree belonging to Heading And Frame Options under the Virtual Options branch.

Returns string The branch of the Options tree belonging to Heading And Frame Options under the Virtual Options branch.

Category User Options

function TreeCoreGetDefaultVCursorLinksOptions

Description Constructs the branch of the Options tree belonging to Links Options under the Virtual Options branch.

Returns string The branch of the Options tree belonging to Links Options under the Virtual Options branch.

Category User Options

function TreeCoreGetDefaultVCursorListAndTableOptions

Description Constructs the branch of the Options tree belonging to List And Table Options under the Virtual Options branch.

Returns string The branch of the Options tree belonging to List And Table Options under the Virtual Options branch.

Category User Options

function TreeCoreGetDefaultVCursorOptions

Synopsis This function returns the list of the default options for thh Virtual Cursor

Description This function returns the list of options for the Virtual Cursor, formerly html options.

Returns String the list of options.

Category User Options

function TreeCoreGetDefaultVCursorTextOptions

Description Constructs the branch of the Options tree belonging to Text Options under the Virtual Options branch.

Returns string The branch of the Options tree belonging to Text Options under the Virtual Options branch.

Category User Options

function TreeCoreGetDefaultVCursorTopLevelOptions

Description Constructs the branch of the Options tree belonging to the top level options under the Virtual Cursor Options.

Returns string The the branch of the Options tree belonging to the top level options under the Virtual Cursor Options.

Category User Options

function TULSwitchToRuleSet

Synopsis Switches the TextUnitLocator module to use the named rule set for the currently active cursor.

Description This function switches the TextUnitLocator module to use the named rule set for the currently active cursor. If the name is empty, the default rules set for the current cursor and window class will be used. When switching to the default, the following search is performed: attempt to switch to a set for the current cursor and window class, if not found, switch to the rule for the current cursor, if not found, switch to the default rule. See default.jcf sections whose names begin with TextUnitRuleSet for details. The string following the first part of the section name is used as the rule set name for this function. For example, to switch to the rule set for the section whose name is "TextUnitRuleSet joe", use TULSwitchToRuleSet("joe"). See default.jcf for details about the keys for a rule.

Returns int TRUE or FALSE depending on whether the switch succeeded.

Param string/name of rule to switch active cursor to or empty string to switch back to default for current situation.

Category Cursors

function TurnOffFormsMode

Description Used to turn off forms mode.

Optional

Param int If set to FormsModeEventSpeechSilent, FormsModeEvent will not announce that forms mode is being turned off.

Category HTML

function TurnOnFormsMode

Description Used to turn on forms mode after it has been manually turned off. Unlike calling EnterKey, this function simply re-enables forms mode regardless of what kind of control currently has focus. Note this is only available in JAWS 5.0 international, build 5.00.760 or higher.

Category HTML

function tvCollapse

Description Collapses the currently selected treeview node.

Returns Int TRUE if successful, FALSE otherwise.

Param Handle The TreeView window.

Category Dialog Controls

function tvExpand

Description Expands the currently selected treeview node.

Returns Int TRUE if successful, FALSE otherwise.

Param Handle The TreeView window.

Category Dialog Controls

function tvGetFocusItemExpandState

Description Use this function to get the expanded/collapsed state of the focus item in a treeview. This function does not use MSAA for determining the treeview item state.

Returns int -1 if the focus treeview item has no children, 1 if the focus treeview item is expanded, 0 if the focus treeview item is collapsed.

Param handle The handle of a treeview.

Category Dialog Controls

function tvGetFocusItemText

Description Retrieves the text of the focus item for a treeview.

Returns string The text of the focus item in the tree view.

Param handle The handle of a treeview.

Category Dialog Controls

function tvGetItemStateImageIndex

Description Use this function to distinguish between the differring state graphics that may be placed beside items in a tree view.

Returns int the state image index for the currently active treeview item. This value should change as the state graphic changes on the screen.

Param handle The handle of the treeview window.

Category Dialog Controls

function tvGetItemText

Description Returns a string for a specific tree item.

Returns String The HTREEITEM text.

Param Handle The TreeView window.

Param int/nTreeItem Integer representing a specific HTREEITEM.

Category Dialog Controls

function tvGetParent

Description Returns an integer, representing the HTREEITEM, for the parent of a specific tree item.

Returns int The parent HTREEITEM.

Param Handle The TreeView window.

Param int/nTreeItem Integer representing a specific HTREEITEM.

Category Dialog Controls

function tvGetSelection

Description Returns an integer, representing the HTREEITEM, for the current selected item.

Returns int The selected HTREEITEM.

Param Handle The TreeView window.

Category Dialog Controls

function tvSelectNextItem

Description Selects the next visible item depending on the current selected item.

Returns Int TRUE if successful, FALSE otherwise.

Param Handle The TreeView window.

Category Dialog Controls

function tvSelectPriorItem

Description Selects the prior visible item depending on the current selected item.

Returns Int TRUE if successful, FALSE otherwise.

Param Handle The TreeView window.

Category Dialog Controls

function TypeCurrentScriptKey

Synopsis Passes the attached key through to the application.

Description The key attached to the current script is passed through to the application.

Category Scripts

function TypeFormattedString

Description Types a Formatted string you specify with the messages received as subsequent parameters. The message to be formatted must be delimited with the parameter place holder delimiters, such as %1 %2 %3 %4 %5.

Returns Int The number of keystrokes simulated.

Param String/Message string containing text intermingled with parameter place holders.

Optional

Param String item to be substituted in place of %1 every time it appears in Message.

Param String item to be substituted in place of %2 every time it appears in Message.

Param String item to be substituted in place of %3 every time it appears in Message.

Param String item to be substituted in place of %4 every time it appears in Message.

Param String item to be substituted in place of %5 every time it appears in Message.

Param String item to be substituted in place of %6 every time it appears in Message.

Param String item to be substituted in place of %7 every time it appears in Message.

Param String item to be substituted in place of %8 every time it appears in Message.

Param String item to be substituted in place of %9 every time it appears in Message.

Category Strings

function TypeKey

Description Simulates a keystroke. Unlike TypeString, TypeKey translates the message constant at runtime.

Returns Int TRUE if the string is successfully simulated.

Param string A message constant containing a keystroke name. Or, a string variable or constant containing an integer representing a scan code of the key to be typed.

Optional

Param int - 0 no input origin specified. 1 specifies that the command has originated from the keyboard. 2 specifies that the command has originated from a Braille display (i.e. Whiz wheel up/down). 3 specifies that the command has originated from a mouse click. Defaults to 0.

Category Keyboard

function TypeString

Description Used to simulate a string of keystrokes. For example: to send a group of keystrokes through to the application simulating the string "test," you could either enter the line {t}{e}{s}{t}, or you could use TypeString ("test").

Returns Int The number of keystrokes simulated.

Param string The string of characters that will be sent to the underlying application. This parameter must be enclosed in quotation marks.

Category Strings

function TypingEcho

Synopsis Echoes characters, words, or none.

Description JAWS will echo or speak each character as you type, or just the complete word when you press the space bar, or nothing.

Returns String description of value to be displayed as value of Typing Echo.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category Keyboard

function TypingEchoSet

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function UIARefresh

Synopsis Forces JAWS to reload the name/value/state/description of the object with focus using UI Automation

Description This function is only needed in situations where the object with focus changes without firing MSAA or UI Automation events to let JAWS know to update it's cached data.

Returns int TRUE if successful, FALSE otherwise. When bSynchronous is True then a return of True means that the refresh was successful. When bSynchronous is False, a return of True simply means that the refresh was requested.

Optional

Param int/Synchronous When True the function will not return until the refresh is complete. When False, the function will return immediately and the refresh will complete at some time in the future. If you wish to simply cause a FocusChangedEvent to be called with updated info as the result of the refresh, then pass False for this parameter. If you want to immediately process the updated data and want to suppress any FocusChanged event that could result, then pass True for this parameter.

Param int/MaxMillisecondsToWait If bSynchronous is True, then MaxMillisecondsToWait determines how much time to wait for completion before returning failure. If bSynchronous is False, then this parameter is ignored.

Category Object Model and MSAA

function UIARequestEvents

Synopsis Requests that UI Automation events be sent by a window and optionally by descendent windows

Description This function is used internally by MAGIC scripts to ensure that UIA scrolling events are received. Third party scripters should use the UIAScript API instead.

Returns int TRUE if successful, FALSE otherwise.

Param HANDLE/window The window of interest

Optional

Param int/IncludeDescendentWindows When True, also requests events from descendents of the specified window. Defaults to False.

Category MAGic

function UnloadKeymapSection

Description Unloads a key map section from the key map file.

Returns void

Param string The name of the key map section to unload. The name must match a section in the JKM file, excluding the trailing portion of the section name that specifies the section as a key map. For example, "Custom" specifies the key map section called "[Custom Keys]" in the JKM file.

Category Keyboard

function UnScheduleFunction

Description Used to cancel a ScheduleFunction call.

Returns Int TRUE if the call was found and cancelled, otherwise returns FALSE.

Param Int/ID The value returned by the ScheduleFunction call.

Category Scripts

function UOGrade2Rules

Description Function to toggle the grade II rule to use.

Returns string The braille translation rule mode.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function UpCell

Description When inside a table or spreadsheet, moves the active cursor to the same cell in the prior row.

Returns Int TRUE if the cursor moved, FALSE otherwise.

Category Tables

function UpdateResultsViewerTitle

Synopsis Modifies the Results Viewer's Window Title.

Description This function modifies the Results Viewer's Window Title.

Returns Void

Param String/sText The new Window Title.

Category Virtual Viewer

function UseDocumentServerReadingFunctionality

Synopsis Tests a window to determine whether or not the document sever (FSDOM) should be used in reading operations.

Description The window first must be determined. If the mouse or JAWS cursor was the last to move, then the window at the mouse or JAWS cursor is used. Otherwise, the current focus window is utilized. The window is then tested to see if it is a type that can be handled by the FSDOM.

Returns int TRUE if FSDOM can handle the window, FALSE otherwise.

Category MAGic

function UserBufferActivate

Synopsis Activates the User Virtual Buffer.

Description The User Virtual buffer may be used as a replacement focus for graphical or other windows where the real focus is not meaningful. the User Virtual Buffer maybe populated with text. Each piece of text may have an associated function assigned to it so that when Enter or the Left Mouse button is presssed in this text, the function will be called.

Returns Int true if the buffer was activated, false if already active.

Optional

Param Int/iTrapKeys true to trap (default) false to allow all keys to be passed to the application.

Category Virtual Viewer

function UserBufferActivateEx

Synopsis Activates the User Virtual Buffer with parameters.

Description The User Virtual buffer may be used as a replacement focus for graphical or other windows where the real focus is not meaningful. the User Virtual Buffer maybe populated with text. Each piece of text may have an associated function assigned to it so that when Enter or the Left Mouse button is presssed in this text, the function will be called. This function is like UserBufferActivate except that it accepts parameters to allow a script to identify the user buffer. The passed values are stored for return by UserBufferWindowName, UserBufferWindowType, UserBufferWindowTypeCode, and UserBufferWindowControlID. When UserBufferDeactivate is called these values are copied for return by UserBufferPrevWindowName, etc.

Returns Int true if the buffer was activated, false if already active.

Param String/sName The name that you want to assign the virtual buffer.

Param String/sType The window type that you want to assign the virtual buffer. It has to be a string.

Param Int/iTypecode The type code for the Virtual buffer as an Integer.

Param Int/iControlId The Control Id for the Virtual Buffer as an Integer.

Optional

Param Int/AllowAllKeys True if keys should not be trapped, false otherwise. default is false.

Category Virtual Viewer

function UserBufferAddText

Synopsis Adds the specified text and associated function to the User Virtual Buffer.

Description This function adds the text to the Virtual User Buffer along with the specified function. The function's display name is used in the links dialog as a human readable name in place of the code function name.

Returns Int true if the text was added, false if not.

Param String/sText The text to be added to the buffer (if this doesn't end in a newline character then one will be added)

Optional

Param String/sFunctionString the function name including any parentheses and parameters to be called when the Enter key or mouse click occurs in the associated text.

Param String/sFunctionDisplayName the name to be used in the list links dialog when it is invoked when the User Virtual Buffer is active.

Param String/sFontName the name of the font used for ins + f when located in this text.

Param Int/iPointSize the point size of the font used for ins + f when located in this text.

Param Int/iAttributes the attribute flags used for ins + f when located in this text for.

Param Int/iTextColor the text colour.

Param Int/iBackgroundColor the background color.

Param Int/iAddLineBreak add a line break to this string automatically, true by default.

Param int/ct Control Type (see WT_XX constants in HJConst.jsh (JAWS 7.0 and higher)

Param int/cs Control State, see CTRL_STATE constants in HJConst.jsh (JAWS 7.0 and higher)

Category Virtual Viewer

function UserBufferAddTextResultsViewer

Synopsis Adds the specified text and associated function to the User Virtual Buffer.

Description This function adds the text to the Virtual User Buffer along with the specified function. The function's display name is used in the links dialog as a human readable name in place of the code function name. This Results Viewer version of the UserBufferAddText function also sends text to the Results Viewer's web control.

Returns Int true if the text was added, false if not.

Param String/sText The text to be added to the buffer (if this doesn't end in a newline character then one will be added)

Optional

Param String/sFunctionString the function name including any parentheses and parameters to be called when the Enter key or mouse click occurs in the associated text.

Param String/sFunctionDisplayName the name to be used in the list links dialog when it is invoked when the User Virtual Buffer is active.

Param String/sFontName the name of the font used for ins + f when located in this text.

Param Int/iPointSize the point size of the font used for ins + f when located in this text.

Param Int/iAttributes the attribute flags used for ins + f when located in this text for.

Param Int/iTextColor the text colour.

Param Int/iBackgroundColor the background color.

Param Int/iAddLineBreak add a line break to this string automatically, true by default.

Param int/ct Control Type (see WT_XX constants in HJConst.jsh (JAWS 7.0 and higher)

Param int/cs Control State, see CTRL_STATE constants in HJConst.jsh (JAWS 7.0 and higher)

Category Virtual Viewer

function UserBufferAddTextWithHTML

Description Add text with legal HTML links where the href attribute points to a source to run via the default application. This is not a full HTML document, you must continue to use the standard font / point size / colors codes from Windows / JAWS rather than HTML, but provides a way to run external links not done via runtime macros. The HTML a tag must be done legally, e.g. a name to properly run. Bad HTML gets ignored

Param String/strText The text to be added to the buffer. This text may optionally contain HTML hyperlinks and need not be small chunks. While the links are added in as link on their own lines, all remaining newline characters and white space are as you have them.

Optional

Param int/iAddLineBreak TRUE to add a line break at the end of the text. This would result in two if your text ends with one.

Param String/sFontName the name of the font used for ins + f when located in this text.

Param Int/iPointSize the point size of the font used for ins + f when located in this text.

Param Int/iAttributes the attribute flags used for ins + f when located in this text for.

Param Int/iTextColor the text colour.

Param Int/iBackgroundColor the background color.

Category Virtual Viewer

function UserBufferClear

Synopsis Clears the user buffer of text and associated functions.

Description This function clears the User Virtual Buffer ready to be repopulated with text and functions.

Returns Void

Category Virtual Viewer

function UserBufferClearResultsViewer

Synopsis Clears the user buffer of text and associated functions.

Description This function clears the User Virtual Buffer ready to be repopulated with text and functions. The Results Viewer version of the UserBufferClear function also clears the window contents of the Results Viewer web control.

Returns Void

Category Virtual Viewer

function UserBufferDeactivate

Synopsis Deactivates the User Virtual Buffer.

Description When this occurs, JAWS will track the normal focus rather than allow navigation in the User Virtual Buffer.

Returns Int true if the buffer was deactivated, false if not active.

Category Virtual Viewer

function UserBufferDeactivateResultsViewer

Synopsis Closes the Results Viewer.

Description Closes the Results Viewer.

Returns Int true if Results Viewer was active and closed, false if not active.

Category Virtual Viewer

function UserBufferGetFontInfo

Synopsis Returns the User Buffer's font information.

Description This function returns the font information set by the user for all text added to the buffer for which this information is not specified.

Returns Int true if get was successful.

Param String/byRef/sFontName font name.

Param Int/byRef/iPointSize point size.

Param Int/byRef/iAttributes attributes of text eg attrib_bold & attrib_italic etc.

Param Int/byRef/iTextColor color value for text color.

Param Int/byRef/iBackgroundColor color value for background color.

Category Virtual Viewer

function UserBufferGetLength

Synopsis Gets the number of characters in the User Buffer.

Description This function returns the number of characters in the User Buffer.

Returns Int number of characters (including newlines).

Category Virtual Viewer

function UserBufferGetText

Synopsis Gets the text in the user buffer.

Description This function returns the text in the user buffer. It is useful when you want to save and restore the contents.

Returns String the text.

Category Virtual Viewer

function UserBufferIsActive

Synopsis Determines if the User Virtual Buffer is active.

Description This function determines if the User Virtual Buffer is currently active.

Returns Int true or false.

Category Virtual Viewer

function UserBufferIsActiveResultsViewer

Synopsis Determines if the Results Viewer is active.

Description Determines if the Results Viewer is active.

Returns Int true or false.

Category Virtual Viewer

function UserBufferIsTrappingKeys

Synopsis Determines if the User Virtual Buffer is trapping keys.

Description This function determines if the User Virtual Buffer is currently trapping keys.

Returns Int true or false.

Category Virtual Viewer

function UserBufferPrevWindowName

Synopsis Retrieves the previous window name that was assigned to a virtual buffer.

Description This function retrieves the window name that was assigned to the previously active virtual buffer. It is the value returned by UserBufferWindowName prior to the last invocation of UserBufferDeactivate.

Returns String Returns the window name of the previous virtual buffer.

Category Virtual Viewer

function userBufferPrevWindowType

Synopsis Retrieves the Window type name assigned to the previous virtual buffer.

Description This function retrieves the Window type name that was assigned to the previous virtual buffer.

Category Virtual Viewer

function UserBufferSetFontInfo

Synopsis Allows user to specify default font name, point size, attribs and text/background colors.

Description This function allows user to specify default font name, point size, attribs and text/background colors, so this info doesn't have to be added for each segment of text.

Returns Int true if set was successful.

Param String/sFontName font name.

Param Int/iPointSize point size.

Param Int/iAttributes attributes of text eg attrib_bold & attrib_italic etc.

Param Int/iTextColor color value for text color.

Param Int/iBackgroundColor color value for background color.

Category Virtual Viewer

function UserBufferWindowName

Synopsis Retrieves the window name that was specified by the UserBufferActivateEx function.

Description This function retrieves the window name that was specified by the UserBufferActivateEx function.

Returns string the user buffer window name

Category Virtual Viewer

function userBufferWindowType

Synopsis Retrieves the Window type name that was specified by the UserBufferActivateEx function.

Description This function retrieves the Window type name that was specified by the UserBufferActivateEx function.

Category Virtual Viewer

function UseSapi5ForSayAll

Synopsis Returns TRUE if SAPI 5 should be used for Say All.

Description This function returns TRUE if SAPI 5 should be used for Say All and returns FALSE otherwise.

Returns Int TRUE if SAPI 5 should be used for Say All. FALSE otherwise.

Category Voices

function UsingRemotePACMateBX

Description determines if JAWS is running in an remote PAC Mate BX session.

Returns int TRUE if running in a remote PAC Mate BX session.

Category Keyboard

function vCursorAbbreviationsExpand

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorAccessKeysShow

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorAcronymsExpand

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorAttributesIndicate

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorBlockQuotesIdentifyStartAndEnd

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorButtonsShowUsing

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorCustomPageSummary

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorFormFieldsIdentifyPromptUsing

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorFormsModeAutoOff

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorFramesShowStartAndEnd

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorGraphicalLinksSet

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorGraphicsSetRecognition

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorGraphicsSetRecognitionJlp

Description Help callback function which provides help for the selected setting and item in the tree view inspired by the dlgSelectTreeFunctionToRun internal function.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value which may be set by the internal dlgSelectTreeFunctionToRun function.

Category User Options

function vCursorGraphicsShow

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorHeadingsAnnounce

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorImageMapLinksShow

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorInlineFramesShow

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorLayoutTables

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorLinksIdentifySamePage

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorLinksIdentifyType

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorListsIdentifyStartAndEnd

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorRepeatedTextSkip

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorScreenTrack

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorTablesShowStartAndEnd

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorTableTitlesAnnounce

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorTextLinksShow

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function vCursorUntaggedGraphicalLinkShow

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function VerbosityLevel

Description Changes the verbosity setting. Settings include Beginner, Intermediate, and Advanced. The verbosity setting determines how much descriptive information is to be spoken as you use Windows.

Category Settings

function VerbosityLevelToggle

Synopsis Toggles Verbosity from Beginner, to Intermediate, to Advanced.

Description Controls how much JFW will say when the focus changes or other events occur on the screen or in response to key strokes.

Returns String description of value to be displayed as value of Verbosity Level setting.

Param Int/iRetCurVal true if current value is to be returned, false if value is to be updated and returned.

Category Settings

function VerbositySetLevel

Description Callback function for the dlgSelectTreeFunctionToRun function. The int parameter is set to TRUE when the tree is refreshed, FALSE if the corresponding option was executed.

Returns string The human-readable string name of the new setting.

Param int/iRetCurVal The value set by the internal dlgSelectTreeFunctionToRun function. 0 = change setting, 1 = retain current setting.

Category User Options

function VisualStudioGetAddinObject

Description Works around a bug in Visual Studio 2010 where a script can't call any methods on an AddIn retrieved from the VisualStudio AddIns collection. The AddIn thus retrieved provides information like the name and ProgId of the AddIn, and a function called GetObject that provides an IDispatch interface to the AddIn itself. This function does the job of the AddIn.GetObject method were it not to be broken.

Returns object that gives access to the public methods of the Connect object implemented by the AddIn

Param object/AddIn An AddIn object as retrieved from the VisualStudio AddIns collection.

Category Object Model And MSAA

function WaitForFocusToMoveTo

Description This function waits to return until the specified object has gained focus, or the timeout has elapsed. It is used to wait for MSAA objects to receive focus, so you should not simply use zeros for parameters 2 and 3. You can get the necessary handle, object ID, and child ID that identify the MSAA object with the function GetFocus.

Returns int True if this function returned because the specified object gained focus. False if this function returned because the timeout elapsed.

Param handle Handle of the window that is expected to receive focus.

Param int Object ID of the object that is expected to receive focus.

Param int Child ID of the object that is expected to receive focus.

Param int Maximum amount of time, in milliseconds, that the function should wait before returning if the specified object does not receive focus.

Category Object Model And MSAA

function WasTextAlreadyAppended

Synopsis Checks if a text is already in the clipboard.

Description Checks if text is already in the clipboard.

Returns Int TRUE if already exists.

Param String/sSourceText The current collection of appended text.

Param String/sTextToFind The text that is about to be appended.

Category Clipboard

function WindowActivatedEvent

Synopsis This function is triggered when a window is activated.

Description This function is generally triggered when focus changes because of the opening or closing of a top-level window, such as when a dialog appears or disappears.

Param handle/hWindow Handle of the window just activated.

Category Window Events

function WriteSettingInteger

Synopsis Writes an integer value to an ini style file.

Description Writes an integer value to an ini style file. An ini style file is a file containing sections of keys with their values. The file that is written to is identified by the FileType parameter and an optional FileName parameter. For some values of the FileType parameter, FT_CURRENT_JCF and FT_JSI, for which a file name is required, the value returned by GetActiveConfiguration will be used if a file name is not provided via the FileName parameter. For FT_CURRENT_JCF, if a file name is not supplied, the domain-specific file will be used if available. Otherwise, the application's jcf file will be used.

Returns int TRUE if successful, FALSE otherwise.

Param string/sectionName The name of the section where the key and value will be written. This value must either be a variable or contained in quotes.

Param string/keyName The name of the key that will hold the value. This value must either be a variable or contained in quotes.

Param int/keyValue The value that will be written to the given key.

Param int/FileType One of the FileType (FT_) constants that identify the type of file and its location. The currently supported file types for writing are as follows: FT_DEFAULT_JCF: The file Default.JCF. The FileName parameter is ignored for this file type. When writing to this file, the changes will always be written to either the copy of Default.JCF found in the user settings directory or one of the transient settings files for Default.JCF, depending on the value of the WriteDestination parameter. The copy of Default.JCF found in the shared settings directory will never be modified. FT_CURRENT_JCF: Any domain-specific JCF file. If not found, the application jcf file will be used. If the FileName parameter is not specified, the value returned by GetActiveConfiguration will be used. When writing to this file, the changes will always be written to either the copy of the JCF file found in the user settings directory or one of the transient settings files for the JCF file, depending on the value of the WriteDestination parameter. The copy of the JCF file found in the shared settings directory will never be modified. FT_JSI: A JSI file. If the FileName parameter is not specified, the value returned by GetActiveConfiguration will be used. The changes will always be written to the PersonalizedSettings subdirectory of the user settings directory. The file types FT_MODULE_INI, FT_SHARED_DEFAULT_JCF, and FT_SHARED_CURRENT_JCF are not supported by WriteSettingInteger.

Optional

Param int/WriteDestination One of the WriteDestination (wd) constants defined in HJConst.JSH. The possible values are as follows: wdUser - indicates that the setting should be saved to the user settings file; wdSession - indicates that the setting should be saved to the transient session settings file; wdFocus - indicates that the setting should be saved to the transient focus settings file. Note that this parameter is ignored if the FileType parameter is FT_JSI. If this parameter is not specified the default value of wdUser will be used.

Param string/FileName The name of file to write to. This value must either be a variable or contained in quotes. It is unnecessary to specify the full path of the file, only the file name need be specified, since the file used will always be located in either the user settings directory or the personalized settings directory. The FileType parameter is used to determine in which directory the file will be placed. If this parameter is not specified and a file name is required for the specified file type, the value returned by GetActiveConfiguration will be used. It is not necessary to specify the file extension since the file extension that is appropriate for the specified file type will be added automatically.

Category Files

function WriteSettingString

Synopsis Writes a string value to an ini style file.

Description Writes a string value to an ini style file. An ini style file is a file containing sections of keys with their values. The file that is written to is identified by the FileType parameter and an optional FileName parameter. For some values of the FileType parameter, FT_CURRENT_JCF and FT_JSI, for which a file name is required, the value returned by GetActiveConfiguration will be used if a file name is not provided via the FileName parameter. For FT_CURRENT_JCF, if a file name is not supplied, the domain-specific file will be used if available. Otherwise, the application's jcf file will be used.

Returns int TRUE if successful, FALSE otherwise

Param string/sectionName The name of the section where the key and value will be written. This value must either be a variable or contained in quotes.

Param string/keyName The name of the key that will hold the value. This value must either be a variable or contained in quotes.

Param string/keyValue The value that will be written to the given key.

Param int/FileType One of the FileType (FT_) constants that identify the type of file and its location. The currently supported file types for writing are as follows: FT_DEFAULT_JCF: The file Default.JCF. The FileName parameter is ignored for this file type. When writing to this file, the changes will always be written to either the copy of Default.JCF found in the user settings directory or one of the transient settings files for Default.JCF, depending on the value of the WriteDestination parameter. The copy of Default.JCF found in the shared settings directory will never be modified. FT_CURRENT_JCF: Any domain-specific JCF file. If not found, the application jcf file will be used. If the FileName parameter is not specified, the value returned by GetActiveConfiguration will be used. When writing to this file, the changes will always be written to either the copy of the JCF file found in the user settings directory or one of the transient settings files for the JCF file, depending on the value of the WriteDestination parameter. The copy of the JCF file found in the shared settings directory will never be modified. FT_JSI: A JSI file. If the FileName parameter is not specified, the value returned by GetActiveConfiguration will be used. The changes will always be written to the PersonalizedSettings subdirectory of the user settings directory. The file types FT_MODULE_INI, FT_SHARED_DEFAULT_JCF, and FT_SHARED_CURRENT_JCF are not supported by WriteSettingString.

Optional

Param int/WriteDestination One of the WriteDestination (wd) constants defined in HJConst.JSH. The possible values are as follows: wdUser - indicates that the setting should be saved to the user settings file; wdSession - indicates that the setting should be saved to the transient session settings file; wdFocus - indicates that the setting should be saved to the transient focus settings file. Note that this parameter is ignored if the FileType parameter is FT_JSI. If this parameter is not specified the default value of wdUser will be used.

Param string/FileName The name of file to write to. This value must either be a variable or contained in quotes. It is unnecessary to specify the full path of the file, only the file name need be specified, since the file used will always be located in either the user settings directory or the personalized settings directory. The FileType parameter is used to determine in which directory the file will be placed. If this parameter is not specified and a file name is required for the specified file type, the value returned by GetActiveConfiguration will be used. It is not necessary to specify the file extension since the file extension that is appropriate for the specified file type will be added automatically.

Category Files



chrome.jss

; Copyright 2014-2023 by Freedom Scientific BLV Group, LLC
;Freedom Scientific Script file For Google Chrome

Include "HJConst.jsh"
Include "HJGlobal.jsh"
Include "HJHelp.jsh"
Include "common.jsm"
Include "Chrome.jsh"
Include "Chrome.jsm"
Include "MSAAConst.jsh"
Include "UIA.jsh"
Include "ie.jsm"

Import "UIA.jsd"
Use "IA2Browser.jsb"

Const
    Edge="msedge.exe",
    ShiftKey = 0x800000,
    CTRLKey = 0x10000,
    key_LeftArrow = 0x4b,
    key_RightArrow = 0x4d,
    key_Home = 0x47,
    key_End = 0x4f

Globals
    IntArray restrictedIDs,
    Int gChromeVersion,
    Int gChromeMinorVersion,
    Int gChromeUpdateVersion,
    String appName,
    Int lastFocusType,
    Int lastKeyWasSelecting,
    Int lastKeyWasScripted,
    String chromeAutoCompleteAddress

;gbIsBrowserUIDialog accesses the global from IA2Browser:
Globals Int gbIsBrowserUIDialog

Const
    scTabSearchTopChromeIdentifyer = "chrome://tab-search.top-chrome/" ;address of the page which gains focus when Control+Shift + A is pressed

Globals
    Int gsDocID, ;copied from IA2Browser.jss, used in SayNewDocumentTab
    Int gsPrevDocID ;copied from IA2Browser.jss, used in SayNewDocumentTab

;For scheduling announcement of descriptionChangedEvent While typing in the Tab Search edit field:
Const
    DescriptionChangedEventAnnouncementWaitTime = 3 ;tenths of a second
Globals
    Int ScheduleIDDescriptionChangedEventAnnouncement,
    String gsDescriptionChangedEventText

;For scheduling SelectionChangedEvent when typing On the address bar,
;and For detecting when To announce a value change when tabbing:
Const
    SayAutoCompleteAddressAfterPauseWaitTime = 6 ;tenths of a second
Globals
    Int ScheduleIDSayAutoCompleteAddressAfterPause

;For managing announcement of New tab page in BrowserTabChangedEvent:
Globals
    Int gChromeBrowserTabID,
    Handle gChromeBrowserTabHWnd

;For detecting radio buttons in the chrome area of Chrome which generate no event when toggled:
Globals
    Int ScheduleIDUpdateAndSayNewStateOfRadioButton 

Void Function autoStartEvent()
GetFixedProductVersion(GetAppFilePath (), gChromeVersion, gChromeMinorVersion, gChromeUpdateVersion, 0)
appName = GetAppFileName ()
LoadNonJCFOptions ()
lastFocusType = wt_UNKNOWN
lastKeyWasSelecting = False
EndFunction

Int Function ShouldNotifyIfContextHelp()
Return Off
EndFunction

Int Function BrailleCallbackObjectIdentify()
If IsTouchCursor() Return BrailleCallbackObjectIdentify() EndIf
If GetObjectSubtypeCode() == wt_unknown
&& GetObjectRole() == Role_System_PageTabList
    Return wt_tabControl
EndIf
Return BrailleCallbackObjectIdentify()
EndFunction

Int Function BrailleAddObjectDescription(Int nSubtypeCode)
If nSubtypeCode == wt_button
&& StringLower(GetObjectname()) == StringLower(GetObjectDescription())
    ;Avoid information duplication, add nothing.
    Return True
ElIf nSubtypeCode == wt_TabControl
&& GetObjectRole() == Role_System_PageTabList
    ;Description duplicates information from name, add nothing.
    Return True
EndIf
Return BrailleAddObjectDescription(nSubtypeCode)
EndFunction

Int Function BrailleAddObjectContextHelp(Int nSubtypeCode)
Return True ; added no String, corrects later versions of Google 
EndFunction

Int Function IsBrowserContentWindow(Handle hwnd)
Return GetWindowClass(hwnd) == wc_ChromeWindowClass
EndFunction

Int Function IsBrowserUIDialog()
Return !UserBufferIsActive()
    && GetWindowClass(getFocus()) == wc_Chrome_WidgetWin_1
    && FindAncestorOfType(wt_dialog) != -1
EndFunction

Int Function ShouldUseDoSayObjectFromLevel( Handle focusWindow, Handle prevWindow )
Return !gbIsBrowserUIDialog
    && !IsOnAddressBarEdit()
EndFunction

String Function GetDocumentNameFromRealWindow()
Var
    String name
;No dom, so must get document name via RealWindowName (MSAA gets it)
name = GetWindowName(GetRealWindow(GetFocus()))
If StringContains(name, scTrimName_ChromeTitleBar)
    Return StringChopRight(name, StringLength(scTrimName_ChromeTitleBar))
EndIf
Return cscNull
EndFunction

String Function GetBrowserName(optional Int includeMaker)
If includeMaker
    Return msgGoogleChromeAppName
else
    Return msgChromeAppName
EndIf
EndFunction

Script ScreenSensitiveHelp ()
If IsSameScript () Then
    AppFileTopic(topic_Chrome)
    Return
EndIf
PerformScript ScreenSensitiveHelp()
EndScript

Int Function ShouldHandleParagraphNavigation()
Var Int isVirtualCursorTabSpecific = GetJCFOption(OPT_VirtualCursorIsTabSpecific )
Var Int vCursorSetting 
If isVirtualCursorTabSpecific Then
    vCursorSetting = GetVirtualCursorSettingForTab(GetTabID())
else
    vCursorSetting = GetJCFOption (OPT_VIRTUAL_PC_CURSOR)
EndIf
    
If (vCursorSetting == 0) Then
    Return True
EndIf

If IsFormsModeActive() || IsInsideARIAApplication () Then
    Return True
EndIf

Return False
EndFunction

Void Function CaretMovedEvent( Int movementUnit, optional Int source)
;In Chrome multiline edits, movementUnit is reported as 0.
If !movementUnit
&& lastKeyWasScripted
    Var String scriptName = GetScriptAssignedTo(GetCurrentScriptKeyName())
    If scriptName == "ControlUpArrow"
        Return CaretMovedEvent(Unit_Paragraph_Prior, source)
    ElIf scriptName == "ControlDownArrow"
        Return CaretMovedEvent(Unit_Paragraph_Next, source)
    EndIf
EndIf
CaretMovedEvent( movementUnit, source)
EndFunction

Void Function UnitMoveControlNav (Int UnitMovement)
If ShouldHandleParagraphNavigation() Then 
    Var Int objType=GetObjectSubtypeCode ()
    If SupportsEditCallbacks ()
    && objType != wt_multiline_edit
        ;NextParagraph and PriorParagraph do Not properly navigate in Chrome multiline edits.
        If UnitMovement == UnitMove_Next Then
            NextParagraph()
        ElIf UnitMovement == UnitMove_Prior Then
            PriorParagraph()
        EndIf
        Return
    EndIf

    If UnitMovement == UnitMove_Next Then
        TypeKey(cksControlDownArrow) 
    ElIf UnitMovement == UnitMove_Prior Then
        TypeKey(cksControlUpArrow)
    EndIf

    pause()
    If objType == WT_TABCONTROL Then
        sayWord()
    EndIf
    Return
EndIf
Return UnitMoveControlNav (UnitMovement)
EndFunction

Int Function IsOnAddressBarEdit()
If GetWindowClass(GetFocus()) != wc_Chrome_WidgetWin_1 Return False EndIf
Return lastFocusType == wt_edit
EndFunction

Void Function SayLineFromCaretMovedEvent(Int movementUnit)
If IsOnAddressBarEdit()
    ;The value change and selection change events will speak the address bar change:
    Return
EndIf
SayLineFromCaretMovedEvent(movementUnit)
EndFunction

Int Function ContractedBrailleInputAllowedNow ()
;event Function designed To Return False On controls that would otherwise support contracted input.
;Example would be an application whose edit controls may also support quick navigation keys, once said keys are On Return False from this Function To turn them Off.
;This Function is only called when the item with focus supports contracted input To begin with.
If IsOnAddressBarEdit() Then
    Return False
EndIf
Return ContractedBrailleInputAllowedNow () ; Fall back To default.
EndFunction

Void Function ActiveItemChangedEvent (Handle curHwnd, Int curObjectId, Int curChildId,
    Handle prevHwnd, Int prevObjectId, Int prevChildId)
If IsBrowserContentWindow(curHwnd) && GetObjectSubtypeCode()==wt_comboBox Then
    say(GetObjectValue(), OT_LINE)
    Return
EndIf

ActiveItemChangedEvent (curHwnd, curObjectId, curChildId, prevHwnd, prevObjectId, prevChildId)
EndFunction

Void Function SayAutoCompleteAddressAfterPause ()
ScheduleIDSayAutoCompleteAddressAfterPause = 0
Say (chromeAutoCompleteAddress, OT_LINE, True)
SayMessage (ot_select, cmsg215_l)
chromeAutoCompleteAddress = cscNull
EndFunction

Void Function SelectionChangedEvent( String text, Int wasTextSelected, optional Int source )
If ScheduleIDSayAutoCompleteAddressAfterPause
    UnscheduleFunction(ScheduleIDSayAutoCompleteAddressAfterPause)
EndIf
If IsOnAddressBarEdit() 
&& !lastKeyWasSelecting
    If !StringLength(getSelectedText())
        ;This happens when successive presses of Control+T For a New tab occurs.
        ;We get an irroneous selection change of text "address and".
        Return
    EndIf
    If wasTextSelected
        ;When the first letter is entered into the search edit field,
        ;the SecondaryFocusChangedEvent will probably, but Not reliably, speak when the first letter is entered,
        ;and at this point announcing the selection here would be spammy.
        ;however, continuing To type in the search edit results in this event firing and Not the SecondaryFocusChangedEvent.
        ;We schedule a delay both To avoid spamming While typing,
        ;and To give SecondaryFocusChangedEvent a chance To unschedule speaking of the selection change If that event fires.
        chromeAutoCompleteAddress = text
        ScheduleIDSayAutoCompleteAddressAfterPause = ScheduleFunction ("SayAutoCompleteAddressAfterPause", SayAutoCompleteAddressAfterPauseWaitTime, True)
    EndIf
    ;This event fires To remove the selection as you tab from the editable text.
    ;Do nothing here when this event fires For the deselection, To avoid hearing the deselection when no longer in the editable text.
    Return
EndIf
;this is To keep selection event On an address bar from speaking when switching tabs
SelectionChangedEvent( text, wasTextSelected, source )
EndFunction

Void Function SecondaryFocusChangedEvent()
If ScheduleIDSayAutoCompleteAddressAfterPause
    UnscheduleFunction(ScheduleIDSayAutoCompleteAddressAfterPause)
EndIf
If IsOnAddressBarEdit()
    ;Speaking is handled by ValueChangedEvent
    Return
EndIf
SecondaryFocusChangedEvent()
EndFunction

Void Function ValueChangedEvent (Handle hwnd, Int objId, Int childId, Int nObjType, String sObjName, String sObjValue, optional Int bIsFocusObject)
If IsOnAddressBarEdit()
&& bIsFocusObject
    ;We want To announce the value change On the address bar when navigating,
    ;and Not when typing or deleting text.
    ;SelectionChangedEvent will announce If the address bar text changes due To typing in New text.
    Var String scriptName = GetScriptAssignedTo(GetCurrentScriptKeyName())
    If lastKeyWasScripted
    && (scriptName == "SayNextLine"
    || scriptName == "SayPriorLine"
    || scriptName == "Tab"
    || scriptName == "ShiftTab")
        Say(sObjValue, ot_line)
    EndIf
    Return
EndIf
If (gChromeVersion < 69 
&& getObjectSubtypeCode()==wt_combobox) Then
    Return ;spoken from activeItemChanged event, filter here To avoid multiple speaking.
EndIf
ValueChangedEvent (hwnd, objId, childId, nObjType, sObjName, sObjValue, bIsFocusObject)
EndFunction

Void Function SayLineUnit(Int unitMovement, optional Int bMoved)
If !IsVirtualPCCursor() && GetObjectSubtypeCode()==WT_COMBOBOX Then
    Return; ActiveItemChangedEvent will speak this.
EndIf
SayLineUnit(unitMovement, bMoved)
EndFunction

Int Function IsValidForTraverseBrowserUIDialogAndReadControls(String dlgName, Object element)
Return element.name != dlgName
EndFunction

Script readBoxInTabOrder()
If gbIsBrowserUIDialog 
    ;GetTypeAndTextStringsForWindow often retrieves text with duplications,
    ;so we first try To Use UIA To traverse and read the elements.
    If !ReadBrowserUIDialogBox()
        Say(GetTypeAndTextStringsForWindow(getFocus()), ot_USER_REQUESTED_INFORMATION)
    EndIf
    Return
EndIf
performScript ReadBoxInTabOrder()
EndScript

Void Function GetWindowTitleForApplication(Handle hAppWnd, Handle hRealWnd, Handle hCurWnd, Int iTypeCode,
    String ByRef sTitle, String ByRef sSubTitle, Int ByRef bHasPage)
If IsBrowserContentWindow(hCurWnd)
&& StringCompare (StringSegment (GetOwningAppName (GetFocus ()), ".", 1), "chrome") == 0
    sTitle=GetObjectName(SOURCE_CACHED_DATA, GetAncestorCount ())
EndIf
If StringIsBlank (sTitle)
    GetWindowTitleForApplication(hAppWnd, hRealWnd, hCurWnd, iTypeCode, sTitle, sSubTitle, bHasPage)
EndIf
EndFunction

Int Function HandleCustomAppWindows (Handle hWnd)
; Alt tabbing To Chrome.
If getWindowClass(hWnd)==wc_Chrome_WidgetWin_1 Then
    say(GetObjectName(SOURCE_CACHED_DATA, GetAncestorCount ()), ot_window_name)
    Return True
EndIf
Return HandleCustomAppWindows (hWnd)
EndFunction

Script PictureSmartWithControl (optional Int serviceOptions)
Return PictureSmartWithControlShared (PSServiceOptions_Single | serviceOptions)
EndScript

Script PictureSmartWithControlMultiService (optional Int serviceOptions)
Return PictureSmartWithControlShared (PSServiceOptions_Multi | serviceOptions)
EndScript

Int Function ShouldSpeakItemAtLevel(Int level, Int type, Int parentType, Int focusRole, Int focusType)
Var
    Int ancestorRole = GetObjectRole(level),
    Int ancestorCount = GetAncestorCount(),
    Int dialogAncestor = FindAncestorOfType(wt_dialog),
    String ancestorName = cscNull,
    String dialogName = cscNull
If (ancestorRole == ROLE_SYSTEM_WINDOW && level == ancestorCount)
    If (dialogAncestor != -1)
        ancestorName = GetObjectName(SOURCE_CACHED_DATA, level)
        dialogName = GetObjectName(SOURCE_CACHED_DATA, dialogAncestor)
        If (ancestorName == dialogName)
            Return False
        EndIf
    EndIf
    Return True
EndIf
If (ancestorRole == ROLE_SYSTEM_WINDOW || ancestorRole == ROLE_SYSTEM_PANE)
    Return False
EndIf
Return ShouldSpeakItemAtLevel(level, type, parentType, focusRole, focusType)
EndFunction

Int Function NewBrowserTabIsNewPage(Handle hWnd)
Return gChromeBrowserTabHWnd != hWnd
EndFunction

Void Function AnnounceNewTabOrPageFromBrowserTabChangedEvent(Handle hWnd)
;When Control+N is used, a New window opens and the focus change will speak the focused Object.
;But when Control+T is used, a New tab is created but the focus does Not change so we should also announce the focused Object.
If !NewBrowserTabIsNewPage(hWnd)
    SayFormattedMessage(ot_screen_message, msgNewTabPage)
    SayObjectTypeAndText()
else
    SayFormattedMessage(ot_screen_message, msgNewWindow)
EndIf
EndFunction

Void Function BrowserTabChangedEvent(Int tabID, Handle hWnd)
;fires when changing browser tabs.
If gChromeBrowserTabID != tabID
    ;Ensure this announcement only happens If the New tab event is generated While On the address bar:
    If GetWindowClass(GlobalPrevFocus) == cwc_Chrome_WidgetWin_1
        AnnounceNewTabOrPageFromBrowserTabChangedEvent(hWnd)
    EndIf
EndIf
gChromeBrowserTabID = tabID
gChromeBrowserTabHWnd = hWnd
EndFunction

Prototype Int Function GetTabID()
Prototype Int Function GetVirtualCursorSettingForTab(Int tabID)
Prototype Void Function SetVirtualCursorSettingForTab(Int tabID, Int vCursorSetting)

Script VirtualPCCursorToggle ()
Var Int isVirtualCursorTabSpecific = GetJCFOption(OPT_VirtualCursorIsTabSpecific )
If (!isVirtualCursorTabSpecific ) Then
    PerformScript VirtualPCCursorToggle() 
    Return
EndIf
Var Int vCursorSetting = GetVirtualCursorSettingForTab(GetTabID())
If vCursorSetting == 0 Then
    vCursorSetting = 1
else
    vCursorSetting = 0
EndIf

refresh()
BrailleRefresh()

SetVirtualCursorSettingForTab(GetTabID(), vCursorSetting )
If vCursorSetting Then
    SayFormattedMessage(ot_status, cMSG291_L, cmsgOn)
else
    SayFormattedMessage(ot_status, cmsg292_L, cmsgOff)
EndIf
EndScript

Int Function SayLineInsteadOfSayAll()
Var
    Int type
Let type = GetObjectSubTypeCode(SOURCE_CACHED_DATA, 0)
If IsPcCursor()
&& !IsVirtualPcCursor()
&& DialogActive() Then
    If (type == WT_MULTILINE_EDIT) Then
        Return False
    EndIf
EndIf
Return SayLineInsteadOfSayAll() 
EndFunction
Int Function ContextMenuProcessed(Handle hWnd)
If (IsBrowserContentWindow(hwnd))
 Return
EndIf

Return ContextMenuProcessed (hwnd )
EndFunction

Void Function HandleUnknownAncestor (Int level, Int focusType, Int pageIsChanging)
If (level < 1) Then
    Return
EndIf
 
If (GetObjectSubtypeCode(SOURCE_CACHED_DATA, level) != WT_UNKNOWN) Then
    Return
EndIf
 
If ( GetObjectName(SOURCE_CACHED_DATA, level) == " " ) Then
    Return
EndIf
 
Var
    Int ancestorCount,
    String focusedElementName,
    String ancestorElementName
 
focusedElementName = stringStripAllBlanks (GetObjectName(SOURCE_CACHED_DATA, 0))
ancestorElementName = stringStripAllBlanks (GetObjectName(SOURCE_CACHED_DATA, level))
ancestorCount = GetAncestorCount ()
If (level != ancestorCount 
&& (StringContains (ancestorElementName, focusedElementName))) Then
    Return 
EndIf

If GetObjectSubTypeCode(SOURCE_CACHED_DATA, 0) == WT_UNKNOWN
    Return ;focused Object and ancestor Object are both unknown types, just speak the focused Object
EndIf

SayObjectTypeAndText (level)
EndFunction

Void Function PreProcessFocusChangedEventEx(
    Handle hwndFocus, Int nObject, Int nChild,
    Handle hwndPrevFocus, Int nPrevObject, Int nPrevChild,
    Int nChangeDepth)
lastFocusType = GetObjectSubTypeCode(False, 0)
If ScheduleIDUpdateAndSayNewStateOfRadioButton 
    UnscheduleFunction(ScheduleIDUpdateAndSayNewStateOfRadioButton )
    ScheduleIDUpdateAndSayNewStateOfRadioButton = 0
EndIf
PreProcessFocusChangedEventEx(hwndFocus, nObject, nChild, hwndPrevFocus, nPrevObject, nPrevChild, nChangeDepth)
EndFunction

Void Function ProcessSayRealWindowOnFocusChange(
     Handle AppWindow, Handle RealWindow, String RealWindowName, Handle FocusWindow)
If GetWindowClass(GlobalPrevFocus) !=wc_Chrome_WidgetWin_1
    If gbIsBrowserUIDialog 
        ;A dialog from the browser UI has just gained focus.
        SayAndCacheBrailleForBrowserUIDialogNameAndText()
        Return
    EndIf
EndIf
ProcessSayRealWindowOnFocusChange(AppWindow, RealWindow, RealWindowName, FocusWindow)
EndFunction

Int Function IsKeySelectingText(Int keyCode)
Var Int isShiftLeft = (keyCode&~ShiftKey) == key_LeftArrow
Var Int isShiftRight = (keyCode&~ShiftKey) == key_RightArrow
Var Int isShiftCTRLLeft = (keyCode&~(ShiftKey|CTRLKey)) == key_LeftArrow
Var Int isShiftCTRLRight = (keyCode&~(ShiftKey|CTRLKey)) == key_RightArrow
Var Int isShiftHome = (keyCode&~ShiftKey) == key_Home
Var Int isShiftEnd = (keyCode&~ShiftKey) == key_End
Return (isShiftLeft 
    || isShiftRight
    || isShiftCTRLLeft 
    || isShiftCTRLRight 
    || isShiftHome
    ||IsShiftEnd) 
EndFunction

Void Function UpdateAndSayNewStateOfRadioButton()
ScheduleIDUpdateAndSayNewStateOfRadioButton = 0
If GetObjectStateCode() & CTRL_CHECKED
    ;The toggle was detected:
    Return
EndIf
MSAARefresh()
Pause() ;Allow time To update
IndicateControlState(wt_RadioButton, GetObjectStateCode())
EndFunction

Int Function ProcessSpaceBarKeyPressed(Int nKey, String strKeyName, Int nIsBrailleKey, Int nIsScriptKey)
If KeyIsSpacebar(nKey, strKeyName, nIsBrailleKey)
&& GetWindowClass(GetFocus()) == cwc_Chrome_WidgetWin_1
&& GetObjectSubtypeCode() == wt_RadioButton
    ;We may Not have received any events For updating the state:
    ScheduleIDUpdateAndSayNewStateOfRadioButton = ScheduleFunction("UpdateAndSayNewStateOfRadioButton", 3)
    Return True
EndIf
Return ProcessSpaceBarKeyPressed(nKey, strKeyName, nIsBrailleKey, nIsScriptKey)
EndFunction

Void Function KeyPressedEvent (Int nKey, String strKeyName, Int nIsBrailleKey, Int nIsScriptKey)
lastKeyWasSelecting = IsKeySelectingText(nKey)
lastKeyWasScripted = nIsScriptKey
KeyPressedEvent (nKey, strKeyName, nIsBrailleKey, nIsScriptKey)
EndFunction

Int Function IsOpenListBoxApplicable(Handle hWnd, Int iSubtype)
If (!IsFormsModeActive())
    Return IsOpenListBoxApplicable(hWnd, iSubtype)
EndIf

Return !SupportsEditCallbacks ()
EndFunction

Int Function IsCloseListBoxApplicable(Handle hWnd, Int iSubtype)
If (!IsFormsModeActive())
    Return IsCloseListBoxApplicable(hWnd, iSubtype)
EndIf
Return !SupportsEditCallbacks ()
EndFunction

Prototype IntArray Function GetDetailsIDs(Int details)
Prototype String Function GetTextForUniqueIDs(IntArray ids, Int idsCount)
Prototype Void Function RestrictToElementsWithUniqueIDs(IntArray ids, Int idsCount)
Prototype Void Function MoveToElementWithUniqueID(Int id)

Script announceComment ()
Var IntArray ids = GetDetailsIDs(True)
Var Int idsCount = ArrayLength (ids)
If (idsCount == 0)
    SayMessage (OT_ERROR, msgNoCommentAvailable)
    Return
EndIf

If isSameScript() Then
    ResetSpeechMarkupAttributes()
    MoveToElementWithUniqueID(ids[1])
    RestrictToElementsWithUniqueIDs(ids, idsCount)
    restrictedIDs = ids
    Return
EndIf

Var String text = GetTextForUniqueIDs(ids, idsCount)
If (StringIsBlank (text))
    SayMessage (OT_ERROR, msgNoCommentTextAvailable)
    Return
EndIf

text = msgComment + cscSpace + text
SayMessage (OT_JAWS_MESSAGE, text)
EndScript

Int Function IsInsideDetailsFor()
Var IntArray detailsForIDs = GetDetailsIDs(False)
Var Int idsCount = ArrayLength (detailsForIDs )
Return (idsCount > 0) 
EndFunction 

Script UpALevel()
If (!IsInsideDetailsFor())
    PerformScript UpALevel()
    Return 
EndIf

SayCurrentScriptKeyLabel ()
Var IntArray detailsForIDs = GetDetailsIDs(False)
Refresh() ;used To unrestrict the document before moving back To the commented text.
MoveToElementWithUniqueID(detailsForIDs[1])
EndScript

Void Function FormsModeEvent(Int bEntering, optional Int lastMovementUnit)
Var Int idsCount = ArrayLength (restrictedIDs)
If (bEntering == False
&& idsCount)
    ScheduleFunction ("RestrictToSavedIDs", 1)
EndIf

FormsModeEvent(bEntering, lastMovementUnit)
EndFunction

Void Function RestrictToSavedIDs()
Var Int idsCount = ArrayLength (restrictedIDs)
RestrictToElementsWithUniqueIDs(restrictedIDs, idsCount)
EndFunction

Int Function SpeakLiveRegionEvent(String text, Int suggestedOutputType, Int containsSpeechMarkup)
If SayAllInProgress () Then
    Return True ; Do Not speak notifications during skimread or sayAll.
EndIf
Return SpeakLiveRegionEvent(text, suggestedOutputType, containsSpeechMarkup)
EndFunction

Int Function InPageTabArea()
If isVirtualPCCursor() Return False EndIf
If GetWindowClass(getFocus()) != wc_Chrome_WidgetWin_1 Return False EndIf
Var
    Int i,
    Int depth = GetAncestorCount()
For i = 1 To depth
    If GetObjectRole(i) == Role_System_PageTabList
        Return True
    EndIf
EndFor
Return False
EndFunction

Void Function SayObjectTypeAndText(optional Int nLevel, Int includeContainerName)
If nLevel == 0
    If InPageTabArea()
        ;suppress description announcement from builtin SayObjectTypeAndText where the description information duplicates the name:
        Var
            Int type = GetObjectSubtypeCode(),
            String name = GetObjectname()
        If type == wt_button
        && StringLower(name) == StringLower(GetObjectDescription())
            ;The New Tab button differens only by case:
            IndicateControlType(wt_button, name, cmsgSilent)
            Return
        ElIf type == wt_unknown
        && GetObjectRole() == Role_System_PageTabList
            ;We don't actually have a subtypeCode defined For this type of control yet.
            ;For now, we will call it a tab control.
                IndicateControlType(wt_TabControl, name, cmsgSilent)
                IndicateControlState(wt_TabControl, GetObjectStateCode())
                Return
        EndIf
    EndIf
EndIf
SayObjectTypeAndText(nLevel, includeContainerName)
EndFunction

Script SayLine(optional Int drawHighlights)
If IsPCCursor()
&& InPageTabArea()
&& GetObjectSubtypecode() == wt_TabControl
    SayLine()
    ;SayLine does Not Include the position in group of the tab,
    ;and SayObjectTypeAndText will have out of date information about the position If the tab was shifted and focus has Not yet moved.
    Var Object element = FSUIAGetFocusedElement()
    If !element Return EndIf
    Var
        Int x = element.positionInSet,
        Int y = element.sizeOfSet
    If x && y
        Say(FormatString(cmsgPosInGroup1, IntToString(x), IntToString(y)), ot_position)
    EndIf
    Return
EndIf
PerformScript SayLine()
EndScript

Script SayNextWord()
;Allow shifting page tabs:
If IsPCCursor()
&& InPageTabArea()
&& GetObjectSubtypeCode() == wt_TabControl
    TypeKey(cksCtrlRightArrow)
    Return
EndIf
PerformScript SayNextWord()
EndScript

Script SayPriorWord()
;Allow shifting page tabs:
If IsPCCursor()
&& InPageTabArea()
&& GetObjectSubtypeCode() == wt_TabControl
    TypeKey(cksCtrlLeftArrow)
    Return
EndIf
PerformScript SayPriorWord()
EndScript

Script SelectNextWord()
;Allow shifting page tabs:
If IsPCCursor()
&& InPageTabArea()
&& GetObjectSubtypeCode() == wt_TabControl
    TypeKey(cksShiftControlRightArrow)
    Return
EndIf
PerformScript SelectNextWord()
EndScript

Script SelectPriorWord()
;Allow shifting page tabs:
If IsPCCursor()
&& InPageTabArea()
&& GetObjectSubtypeCode() == wt_TabControl
    TypeKey(cksShiftControlLeftArrow)
    Return
EndIf
PerformScript SelectPriorWord()
EndScript

Int Function IsFocusedOnTabSearchTopChromePage()
;Control+Shift + A brings up the page chrome://tab-search.top-chrome/
Return !UserBufferIsActive()
    && GetWindowClass(GetFocus()) == wc_ChromeWindowClass
    && GetDocumentPath() == scTabSearchTopChromeIdentifyer
EndFunction

Void Function DescriptionChangedEventAnnouncement()
ScheduleIDDescriptionChangedEventAnnouncement = 0
Say (gsDescriptionChangedEventText, OT_WINDOW_INFORMATION)
gsDescriptionChangedEventText = cscNull
EndFunction

Void Function DescriptionChangedEvent(Handle hwnd, Int objId, Int childId, Int nObjType, String sOldDescription, String sNewDescription, optional Int bFromFocusObject)
If bFromFocusObject
&& IsFocusedOnTabSearchTopChromePage()
    ;sNewDescription contains text saying how many matches were found For the text in the search edit field.
    ;This updates For each character typed into the edit field.
    ;To avoid spamming While typing, the announcement is scheduled rather than spoken immediately.
    If ScheduleIDDescriptionChangedEventAnnouncement
        UnscheduleFunction(ScheduleIDDescriptionChangedEventAnnouncement)
    EndIf
    gsDescriptionChangedEventText = sNewDescription
    ScheduleIDDescriptionChangedEventAnnouncement = ScheduleFunction("DescriptionChangedEventAnnouncement", DescriptionChangedEventAnnouncementWaitTime)
    Return
EndIf
DescriptionChangedEvent(hwnd, objId, childId, nObjType, sOldDescription, sNewDescription, bFromFocusObject)
EndFunction

Int Function InDialogWithDocumentDescendant()
If !dialogActive() Return False EndIf
Var
    Int i,
    Int type,
    Int role,
    Int levels
;Start at level 0, just in case the dialog itself has focus.
levels = GetAncestorCount()+1
For i = 0 To levels
    type = GetObjectSubtypeCode(False, i)
    role = GetObjectRole(i)
    If type == wt_dialog
    || role == ROLE_SYSTEM_DIALOG
        Return False
    ElIf type == WT_DOCUMENT
    || role == ROLE_SYSTEM_DOCUMENT
        Return True
    EndIf
EndFor
Return False
EndFunction

Int Function SayNewDocumentTab()
If IsFocusedOnTabSearchTopChromePage()
    Var Int documentLevel = GetDocumentLevel()
    If documentLevel > -1
        gsDocID = GetIDAtLevel(documentLevel)
        If gsDocID != gsPrevDocID
            Say(GetDocumentTitle(), ot_document_name)
            SayObjectTypeAndText()
            gsPrevDocID = gsDocID
            Return True
        EndIf
    EndIf
EndIf
Return SayNewDocumentTab()
EndFunction

Void Function DoBackSpace()
If !IsOnAddressBarEdit()
    DoBackSpace()
    Return
EndIf
Var
    String sSelectedText = GetSelectedText(),
    Int iTextSelected = !StringIsBlank(sSelectedText)
If !iTextSelected
    DoBackSpace()
    Return
EndIf
TypeKey(cksBackspace)
SayFormattedMessage(OT_MESSAGE, cMsgSelectionDeleted, cmsgSilent)
EndFunction

Void Function MSAAAlertEvent(Handle hwnd, Int nTime, String sText, Int nAlertLevel, String appName)
MSAAAlertEvent(hwnd, nTime, sText, nAlertLevel, appName)
If !nAlertLevel
&& c_BackgroundOCRRect.restrictedToCustomRect
    ;The zoom level of the browser may have changed.
    ;Set c_BackgroundOCRRect.shouldUpdateRect To True so the rectangle will be updated.
    c_BackgroundOCRRect.shouldUpdateRect = True
EndIf
EndFunction

Void Function GetARIAActionsNameAndIndexes(String ByRef actionsString, IntArray byref actionIndexes)
Var StringArray ariaActions = GetARIAActions()
If (ArrayLength(ariaActions) == 0)
    actionsString = " "
    Return
EndIf
        
Var Int i
actionIndexes = New IntArray[ArrayLength(ariaActions)]

For i = 1 To ArrayLength(ariaActions)
    Var StringArray actionItem = stringSplit(ariaActions[i], ":", True)
    actionsString = StringConcatenate(actionsString, actionItem[1], LIST_ITEM_SEPARATOR)
    actionIndexes[i] = StringToInt (actionItem[2])
EndFor
EndFunction

Script DisplayARIAActions ()
Var String actionsString 
Var IntArray actionIndexes
GetARIAActionsNameAndIndexes(actionsString, actionIndexes)

If (StringLength (actionsString) == 0)
    SayMessage (OT_ERROR, msgNoActionsAvailable)
    Return
EndIf

Var Int selectedItem = DlgSelectItemInList (actionsString, msgSelectActionTitle, False)
If (!PerformARIAActionByIndex(actionIndexes[selectedItem]))
    SayMessage (OT_ERROR, msgFailedToInvokeAction)
EndIf
EndScript

Void Function DoCloseListBoxKeyStroke()
;Using TypeKey of Alt+UpArrow in Chrome may cause the focus To move To the Chrome menu,
;so we Use Escape To close a listbox For both Chrome and Edge:
EscapeKey()
EndFunction


word.jss

; Copyright 1995-2024 Freedom Scientific, Inc.
; Script file For Microsoft Word versions 2016 and O365.

Include "HJConst.jsh"
Include "MSAAConst.jsh"
Include "winstyles.jsh"
Include "HJGlobal.jsh"
Include "UIA.jsh"
Include "hjHelp.jsh"
Include "Common.jsm"
Include "office.jsh"
Include "msOffice.jsm"
Include "Word.jsh"
Include "word.jsm"

Import "wordsettings.jsd"
Import "say.jsd" ; For FormatOutputMessage, ensure Script Manager will compile.
Import "UIA.jsd"
Import "touch.jsd"

Use "office.jsb"
Use "WordQuickNav.jsb"
Use "wordFunc.jsb"
Use "WordSettings.jsb"
Use "wordBrl.jsb"

;Shared Globals:
Globals
    Int LastUIATextChangeTime, ;shared with Office.jss -> WindowCreatedEvent.
    String globalAutocorrectSound ;from Default For Autocorrect sound
;Objects:
Globals
; For spellcheck with split buttons,
; store the default or first suggestion so enter key can quickly press it:
    Object oSuggestionSplitButton

;Collections:
Globals
Collection c_WordFocus,
    ; c_WordFocus caches things commonly tested For the focus window.
    ; It cannot be used For tests applicable To document content,
    ; since that can change without any focus change.
    ;
    ; Members are:
    ; String WindowClass -- Result of getWindowClass For focus.
    ; String RealWindowName -- Result of GetWindowName For real window of focus.
    ; String RealWindowClass -- Result of GetWindowClass For real window of focus.
    ; String HeaderForNewAddressListField -- Result of GetHeaderForNewAddressListField Function call.
    ; Int ObjectSubType -- Result of getObjectSubtypeCode at level 0.
    ; Int WindowSubtype -- Result of GetWindowSubtypeCode of focus.
    ; Int windowCategory -- Result of getWindowCategory Function call.
    ; Int IsWordDocumentActive -- Result of IsWordDocumentActiveTest Function call.
    ; Int OutlookIsActive = Result of OutlookIsActiveTest Function call.
    ; Int InMicrosoftEditorProofingPaneIssueChecker -- Result of InMicrosoftEditorProofingPaneIssueChecker Function call.
    ; Int InProofingPaneSpellCheckWithSplitButtons -- Result of InProofingPaneSpellCheckWithSplitButtons Function call.
    ; Int InProofingPaneSpellCheck -- Result of InProofingPaneSpellCheck Function call.
    ; Int IsReadOnlyMessage -- Result of IsReadOnlyMessage Function call.
    ; Int IsReadOnlyVirtualMessage -- Result of calculating IsVirtualPCCursor and IsReadOnlyMessage Function calls.
    ; Int IsStatusBarToolBar -- Result of IsStatusBarToolBarTest Function call.
    Collection c_WordTester
    ; For variables which are set or cleared under certain conditions and tested elsewhere when something happens.
    ;
    ; Members are:
    ; Int FocusChangedOnSelectATable
    ; Int WasOfficeSplashScreen
    ; Int WasTaskPaneDialog
    ; Int NextIsAccentedChar
    ; Int PrevFocusWasLevelZeroChangeListBoxItem
    ; Int PressEnterCausedNewListItem -- For reading list items as user presses enter To navigate.
    ; Int PressTabOrShiftTabCausedNewListItem ; same as enter but For tab and shift tab.
    ; Int SupportsMAGicOptions
    ; Int WindowStateToggledByScript
    ; String globalTaskOrProofingPaneGroupName -- For speaking when the parent of focus is a group, and it changes.
    ; Int SelectionRectChangedEventID -- The schedule ID For RunSelectionContextEvents.
    ; Int ProcessMainDocumentWindowTimerID -- The schedule ID For ProcessMainDocumentWindowWrapper.
    ; Int AnnounceNoOpenDocumentTimerID -- The schedule ID For AnnounceNoOpenDocument.
    ; Handle c_WordTester.hWndPrevFocus --
    ;       Because global focus and global prev focus variables are Not reliably updated when focus change moves To a menu,
    ;       relying On these Globals To suppress double announcement of the document edit
    ;       causes the focus change from the menus To the document Not To speak sometimes.
    ;       This is an added variable that is set in FocusChangedEventEx To allow For testing of the actual prev focus window.
    ; Int WordContextMenuActive

Void Function WordInit()
WordQuickNavInit()
WordFuncInit()
WordSettingsInit()
WordBrlInit()
EndFunction

Void Function AutoStartEvent()
InitNewWordCollections()
;Call init functions For dependent Word-specific modules:
WordInit()
; turn On options dialog support:
c_WordTester.SupportsMAGicOptions = True
initializeSettings()
EndFunction

Void Function AutoFinishEvent()
c_WordTester.SupportsMAGicOptions = False ; prevent unnecessary running of adjustMAGicOptions
ClearAllCollectionsAndTimers()
c_WordTester.TaskOrProofingPaneGroupName = cscNull
SetTypingEchoLanguage() ; reset in case it was changed For language detection
EndFunction

Void Function InitNewWordCollections()
If !c_WordFocus c_WordFocus = New Collection EndIf
If !c_WordTester c_WordTester = New Collection EndIf
EndFunction

Void Function ClearAllCollectionsAndTimers()
collectionRemoveAll(c_WordFocus)
CollectionRemoveAll(c_WordTester)
ClearProcessMainDocumentWindowTimer()
ClearAnnounceNoOpenDocumentTimer()
EndFunction

Void Function ClearProcessMainDocumentWindowTimer()
If c_WordTester.ProcessMainDocumentWindowTimerID
    unscheduleFunction(c_WordTester.ProcessMainDocumentWindowTimerID)
    c_WordTester.ProcessMainDocumentWindowTimerID = 0
EndIf
EndFunction

Void Function ClearAnnounceNoOpenDocumentTimer()
If c_WordTester.AnnounceNoOpenDocumentTimerID
    unscheduleFunction(c_WordTester.AnnounceNoOpenDocumentTimerID)
    c_WordTester.AnnounceNoOpenDocumentTimerID = 0
EndIf
EndFunction

Void Function NullSuggestionSplitButton()
oSuggestionSplitButton = null()
EndFunction

Void Function UpdateWordFocus(Handle hWnd)
Var Handle realWindow = GetRealWindow(hWnd)
c_WordFocus.WindowClass = getWindowClass(hWnd)
c_WordFocus.RealWindowName = GetWindowName(RealWindow)
c_WordFocus.RealWindowClass = GetWindowClass(RealWindow)
c_WordFocus.WindowSubtype = getWindowSubtypeCode(hWnd)
c_WordFocus.ObjectSubType = getObjectSubtypeCode()
c_WordFocus.windowCategory = getWindowCategory(hWnd)
c_WordFocus.IsWordDocumentActive = IsWordDocumentActiveTest()
c_WordFocus.OutlookIsActive = OutlookIsActiveTest()
c_WordFocus.IsStatusBarToolBar = IsStatusBarToolBarTest(hWnd)
;Must test the proofing pane in this order, since InProofingPaneSpellCheck depends On InProofingPaneSpellCheckWithSplitButtons:
c_WordFocus.InMicrosoftEditorProofingPaneIssueChecker = InMicrosoftEditorProofingPaneIssueChecker()
c_WordFocus.InProofingPaneSpellCheckWithSplitButtons = InProofingPaneSpellCheckWithSplitButtons()
c_WordFocus.InProofingPaneSpellCheck = InProofingPaneSpellCheck()
c_WordFocus.IsReadOnlyMessage = IsReadOnlyMessage()
If c_WordFocus.IsReadOnlyMessage
    c_WordFocus.IsReadOnlyVirtualMessage = IsVirtualPCCursor()
else
    c_WordFocus.IsReadOnlyVirtualMessage = False
EndIf
If c_WordFocus.RealWindowName == wn_NewAddressList
&& c_WordFocus.WindowSubType == wt_edit
    c_WordFocus.HeaderForNewAddressListField = GetHeaderForNewAddressListField ()
else
    c_WordFocus.HeaderForNewAddressListField = cscNull
EndIf
EndFunction

Int Function FindWindowCategoryType(Handle hwnd)
If IsStandardUnknownWindowCategoryType(hwnd)
    giWndCategoryType = WCAT_UNKNOWN
    Return giWndCategoryType
EndIf
Var
    String sRealName,
    String sClass
sClass = GetWindowclass(hWnd)
If stringCompare(sClass, cwc_Word_Document2) == 0
|| stringCompare(sClass, cwc_Word_Document) == 0
    If stringContains(GetWindowClass(GetParent(hWnd)), "bosa_sdm_")
        sRealName = getWindowName(getRealWindow(hWnd))
        If stringContains(sRealName, wn_spellingAndGrammar)
        || stringContains(sRealName, wn_spelling)
            giWndCategoryType = WCAT_SPELL_CHECKER
            Return giWndCategoryType
        else
            giWndCategoryType = wCat_Unknown
            Return giWndCategoryType
        EndIf
    EndIf
    giWndCategoryType = WCAT_DOCUMENT
    Return giWndCategoryType
EndIf
If c_WordFocus.WindowClass == cwc_NetUIHwnd
    Return FindWindowCategoryType(hWnd)
EndIf
sRealName = getWindowName(getRealWindow(hWnd))
If stringContains(sRealName, wn_spellingAndGrammar)
|| stringContains(sRealName, wn_spelling)
    giWndCategoryType = WCAT_SPELL_CHECKER
    Return giWndCategoryType
EndIf
If sClass == cwc_RichEdit20W
&& getWindowSubtypeCode(getParent(hWnd)) == WT_LISTVIEW
    ;Mailing dialogs need To respond To activeItemChangedEvent:
    giWndCategoryType = WCAT_UNKNOWN
    Return giWndCategoryType
EndIf
Return FindWindowCategoryType(hwnd)
EndFunction

Int Function OnEditFieldWithSuggestion()
If c_WordFocus.WindowClass != cwc_NetUIHwnd
    Return False
EndIf
If !oSuggestionSplitButton
|| oSuggestionSplitButton.isOffScreen
|| !oSuggestionSplitButton.GetInvokePattern()
    ;The suggestion split button is Not available:
    Return False
EndIf
If getObjectTypeCode(True) != WT_EDIT
    ;Not On any kind of edit field--read-only, multiline or single-line:
    Return False
EndIf
Return True
EndFunction

Void Function ReturnToDocumentFromEmbeddedSpreadsheet()
WordInit()
initializeSettings()
SayFocusedWindow()
EndFunction

Void Function Unknown (String TheName, Int IsScript, optional Int IsDueToRecursion)
If IsDueToRecursion
    ;recursive calls may happen If a Function is running,
    ;and the Word event fires and calls the Function that is already running.
    ;Note, however, that any test of a Function which fails To run will evaluate as False.
    Return
EndIf
TheName = StringLower (TheName)
; CaretMovedEvent throws when in comment pane and deleting first character.
If stringContains (TheName, "caretmovedevent") Return EndIf
Unknown (TheName, IsScript, IsDueToRecursion)
EndFunction

Void Function UIANotificationEvent(Int notificationKind, Int notificationProcessing, String displayString, String activityId, String appName)
If ActivityID == "AccSN2" || activityID == "AccSN3"
    ; ControlDelete and ControlBackspace are sending fake notifications
    ;which clutter when we're reading the actual words that got deleted.
    Var String scriptName = GetScriptAssignedTo(GetCurrentScriptKeyName())
    If scriptName == "DeleteWord" || scriptName == "ControlBackspace"
        Return
    EndIf
EndIf
Return UIANotificationEvent(notificationKind, notificationProcessing, displayString, activityId, appName)
EndFunction

Void Function UIATextEditTextChangedEvent(Int changeType, String text)
If changeType!=TextEditChangeType_AutoCorrect
    Return
EndIf
LastUIATextChangeTime = getTickCount()
Var String line = GetLine()
If line==cscNull || line==cscSpace
    sayMessage(OT_SCREEN_MESSAGE, text)
ElIf getJCFOption(OPT_INDICATE_MISTYPED_WORD)
&& !stringIsBlank(text)
    ; autocorrection While typing.
    If GetCharacterValue(stringLeft(text, 1)) <= 8
        ; keep ugly nonprintable character from showing up On Braille display.
        ; sometimes, the leading character is one of the lower control characters like ^d.
        text = stringChopLeft(text, 1)
    EndIf
    If stringLength(text) == 1
    && IsAutoCorrectExceptionCharacter(getCharacterValue(text))
        ; the standard quotes and apostrophes are being turned into Unicode left and right quotes and single quotes.
        Return
    EndIf
    If (c_WordTester.PressEnterCausedNewListItem
    || c_WordTester.PressTabOrShiftTabCausedNewListItem)
    && InList()
        If ! c_WordTester.PressTabOrShiftTabCausedNewListItem Then
        ; Speak text from here after user pressed enter in a numbered list.
        ; however tab or shift tab would make it speak twice which we don't want.
            say(text, OT_LINE)
        EndIf
        c_WordTester.PressEnterCausedNewListItem = False
        c_WordTester.PressTabOrShiftTabCausedNewListItem = False
        Return
    EndIf
    text = stringTrimLeadingBlanks(text)
    Var String message = formatString(msgAutocorrect, text)
    PlaySound(GetSoundFileLocation(globalAutocorrectSound))
    sayMessage(OT_SCREEN_MESSAGE, message)
    ; don't spell strings that are artificially supplied such as "bullet", "list item", etc:
    If stringContains(line, text)
        spellString(text)
    EndIf
EndIf
EndFunction

String Function getPositionInGroupFromUIAElement(Object element)
If ! element Return EndIf
Var
    Int index,
    String size,
    String positionInfo
size = element.sizeOfSet
If !size Return EndIf
index = element.positionInSet
; account For out of bounds UIA where something's wrong:
If !index || index > size Return EndIf
positionInfo = formatString(cmsgPosInGroup1, index, size)
Return positionInfo
EndFunction

Void Function ItemNotFoundEvent(Int hwnd)
; event indicating that the requested item can't be found.
If WindowCategoryIsWordDocument()
    Return
else
    beep()
EndIf
EndFunction

Void Function SelectionRectChangedEvent(Int newLeft, Int newTop, Int newRight, Int newBottom, Int oldLeft, Int oldTop, Int oldRight, Int oldBottom, Int navUnit)
If c_WordTester.SelectionRectChangedEventID
    UnscheduleFunction(c_WordTester.SelectionRectChangedEventID)
    c_WordTester.SelectionRectChangedEventID = 0;
EndIf
SelectionRectChangedEvent(newLeft, newTop, newRight, newBottom, oldLeft, oldTop, oldRight, oldBottom, navUnit)
EndFunction

Int Function IsWordDocumentActiveTest()
If c_WordFocus.ObjectSubType == WT_DOCUMENT
|| GetObjectRole () == ROLE_SYSTEM_DOCUMENT
    Return True
EndIf
If !StringContainsCaseInsensitive (getWindowOwner(GetFocus()), WordAppDocumentArea)
    Return False
EndIf
Var
    Int iAncestorCount = GetAncestorCount (),
    Int i
For i = 0 To iAncestorCount
    If GetObjectAutomationId (i) == "Body"
        Return True
    ElIf GetObjectSubTypeCode (SOURCE_CACHED_DATA, i) == WT_DOCUMENT
        Return False
    EndIf
EndFor
Return False
EndFunction

Int Function IsWordDocumentActive()
Return c_WordFocus.IsWordDocumentActive == True
EndFunction

Int Function OutlookIsActive()
Return c_WordFocus.OutlookIsActive == True
EndFunction

Int Function WindowCategoryIsWordDocument()
Return c_WordFocus.windowCategory == wCat_document
EndFunction

Int Function IsStatusBarToolBar()
Return c_WordFocus.IsStatusBarToolBar == True
EndFunction

Int Function IsRibbonEditComboDroppedDown()
Var Handle hWnd = GetFirstWindow(GetTopLevelWindow(GetFocus()))
Return GetWindowClass(hwnd) == wc_NetUIToolWindow
    && GetParent(hWnd) == GetAppMainWindow(GetFocus())
    && (GetWindowStyleBits(hWnd) &(WS_POPUP | WS_VISIBLE) == WS_POPUP | WS_VISIBLE)
    && GetWindowClass(GetFirstChild(hWnd)) == cwc_NetUIHwnd
EndFunction

Int Function InTaskPaneDialog()
Return c_WordFocus.windowCategory == WCAT_TASK_PANE
EndFunction

Int Function InbosaSDMMso96Dialog()
Return c_WordFocus.RealWindowClass == wc_bosa_sdm_Mso96
EndFunction

Int Function IsNavPaneVisible(Handle hwnd)
;For 2010 Find and Replace when it is invoked by user and remains open
;even after returning To document,
;or when user checks Navigation pane from the View ribbon.
Return isWindowVisible(
    FindWindow(getAppMainWindow(hwnd), cwcMsoCmd, wn_2010WordNavigationPane))
EndFunction

Int Function IsTextReadingAppropriateForCurrentElement()
;For the touch cursor.
; Insure that document areas of versions of Word earlier than 2013 are detected:
Var Object element = TouchCursorObject()
Return (element.controlType == UIA_PaneControlTypeID && element.className == wc_wwg)
    || IsTextReadingAppropriateForCurrentElement()
EndFunction

Int Function InMicrosoftEditorProofingPaneIssueChecker()
;Note, this Function only returns True when actively reviewing issues.
;It returns False If in the Microsoft Editor pane but only in the overview.
If InbosaSDMMso96Dialog() Return False EndIf
If GetObjectName(False, 3) != wn_Editor
&& GetObjectName(False, 4) != wn_Editor
    ;Not in Microsoft Editor pane.
    Return False
EndIf
Var Object oPane = FSUIAGetParentOfElement (FSUIAGetFocusedElement ())
If oPane.controlType != UIA_PaneControlTypeID
    ;Some controls are children of the pane element.
    ;Others are grandchildren.
    ;Get the parent and check again.
    oPane = FSUIAGetParentOfElement (oPane)
EndIf
If oPane.controlType != UIA_PaneControlTypeID
    ;Not in Microsoft Editor pane.
    Return False
EndIf
Var Object oCondition = FSUIACreateStringPropertyCondition (UIA_AutomationIDPropertyID, "DrillInPane_Title")
If oPane.findFirst(TreeScope_Children, oCondition)
    ;In Microsoft Editor pane actively reviewing issues.
    Return True
EndIf
Return False;May be in Microsoft Editor pane, but Not reviewing issues
EndFunction

Int Function InProofingPaneSpellCheckWithSplitButtons()
If c_WordFocus.InMicrosoftEditorProofingPaneIssueChecker Return True EndIf
If InbosaSDMMso96Dialog() Return False EndIf
If GetObjectName(False, 2) != wn_Editor
    Return False
EndIf
Var String name = GetObjectName(False, 1)
If stringContains(name, wn_Proofing_Pane_Grammar)
|| stringContains(name, wn_Proofing_Pane_Spelling) Then
    Return True
EndIf
Var
    Object oUIA = CreateObjectEx("FreedomSci.UIA", 0, "UIAScriptAPI.x.manifest" ),
    Object treewalker = CreateUIARawViewTreeWalker(True),
    Object oGroupTypeCondition = oUIA.createIntPropertyCondition(UIA_ControlTypePropertyId, UIA_GroupControlTypeId),
    Object oGroupElements,
    Object oGroup
If !treewalker
|| !oGroupTypeCondition
    Return False
EndIf
treeWalker.currentElement = FSUIAGetFocusedElement()
While treewalker.currentElement.controlType != UIA_PaneControlTypeId
&& treewalker.currentElement.controlType != UIA_CustomControlTypeId
&& UIAGetParent (treewalker.currentElement)
    treewalker.gotoParent()
EndWhile
oGroupElements = treewalker.currentElement.findAll(TreeScope_Descendants, oGroupTypeCondition)
If GetGroupWithSpellingOrGrammarName(oGroupElements)
    Return True
EndIf
Return False
EndFunction

Int Function InProofingPaneSpellCheck()
If c_WordFocus.InProofingPaneSpellCheckWithSplitButtons Return True EndIf
Var String sName = GetObjectNameUnfiltered(1)
If StringIsBlank(sName)
|| sName == suggestionsListboxPrompt
    ; may be in a list of suggestions...
    sName = GetObjectNameUnfiltered(2)
EndIf
If StringIsBlank(sName) ; may be in a list of languages...
    sName = GetObjectNameUnfiltered(5)
EndIf
; the name can contain a lot more text, so we need To Use starts-with instead.
Return StringStartsWith(sName, wn_Proofing_Pane_Spelling)
    || StringStartsWith(sName, wn_Proofing_Pane_Grammar)
EndFunction

Int Function ReadProofingPaneWithSplitButtons()
Var
    Object UIA,
    Object element,
    Object currentSentenceTextField,
    Object spellingError,
    Object treewalker,
    String tmp,
    String Message;
UIA = CreateObjectEx("FreedomSci.UIA", 0, "UIAScriptAPI.x.manifest" )
If !UIA Return False EndIf
element = GetUIAFocusElement(UIA)
treewalker = UIA.CreateTreeWalker(UIA.CreateRawViewCondition())
If !element || !treewalker Return False EndIf
If element.controlType == UIA_SplitButtonControlTypeId
    oSuggestionSplitButton = element
EndIf
treewalker.currentElement = element
Var
    Object oGroupTypeCondition = UIA.createIntPropertyCondition(UIA_ControlTypePropertyId, UIA_GroupControlTypeId),
    Object oGroupElements
While (treewalker.currentElement.controlType != UIA_PaneControlTypeId
|| treewalker.currentElement.controlType != UIA_CustomControlTypeId)
&& UIAGetParent (treewalker.currentElement)
    treewalker.gotoParent()
EndWhile
oGroupElements = treewalker.currentElement.findAll(TreeScope_Descendants, oGroupTypeCondition)
treewalker.currentElement = GetGroupWithSpellingOrGrammarName(oGroupElements)
; If the control group contains a read-only text field,
; it's the New method using split buttons
Var
    Object controlTypeCondition,
    Object isValuePatternAvailable,
    Object isReadOnly,
    Object condition
controlTypeCondition = UIA.CreateIntPropertyCondition(UIA_ControlTypePropertyId, UIA_EditControlTypeId)
isValuePatternAvailable = UIA.CreateBoolPropertyCondition( UIA_IsValuePatternAvailablePropertyId, UIATrue)
isReadOnly = UIA.CreateBoolPropertyCondition( UIA_ValueIsReadOnlyPropertyId, UIATrue)
condition = UIA.CreateAndCondition(controlTypeCondition, isValuePatternAvailable)
condition = UIA.CreateAndCondition(condition, isReadOnly)
currentSentenceTextField = treewalker.currentElement.FindFirst(TREESCOPE_SUBTREE, condition)
If !currentSentenceTextField Return False EndIf
; group name contains prompt, text and spelling of text.
; Not necessarily in that order.
spellingError = treewalker.currentElement
condition = UIA.CreateIntPropertyCondition(UIA_ControlTypePropertyId, UIA_SplitButtonControlTypeId)
While treeWalker.GoToNextSibling()
    If treewalker.currentElement.controlType != UIA_GroupControlTypeId
    && treewalker.currentElement.controlType != UIA_ScrollBarControlTypeId
        Return False
    EndIf
    ; Split buttons are suggestions:
    If !oSuggestionSplitButton
        oSuggestionSplitButton = treewalker.currentElement.FindFirst(TREESCOPE_SUBTREE, condition)
    EndIf
EndWhile
treewalker.currentElement = element
Message = spellingError.name
; since we now keep track of active group name, speaking only when it changes:
c_WordTester.TaskOrProofingPaneGroupName = Message
sayMessage(OT_LINE, spellingError.name)
If oSuggestionSplitButton
    treewalker.currentElement = oSuggestionSplitButton
    treewalker.gotoParent
    tmp = treewalker.currentElement.name
    If !stringIsBlank(tmp)
        Message = Message+cscSpace+tmp
        sayMessage(OT_CONTROL_NAME, tmp)
    EndIf
    treewalker.currentElement = oSuggestionSplitButton
    tmp = oSuggestionSplitButton.name
    If !stringIsBlank(tmp)
        If stringSegmentCount(tmp, ", ")
            ; separate out the first segment, as the name contains more than just the suggestion:
            tmp = stringSegment(tmp, ", ", 1)
        EndIf
        Message = Message + cscSpace + tmp
        sayMessage(OT_LINE, tmp)
        spellString(tmp)
    EndIf
else
    ; no split buttons available, no suggestion
    Message = message + cscSpace + msgNoSpellingSuggestions1_L
    sayMessage(OT_ERROR, msgNoSpellingSuggestions1_L)
EndIf
BrailleMessage(Message)
Return True
EndFunction

Object Function GetGroupWithSpellingOrGrammarName (Object oGroupArray)
Var
    Object oGroup

ForEach oGroup in oGroupArray
    If stringContains(oGroup.name, wn_Proofing_Pane_Grammar)
    || stringContains(oGroup.name, wn_Proofing_Pane_Spelling) Then
        Return oGroup
    EndIf
EndForEach
Return Null()
EndFunction

Int Function IsWordContextMenuActive()
Return c_WordTester.WordContextMenuActive == True
EndFunction

Int Function CheckForUnsupportedDocumentView()
Var String sViewName
If !IsNormalOrDraftView()
    sViewName = GetActiveDocumentViewName()
    SayFormattedMessage(ot_screen_message,
        FormatString(msgDocumentView_l, sViewName),
        FormatString(msgDocumentView_s, sViewName))
    If IsReadingViewActive()
        SayFormattedMessage(ot_smart_help, msgReadingLayout)
        If BrailleInUse()
            BrailleRefresh()
        EndIf
        Return True
    EndIf
EndIf
Return False
EndFunction

Void Function SetNewLineIndicationMode()
Var
    Int iMode,
    Int iNewMode,
    Int bShow
iMode = NewLinesAndParagraphsIndication()
If GetActiveDocumentViewName() == msgWeb
    If iMode != wdVerbosityOff
        SetNewLinesAndParagraphsIndication(wdVerbosityOff)
    EndIf
    Return
EndIf
;Only manipulate the setting If it is possible that
;the user changed display options in Word:
If GlobalWasHjDialog
|| getAppMainWindow(GetFocus()) != globalPrevApp
    Return
EndIf
iNewMode = iMode
bShow = (isShowParagraphs() || isShowAll())
If bShow
    If iMode == wdVerbosityOff
        iNewMode=IndicateWhenReading
    EndIf
else
    iNewMode = wdVerbosityOff
EndIf
If iMode != iNewMode
    SetNewLinesAndParagraphsIndication(iNewMode)
EndIf
EndFunction

String Function GetWordCountDlgStaticText(Handle focusWindow)
If c_WordFocus.RealWindowName != wn_WordCountDialog
|| !StringStartsWith(c_WordFocus.WindowClass, "bosa_sdm_")
|| GetJCFOption(OPT_USE_SDM_API) == 0
    Return cscNull
EndIf
Var Object element = FSUIAGetElementFromHandle(focusWindow)
If !element Return cscNull EndIf
Var Object textElements = element.findAll(TREESCOPE_SUBTREE, FSUIACreateIntPropertyCondition(UIA_ControlTypePropertyId, UIA_TextControlTypeId))
If !textElements || !textElements.count Return cscNull EndIf
Var Int i, String text
For i=0 To textElements.count-1
    If !stringIsBlank(text) text=text+cscBufferNewLine EndIf
    text=formatString(text+"%1", textElements(i).name) ; since can't concatenate data members direct into a String literal
EndFor
Return text
EndFunction

Int Function PreProcessKeyPressedEvent(Int nKey, String strKeyName, Int nIsBrailleKey, Int nIsScriptKey)
Var Int bStopProcessing = PreProcessKeyPressedEvent(nKey, strKeyName, nIsBrailleKey, nIsScriptKey)
If !bStopProcessing
    If QuickNavKeyTrapping()
        If QuickNavTrappedKeyProcessed(nKey, strKeyName, nIsScriptKey)
            Return True
        EndIf
    EndIf
    If !UserBufferIsActive()
        ; process accented characters:
        If nKey == kiAltCtrlQuestion
        || nKey == kiAltCtrlExclaim
            SayAccentedCharacter()
            Return True
        ElIf c_WordTester.NextIsAccentedChar
            c_WordTester.NextIsAccentedChar = False
            ScheduleFunction("SayAccentedCharacter", 1)
            Return True
        else
            If nKey == kiCtrlApostrophe
            || nKey == kiCtrlGrave
            || nKey == kiCtrlTilde
            || nKey == kiCtrlCaret
            || nKey == kiCtrlColon
            || nKey == kiCtrlAt
            || nKey == kiCtrlAnd
            || nKey == kiCtrlComma
            || nKey == kiCtrlSlash
                c_WordTester.NextIsAccentedChar = True
                Return True
            EndIf
        EndIf
    EndIf
EndIf
Return bStopProcessing
EndFunction

Int Function NewTextEventShouldBeSilent(Handle hFocus, Handle hwnd, String buffer, Int nAttributes,
    Int nTextColor, Int nBackgroundColor, Int nEcho, String sFrameName)
If InRibbons()  ; suppress non-focused controls announcement.
    Return True
EndIf
Var String class = GetWindowClass(hWnd)
If class == wc_bosa_sdm_Mso96
&& c_WordFocus.windowCategory== WCAT_SPELL_CHECKER
    Return True
EndIf
If hWnd == hFocus
    If class == wc_ReComboBox20W
        Return False
    EndIf
else
    If class == wc_OOCWindow
    && GetParent(hWnd) == hFocus
        Return True
    EndIf
EndIf
Return NewTextEventShouldBeSilent(hFocus, hwnd, buffer, nAttributes, nTextColor, nBackgroundColor, nEcho, sFrameName)
EndFunction

Void Function ProcessSpeechOnNewTextEvent(Handle hFocus, Handle hwnd, String buffer, Int nAttributes,
    Int nTextColor, Int nBackgroundColor, Int nEcho, String sFrameName)
If hWnd == getFocus()
&& GetWindowClass(hwnd) == wc_ReComboBox20W
    Say(buffer, ot_line)
    Return
EndIf
ProcessSpeechOnNewTextEvent(hFocus, hwnd, buffer, nAttributes, nTextColor, nBackgroundColor, nEcho, sFrameName)
EndFunction

Void Function sayHighlightedText(Handle hwnd, String buffer)
If WindowCategoryIsWordDocument()
    Var Int screenEcho = GetScreenEcho()
    If screenEcho > 0
    && GetLastMouseMovementTime() >= GetLastKeyPressTime()
    && !IsVirtualPCCursor()
        ; This code block fixes bug 50538(Running both JAWS and MAGic together - click On a
        ; word To select it is Not saying the selected word in multiple apps).
        ; This code block gets called when text is selected using the mouse and focus is in the
        ; main document window in Microsoft Word. Note there are three common scenarios For
        ; selecting text with the mouse. The first is To double click the left mouse button On
        ; a word. This causes the word that was double clicked To become selected. In this
        ; case the last mouse movement time will be greater than the last key press time. The
        ; second method of selecting text with the mouse is To position the caret at one end of
        ; the region that you wish To select, hold down the shift key, and click the left mouse
        ; button once at the other end of the region that you wish To select. In this case the
        ; last mouse movement time will often be the same as the last key press time(unless you
        ; pause For a full millisecond after pressing the shift key before pressing the left
        ; mouse button). The third method of selecting text with the mouse is To click with the
        ; left mouse button at one end of the region that you wish To select, hold down the
        ; mouse button, drag the mouse To the other end of the region that you wish To select,
        ; and Then release the left mouse button.
        ; This code block causes JAWS To speak correctly in the first and second scenarios. Note
        ; that the second scenario in which the last mouse movement time may be the same as the
        ; last key press time is why the >=(greater than or equal) operator is used in this If
        ; statement instead of the >(greater than) operator.
        ; Also note that there is currently no good method of ensuring that JAWS or MAGic speaks
        ; correctly in the third scenario.
        say(buffer, ot_highlighted_screen_text, True)
        Return
    EndIf
    If screenEcho <= 1
    && hwnd != getFocus()
        ; Headings that redraw as you type into the document below them
        ; are stopped from speaking here.
        Return
    EndIf
EndIf
sayHighlightedText(hwnd, buffer)
EndFunction

Void Function ConfigurationChangedEvent(String newConfiguration)
;Sometimes, when leaving Quicksettings, the scripts receive the FocusChangedEventEx before the QuickSettings scripts unload.
;When this occurs, quick navigation gets out of sync.
;So we run WordQuickNavInit here To compensate.
If newConfiguration == "word"
    WordQuickNavInit()
EndIf
ConfigurationChangedEvent(newConfiguration)
EndFunction

Int Function IsContextMenu(Int type)
If type == wt_contextMenu
    Return True
ElIf type != wt_menu
    Return False
EndIf
;It's a menu, but is it a context menu:
Return GetWindowSubtypecode(GetFocus()) == wt_contextMenu
    || GetObjectSubtypecode(False, 1) == wt_contextMenu
EndFunction

Int Function MenuProcessedOnFocusChangedEventEx(
    Handle hwndFocus, Handle hwndPrevFocus,
    Int nType, optional Int nChangeDepth)
If IsVirtualRibbonActive() Return MenuProcessedOnFocusChangedEventEx(hwndFocus, hwndPrevFocus, nType, nChangeDepth) EndIf
c_WordTester.WordContextMenuActive = IsContextMenu(nType)
If !nType
    ;due To timing, when leaving a context menu in the document
    ;the GetMenuMode Function may Return menu_active.
    ;this causes the context menu To be announced as If it is appearing.
    ;So, we test For the type here, and If it is 0 Return False.
    GlobalMenuMode = GetMenuMode()
    Return GlobalMenuMode != menu_inactive
EndIf
Return MenuProcessedOnFocusChangedEventEx(hwndFocus, hwndPrevFocus, nType, nChangeDepth)
EndFunction

Int Function ContextMenuProcessed(Handle hwnd)
Var Int bRetVal = contextMenuProcessed(hwnd)
c_WordTester.WordContextMenuActive = (bRetVal || IsContextMenu(GetObjectSubtypeCode()))
Return bRetVal
EndFunction

Void Function MenuModeEvent(Handle WinHandle, Int mode)
TrackEvent(event_menuMode)
MenuModeEvent(WinHandle, mode)
EstablishQuickNavState()
EndFunction

Int Function FocusRedirectedOnFocusChangedEventEx(
    Handle hwndFocus, Int nObject, Int nChild,
    Handle hwndPrevFocus, Int nPrevObject, Int nPrevChild,
    Int nChangeDepth)
;We have quite a lot of trouble with double firing of the focus change.
;It appears that in some SDM dialogs, the undesired focus change can be detected by the objID, childID, prevObjID and prevChildID all being 0.
If !nObject && !nChild && !nPrevObject && !nPrevChild
&& hwndFocus == hwndPrevFocus
&& StringStartsWith(c_WordFocus.RealWindowClass, "bosa_sdm_")
    Return True
EndIf
Return FocusRedirectedOnFocusChangedEventEx(hwndFocus, nObject, nChild, hwndPrevFocus, nPrevObject, nPrevChild, nChangeDepth)
EndFunction

Int Function FocusChangedEventShouldProcessAncestors(Handle FocusWindow, optional Handle prevFocusWindow)
If c_WordFocus.windowCategory == wCat_document
|| c_WordFocus.windowCategory == WCAT_SPELL_CHECKER
|| c_WordFocus.InProofingPaneSpellCheck
    Return False
EndIf
If c_WordFocus.ObjectSubType == WT_MULTILINE_EDIT
&& c_WordFocus.WindowClass == cwc_NetUIHwnd
&& getObjectSubtypeCode(False, 2) == WT_DIALOG_PAGE
    Return False
EndIf
; Readability Statistics is now a pane / transparent dialog even though it's still SDM,
; and the relevant controls are UIA text children of the dialog / window.
If getObjectName(False, 1) == wn_ReadabilityStatistics Return True EndIf
Return FocusChangedEventShouldProcessAncestors(FocusWindow, prevFocusWindow)
EndFunction

Void Function FocusChangedEventProcessAncestors(Handle FocusWindow, Handle PrevWindow)
;Keep edit combos On proofing pane from announcing themselves twice:
If c_WordFocus.InProofingPaneSpellCheck
&& c_WordFocus.ObjectSubType == WT_LISTBOXITEM
    sayObjectTypeAndText()
    Return
EndIf
Var Handle hDialog = getRealWindow(focusWindow)
If FocusWindow != PrevWindow
&& c_WordFocus.WindowClass == cwc_NetUIHwnd
&& GetWindowClass(hDialog) == wc_NUIDialog
&& GetWindowSubtypeCode(hDialog) == WT_DIALOG
    SayObjectTypeAndText()  ; Reads control name and type.
    Return
EndIf
FocusChangedEventProcessAncestors(FocusWindow, PrevWindow)
EndFunction

Void Function PreProcessFocusChangedEventEx(
    Handle hwndFocus, Int nObject, Int nChild,
    Handle hwndPrevFocus, Int nPrevObject, Int nPrevChild,
    Int nChangeDepth)
If nChangeDepth >= 0
    UpdateWordFocus(hwndFocus)
EndIf
PreProcessFocusChangedEventEx(hwndFocus, nObject, nChild, hwndPrevFocus, nPrevObject, nPrevChild, nChangeDepth)
EndFunction

Void Function FocusChangedEventEx(
    Handle hwndFocus, Int nObject, Int nChild,
    Handle hwndPrevFocus, Int nPrevObject, Int nPrevChild,
    Int nChangeDepth)
; always kill suggestion split button because proofing pane code will reinitialize If appropriate.
oSuggestionSplitButton = null()
ClearProcessMainDocumentWindowTimer()
If FocusRedirectedOnFocusChangedEventEx(hwndFocus, nObject, nChild,
    hwndPrevFocus, nPrevObject, nPrevChild, nChangeDepth)
    Return
EndIf
c_WordTester.hWndPrevFocus = hwndPrevFocus
c_WordTester.WasOfficeSplashScreen = WasOfficeSplashScreen() ;See comment in Office.jss FocusChangedEventEx
CancelFocusItemMonitors()
FocusChangedEventEx(hwndFocus, nObject, nChild, hwndPrevFocus, nPrevObject, nPrevChild, nChangeDepth)
EstablishQuickNavState()
EndFunction

Void Function ProcessEventOnFocusChangedEventEx(
    Handle hwndFocus, Int nObject, Int nChild,
    Handle hwndPrevFocus, Int nPrevObject, Int nPrevChild,
    Int nChangeDepth, String sClass, Int nType)
ManageUIAEvents()
If inHjDialog()
&& hwndFocus == hwndPrevFocus
&& c_WordFocus.WindowClass == "SearchBox"
&& inQuickSettingsDialog()
    ;Dispel erroneous speech from items in QuickSettings Search Box:
    Return; prevent over-chatter:
EndIf
If nChangeDepth == 0
&& nType == wt_ListBoxItem
    ;Some listbox items can focus To each item in the list using tab,
    ;and their change depth is 0.
    ;here we attempt To avoid repetative speaking of the list name For each item in the list:
    ;Currently, we only know about the listbox items in the navigation pane:
    If IsSearchDocumentDialogType()
        If c_WordTester.PrevFocusWasLevelZeroChangeListBoxItem
            Return ActiveItemChangedEvent(hwndFocus, nObject, nChild,
                hwndPrevFocus, nPrevObject, nPrevChild)
        else
            c_WordTester.PrevFocusWasLevelZeroChangeListBoxItem = True
            Return ProcessEventOnFocusChangedEventEx(hwndFocus, nObject, nChild,
                hwndPrevFocus, nPrevObject, nPrevChild, nChangeDepth, sClass, nType)
        EndIf
    EndIf
ElIf c_WordTester.PrevFocusWasLevelZeroChangeListBoxItem
    c_WordTester.PrevFocusWasLevelZeroChangeListBoxItem = False
EndIf
ProcessEventOnFocusChangedEventEx(hwndFocus, nObject, nChild,
    hwndPrevFocus, nPrevObject, nPrevChild, nChangeDepth, sClass, nType)
EndFunction

Void Function FocusChangedEvent(Handle FocusWindow, Handle PrevWindow)
If !c_WordFocus.InProofingPaneSpellCheckWithSplitButtons
    c_WordTester.TaskOrProofingPaneGroupName = cscNull
EndIf
If c_WordFocus.WindowClass == "Excel7"
    SwitchToConfiguration("Excel")
    ;Schedule call For ExcelFunc Function:
    ScheduleFunction("InitializeObjectsForWordEmbeddedWorksheet", 3)
    Return
EndIf
; For document load from Office where Word doesn't automatically open To a document window:
If c_WordFocus.WindowClass == wc_wordMainDocumentWindow
    ; exclude returning To document from embedded combo box in form fields:
    If getWindowClass(PrevWindow) != cWcMenuClass
    && !IsFormField()
    && prevWindow != focusWindow
        WordInit()
        c_WordTester.SelectionRectChangedEventID = ScheduleFunction("RunSelectionContextEvents", 2)
    EndIf
EndIf
If ReturningFromResearchItDialog()
    Return default::FocusChangedEvent(FocusWindow, PrevWindow)
EndIf
If !c_WordTester.FocusChangedOnSelectATable
    TrackEvent(event_FocusChanged)
else
    ;See Script SelectATable For why this is used
    c_WordTester.FocusChangedOnSelectATable = False
EndIf
GlobalRealWindowName = c_WordFocus.RealWindowName
;A blank password contains the same characters as a non-breaking space symbol,
;so make sure that nonbreaking symbol detection is Off in passwords:
AllowNonbreakingSymbolsDetection(!(dialogActive() && c_WordFocus.ObjectSubType == wt_passwordEdit))
Var
    Int bSavedSDM,
    Int savedUseSDMOption
If GlobalRealWindowName != globalPrevRealName
&& GlobalRealWindowName == wn_WordCountDialog
    ; must turn On SDM dialog reading For this dialog, even though we read via UIA.
    ; In english, this is alt+R, W.
    bSavedSDM = True
    savedUseSDMOption = GetJCFOption(OPT_USE_SDM_API)
    SetJCFOption(OPT_USE_SDM_API, 1)
EndIf
FocusChangedEvent(FocusWindow, PrevWindow)
; If SDM option had been set To speak window properly, set it back:
If bSavedSDM
    SetJCFOption(OPT_USE_SDM_API, savedUseSDMOption)
EndIf
EndFunction

Int Function HandleCustomAppWindows(Handle AppWindow)
If !IsWindowVisible(AppWindow)
    ; The app window is either invalid or hidden.
    ; Either way, we don't want To do anything special here because we're likely To hang
    Return False
EndIf
If !IsUpdatingDocumentData()
    WDApp_DocumentChange()
EndIf
If HandleCustomSpellCheckRealWindows(AppWindow)
    ;This behaves as app window change:
    Return True
EndIf
;Dialogs may be real and app window both:
Return HandleCustomAppWindows(AppWindow)
EndFunction

Void Function ProcessSayAppWindowOnFocusChange(Handle AppWindow, Handle FocusWindow)
If GlobalPrevApp == AppWindow
&& WindowCategoryIsWordDocument()
    If !IsUpdatingDocumentData()
        WDApp_DocumentChange()
    EndIf
    Return
EndIf
ProcessSayAppWindowOnFocusChange(AppWindow, FocusWindow)
EndFunction

Int Function HandleCustomSpellCheckRealWindows(Handle hReal)
;Actually processed as app window change but behaves like a real or dialog window
Var
    Handle focusWindow = getFocus(),
    String sRealName
If c_WordFocus.WindowClass == cwc_NetUIHwnd
    Return False
EndIf
If c_WordFocus.windowCategory== WCAT_SPELL_CHECKER
&& c_WordFocus.WindowSubtype == WT_MULTILINE_EDIT
    sRealName = stringSegment(getWindowName(hReal), cScColon, 1)+cScColon
    indicateControlType(wt_dialog, sRealName)
    HandleCustomSpellCheckWindows(focusWindow)
    Return True
EndIf
Return False
EndFunction

Int Function HandleCustomRealWindows(Handle RealWindow)
Var
    Handle AppWindow = GetAppMainWindow(RealWindow),
    String RealWindowName = GetWindowName(RealWindow)
If StringContains(GetWindowName(AppWindow), RealWindowName)
    ;Don't repeat the document name If it has already been spoken by the app focus change
    If !dialogActive()
        Return True
    EndIf
EndIf
Return HandleCustomRealWindows(RealWindow)
EndFunction

Void Function ProcessSayRealWindowOnFocusChange(Handle AppWindow, Handle RealWindow, String RealWindowName, Handle FocusWindow)
If GlobalPrevRealName == RealWindowName
&& GlobalPrevReal == RealWindow
&& GlobalCommandBarWindow == globalPrevCommandBarWindow
    ;The real window did Not change, so just Return.
    Return
EndIf
If c_WordFocus.windowCategory== WCAT_TASK_PANE
    c_WordTester.WasTaskPaneDialog = True
    If c_WordFocus.InMicrosoftEditorProofingPaneIssueChecker
        ;In the Microsoft Editor pane, real window is same as the document real window.
        ;Speaking will be handled through downstream functions of processsayfocuswindowonfocuschange.
        Return
    EndIf
    If c_WordFocus.InProofingPaneSpellCheck
        ReadSpellCheckInfoUIA(True)
        Return
    EndIf
    Return
EndIf
If c_WordTester.WasTaskPaneDialog
    c_WordTester.WasTaskPaneDialog = False
    If WindowCategoryIsWordDocument()
        SayWindowTypeAndText(RealWindow)
        Return
    EndIf
EndIf
If RealWindowName == wn_WordCountDialog
&& GetJCFOption(OPT_USE_SDM_API) == 1
&& StringStartsWith(c_WordFocus.RealWindowClass, "bosa_sdm_")
    ; only Handle special case If we got the word count properly:
    Var String wordCountText = GetWordCountDlgStaticText(focusWindow)
    If !stringIsBlank(wordCountText)
        indicateControlType(WT_DIALOG, realWindowName)
        sayMessage(OT_DIALOG_TEXT, wordCountText)
        Return
    EndIf
EndIf
If InbosaSDMMso96Dialog()
&& c_WordFocus.InProofingPaneSpellCheck
    ReadSpellCheckInfo()
    Return
EndIf
ProcessSayRealWindowOnFocusChange(AppWindow, RealWindow, RealWindowName, FocusWindow)
EndFunction

Int Function HandleCustomSpellCheckWindows(Handle hwnd)
If c_WordFocus.windowCategory!= WCAT_SPELL_CHECKER
    Return False
EndIf
Var Int iSubtype = c_WordFocus.ObjectSubType
If c_WordFocus.WindowClass == wc_bosa_sdm_Mso96
    If iSubtype == wt_edit
        ;Occasionally, when an accellerator key is used While focus is in the edit field showing the word in context,
        ;Focus change will fire and the class will be the bosa sdm window While the Object is wt_edit.
        ;This is a transitional focus change, and we want To ignore it.
        Return True
    EndIf
    If iSubtype == wt_button
        Return False
    EndIf
EndIf
If iSubtype == wt_Document
|| iSubtype == wt_multiline_edit
    ;The error will be shown in context in an element of type document.
    ReadSpellCheckInfo()
 Return True
ElIf iSubtype == wt_listboxItem
    IndicateControlType(wt_ListBox, GetObjectName(False, 1), GetObjectName())
    spellString(GetObjectName())
    SayMessage(OT_POSITION, PositionInGroup())
    Return True
EndIf
Return False
EndFunction

Int Function handleCustomWindows(Handle hwnd)
If HandleCustomSpellCheckWindows(hwnd)
    Return True
EndIf
Return handleCustomWindows(hwnd)
EndFunction

Void Function ProcessSayFocusWindowOnFocusChange(String RealWindowName, Handle FocusWindow)
If GlobalWasHJDialog
&& UserBufferIsActive()
    ;SayLine or SayAll will be performed,
    ;so don't say the user buffer as the focus item.
    Return
EndIf
If c_WordFocus.InProofingPaneSpellCheck
&& getRealWindow(GlobalFocusWindow) != GlobalPrevReal
    ; Real window is speaking spell check info in dialog first load.
    Return
EndIf
ProcessSayFocusWindowOnFocusChange(RealWindowName, FocusWindow)
EndFunction

Void Function ProcessSayWindowPromptAndTextTutorialHelp(Int iSubtype, Handle hwnd, Int bSpeak, Int nTrainingMode)
If dialogActive () Then
; open or Save As dialogs will read the toolbar describing location
    SayFolderLocationForDialog ()
EndIf
SayTutorialHelp(iSubType, bSpeak)
SayTutorialHelpHotKey(hWnd, bSpeak)
IndicateComputerBraille(hwnd)
SpeakProgressBarInfo(bSpeak)
smmToggleTrainingMode(nTrainingMode)
EndFunction

Script SayWindowPromptAndText()
Var
    Int sayIt = True,
    Int ignoreFonts = True,
    Handle hWnd,
    Handle hFocus,
    Int iSubType,
    Int iObjType,
    Int nMode,
    String sWindowName,
    String sClass
c_WordTester.TaskOrProofingPaneGroupName = cscNull ; so SayObjectTypeAndText will read it properly.
DescribeTextAnnotationOrAttributes(sayIt, ignoreFonts)
If handleNoCurrentWindow()
    Return
EndIf
If MenusActive()
|| InHJDialog()
    performscript SayWindowPromptAndText()
    Return
EndIf
hWnd = GetCurrentWindow()
hFocus=GetFocus()
iSubType = GetWindowSubTypeCode(hWnd)
If !iSubType
    iSubType = c_WordFocus.ObjectSubType
Else
    iObjType=c_WordFocus.ObjectSubType
EndIf
If inRibbons()
|| IsVirtualRibbonActive()
|| (!OutlookIsActive()
&& isStatusBarToolbar())
    If IsVirtualRibbonActive()
        sayVirtualRibbonItem()
    else
        If InMultilevelListPane()
        && UsingShortNameOfMultiLevelListObject()
            IndicateControlType(wt_grid, GetWord2003MultiLevelListObjectNameOfFocusObject(), cscNull)
            Say(PositionInGroup(), ot_position)
            SayUsingVoice(vctx_message, GetObjectName(), ot_help)
        else
            self::SayObjectTypeAndText()
        EndIf
    EndIf
    ProcessSayWindowPromptAndTextTutorialHelp(iSubtype, hFocus, True, nMode)
    Return
EndIf
sClass = c_WordFocus.WindowClass
nMode = smmTrainingModeActive()
smmToggleTrainingMode(True)
If sClass == wc_officeDropdown
&& !iSubtype
&& !iObjType
    iSubtype = wt_ComboBox
    Say(GetLine(), ot_line)
    ProcessSayWindowPromptAndTextTutorialHelp(iSubtype, hwnd, True, nMode)
    Return
ElIf StringContains(GetObjectName(), scBallon)
    self::GetCustomTutorMessage()
    self::SayFocusedWindow()
    ProcessSayWindowPromptAndTextTutorialHelp(iSubtype, hwnd, True, nMode)
    Return
EndIf
If InTaskPaneDialog()
    GetCustomTutorMessage()
    SayFocusedWindow()
    ProcessSayWindowPromptAndTextTutorialHelp(iSubtype, hwnd, True, nMode)
    Return
EndIf
If (menusActive() || dialogActive())
&& !IsWordDocumentActive()
    ;For New document dialog:
    ; need To force following calls as standard calls To SayFocusedObject, etc. do Not provide enough information.
    If StringContains(GetWindowName(GetRealWindow(hwnd)), wn_newDocumentDlg)
    && c_WordFocus.ObjectSubType == wt_listboxItem
        SayWindowTypeAndText(GetParent(hwnd))
        SayMessage(ot_control_name, GetObjectName(SOURCE_CACHED_DATA, 1))
        indicateControlType(wt_listboxItem, GetObjectName()) ; iObjType does Not get correct info here.
    Else
        If InTaskPaneDialog()
            GetCustomTutorMessage()
            SayFocusedObject()
        Else
            self::sayFocusedWindow()
        EndIf
    EndIf
    ProcessSayWindowPromptAndTextTutorialHelp(iSubtype, hwnd, True, nMode)
    Return
EndIf
If WindowCategoryIsWordDocument()
    If IsVirtualPcCursor()
        speakSmartNavLevelSetting()
    EndIf
    If IsFormField()
        self::SayObjectTypeAndText()
        SayF1Help()
        If inTable()
            sayCellCoordinatesInfo()
        EndIf
    ElIf inTable()
        sayCellPromptAndText()
    else ; Not in a table so If On a field, announce it
        ;may need further refactor.
        self::SayLine()
; the following uses globalInBorderedText, which is Not set anywhere:
;       ;only read text in a bordered region If the region is determined To be arbitrary rather
;       ;than a paragraph or number of paragraphs or sections.
;       ;For example If the author places a border around several words.
;       If globalInBorderedText
;           sayTextInBorderedRegion()
;       EndIf
    EndIf
    Return
else
    If StringContains(getWindowName(GetRealWindow(hwnd)), wn_options)
        If c_WordFocus.ObjectSubType == wt_listBoxItem
            self::sayFocusedWindow()
            SayUsingVoice(vctx_message, msgOptionsDlgCategoriesTutorHelp, ot_line)
        else
            self::sayObjectTypeAndText()
        EndIf
        ProcessSayWindowPromptAndTextTutorialHelp(iSubtype, hwnd, True, nMode)
        Return
    EndIf
EndIf
performscript SayWindowPromptAndText()
EndScript

Void Function SayControlGroupNameForTaskAndProofingPane()
; could apply To other groups in task panes in future, but applies To spellCheck with split buttons at the moment.
If !c_WordFocus.InProofingPaneSpellCheckWithSplitButtons
    c_WordTester.TaskOrProofingPaneGroupName = cscNull
    Return
EndIf
Var Object element = FSUIAGetFocusedElement() ; get current button or control
If !element
    c_WordTester.TaskOrProofingPaneGroupName = cscNull
    Return
EndIf
Var Int isReadOnlyEditElement =(element.controlType == UIA_EditControlTypeId
        && element.GetValuePattern().IsReadOnly)
element = CreateUIAParentOfElement(element)
If !element
|| element.ControlType != UIA_GroupControlTypeId
    c_WordTester.TaskOrProofingPaneGroupName = cscNull
    Return
EndIf
If isReadOnlyEditElement
|| c_WordFocus.ObjectSubType == WT_READONLYEDIT
    ; read mistake and first suggestion split button
    ReadProofingPaneWithSplitButtons()
ElIf element.name != c_WordTester.TaskOrProofingPaneGroupName
    sayMessage(OT_CONTROL_GROUP_NAME, element.name)
EndIf
c_WordTester.TaskOrProofingPaneGroupName = element.name
EndFunction

Void Function SayObjectTypeAndText(optional Int nLevel, Int includeContainerName)
If WasSayObjectTypeAndTextExceptionProcessed(nLevel, includeContainerName) Return EndIf
If UserBufferIsActive()
    If c_WordFocus.InProofingPaneSpellCheck
        Return ; so we don't get double repeated text from the first time the Reason Text viewer comes up.
    else
        SayObjectTypeAndText(nLevel, includeContainerName)
        Return
    EndIf
EndIf
Var
    Handle hWnd = getCurrentWindow(),
    Int iType,
    String sValue,
    String sObjectHelp = GetObjectHelp()
If nLevel == 0
    SayControlGroupNameForTaskAndProofingPane()
    iType = GetObjectSubtypeCode(SOURCE_CACHED_DATA)
    If iType == WT_STATIC
    && ReadMicrosoftEditorIssueCheckerInfo(True, False)
        Return
    ElIf iType == WT_SPLITBUTTON
    && ReadMicrosoftEditorSuggestion()
        Return
    ElIf iType == WT_LISTBOXITEM
    && c_WordFocus.InProofingPaneSpellCheck
        SayObjectTypeAndText(nLevel, includeContainerName)
        If GetObjectStateCode(True) & STATE_SYSTEM_DEFAULT
            ; avoid spelling the drop down item in the language combo box when it first opens To a list box:
            SpellString(GetObjectName(SOURCE_CACHED_DATA))
        EndIf
        Return
    ElIf iType == WT_LISTBOXITEM
    && c_WordFocus.WindowClass == "bosa_sdm_msword"
        indicateControlType(WT_LISTBOX, getObjectName(0, 1), getObjectName())
        say(PositionInGroup(), OT_POSITION)
        Return
    ElIf getObjectTypeCode() == WT_EDIT
    && c_WordFocus.InProofingPaneSpellCheckWithSplitButtons
        ; current sentence edit field does Not read whole sentence but only current line:
        Var Object pattern = FSUIAGetFocusedElement().GetValuePattern()
        If !stringIsBlank(pattern.value)
            Return indicateControlType(WT_READONLYEDIT, getObjectName(SOURCE_CACHED_DATA), pattern.value)
        EndIf
    EndIf
    If iType == wt_grid
        If InMultilevelListPane()
            IndicateControlType(wt_grid, GetWord2003MultiLevelListObjectNameOfFocusObject(), cscNull)
            Say(PositionInGroup(), ot_position)
            ;we notify the user of context help because
            ;we have substituted the actual name with a user-friendly shorter version,
            ;and the context help is the aqctual name of the Object.
            NotifyIfContextHelp()
            Return
        EndIf
    EndIf
EndIf
If c_WordFocus.HeaderForNewAddressListField != cscNull
    IndicateControlType (iType, c_WordFocus.HeaderForNewAddressListField, GetObjectValue ())
    Return
EndIf
If GetObjectName(SOURCE_CACHED_DATA, 1) == wn_SearchResultsList
    Say(sObjectHelp, OT_LINE)
EndIf
SayObjectTypeAndText(nLevel, includeContainerName)
If nLevel == 0
    SpeakSuggestionsAvailable()
    ; If the Object is the button type and has a path in the help message we should announce it...
    ; a good example is the recent files buttons in the open ribbon dialogue
    If iType == WT_BUTTON
    && !StringIsBlank(sObjectHelp)
    && GetObjectName(SOURCE_CACHED_DATA) != sObjectHelp
    && GetWindowClass(hWnd) == cwc_NetUIHwnd
    && isBackStageView(hWnd)
        Say(sObjectHelp, OT_SCREEN_MESSAGE)
    EndIf
EndIf
EndFunction

Void Function AnnounceNoOpenDocument()
c_WordTester.AnnounceNoOpenDocumentTimerID = 0
;make sure that focus is still On the empty client workspace,
;since focus can briefly land in an empty client workspace before firing again To land elsewhere,
;such as a newly opened document:
If c_WordFocus.windowCategory == WCAT_DOCUMENT_WORKSPACE
    BrailleRefresh()
    SayUsingVoice(vctx_message, msgNoOpenDocument, ot_help)
EndIf
EndFunction

Void Function SayFocusedWindow()
If c_WordFocus.windowCategory == wCat_document
    If GetObjectSubTypeCode(SOURCE_CACHED_DATA, 0)!=WT_DOCUMENT
        sayobjectTypeAndText()
        Return
    EndIf
    ; may need To re-initialize application pointer.
    If IsAppObjInvalid()
        InitializeAppObj()
    EndIf
    If (getRunningFSProducts() == PRODUCT_MAGic ||!BrailleInUse ())
    && (!globalPrevFocus || stringContains(getWindowClass(globalPrevFocus), cwc_NetUIHwnd)) Then ; returning from the ribbons
        RunSelectionContextEvents(); update all relevant data For tables.
        updateTableManually()
        cwdUpdateTitleColumnsAndRows()
    EndIf
    globalDocumentName = GetActiveDocumentName()
    ;Check that this is Not a double firing of focus change For a window,
    ;where the window was already announced.
    ;Testing here with c_WordTester.hWndPrevFocus instead of GlobalPrevFocus
    ;allows detection of focus change due To leaving menus:
    If c_WordTester.WasOfficeSplashScreen
    || !(c_WordTester.hWndPrevFocus == GlobalFocusWindow
    && globalPrevDocumentName == globalDocumentName)
        c_WordTester.ProcessMainDocumentWindowTimerID = scheduleFunction("ProcessMainDocumentWindowWrapper", 1)
    EndIf
    globalPrevDocumentName = globalDocumentName
    Return
ElIf c_WordFocus.windowCategory == WCAT_DOCUMENT_WORKSPACE
    globalDocumentName = cscNull
    globalPrevDocumentName = globalDocumentName
    c_WordTester.AnnounceNoOpenDocumentTimerID = ScheduleFunction("AnnounceNoOpenDocument", 10)
    Return
EndIf
SetTypingEchoLanguage() ; reset in case it was changed For language detection
If dialogActive()
&& c_WordFocus.windowCategory != WCAT_SPELL_CHECKER
|| c_WordFocus.windowCategory == WCAT_TASK_PANE
    Return SayFocusedWindow()
EndIf
If menusActive()
    Return; handled separately.
EndIf
SayFocusedWindow()
EndFunction

Void Function ProcessMainDocumentWindow(Handle hFocus)
If NotifyZoomManyPages()
    Return
EndIf
If OutlookIsActive()
    Return ProcessOutlookMessageWindow(hFocus)
EndIf
; Enhanced edit must be On in nav area of document.
If GetJcfOption(OPT_EDIT_USE_OSM)
    setJcfOption(OPT_EDIT_USE_OSM, 0)
EndIf
;Document name may have been announced On app change,
;but If the app did Not change but the document did,
;the New document name gets announced here instead:
If GlobalPrevApp == GetAppMainWindow(GetFocus())
&& globalPrevDocumentName != globalDocumentName
    Say(GlobalDocumentName, ot_dialog_name)
EndIf
Var Int bIsFormfield = IsFormfield()
If !inTable()
&& !bIsFormfield
&& !IsActiveDocumentProtected()
&& !GlobalWasHJDialog
;Testing here with GlobalPrevFocus instead of c_WordTester.hWndPrevFocus
;allows this announcement To be skipped when leaving menus:
&& globalPrevFocus != GlobalFocusWindow
    If CheckForUnsupportedDocumentView()
        Return
    EndIf
EndIf
DetectDocumentHeadersFooters()
If !bIsFormfield
    ;   ProcessMeasurementUnitSetting()
    SetNewLineIndicationMode()
    IndicateControlType(wt_edit, cscSpace, cscSpace)
    Return
EndIf
If bIsFormfield
&& !IsDocumentTableActive()
    self::sayObjectTypeAndText()
    SayF1Help()
EndIf
EndFunction

Void Function ProcessMainDocumentWindowWrapper()
ProcessMainDocumentWindow(globalFocusWindow)
EndFunction

Void Function ProcessOutlookMessageWindow(Optional Handle hWnd)
Var
    Int iQuickNavigationOption,
    String sFormat
If !hWnd
    hWnd = GetFocus()
EndIf
;ReadHeader(1)
If IsActiveWindowProtected()
    ReadOutlookMessage()
    If !sayAllInProgress()
    && ShouldMessageTypeSpeak()
        Say(GetWindowName(hWnd), OT_CONTROL_NAME)
        sFormat = StringSegment(GetWindowName(GetAppMainWindow(hWnd)), "()", -2)
        If !StringIsBlank(sFormat)
            Say(sFormat, OT_SCREEN_MESSAGE)
        EndIf
    EndIf
    If sayAllInProgress() && ShouldSetQuickNavModeTo2()
        iQuickNavigationOption = 2
    else
        iQuickNavigationOption = 1
    EndIf
Else
    IndicateControlType(WT_MULTILINE_EDIT)
    iQuickNavigationOption = 0
EndIf
SetJcfOption(OPT_QUICK_KEY_NAVIGATION_MODE, iQuickNavigationOption)
SetQuickKeyNavigationState(iQuickNavigationOption)
Return
EndFunction

Void Function ActiveItemChangedEvent(Handle curHwnd, Int curObjectId, Int curChildId,
    Handle prevHwnd, Int prevObjectId, Int prevChildId)
Var Int ObjectSubtypeCode = GetObjectSubtypeCode()
If c_WordFocus.InProofingPaneSpellCheck
&& (ObjectSubtypeCode == WT_LISTBOXITEM || ObjectSubtypeCode == WT_COMBOBOX)
; avoid spelling the items in the language combo when it drops down To list.
; This list contains items without a state code.
&& GetObjectStateCode(True) & STATE_SYSTEM_DEFAULT
    SayObjectActiveItem()
    SpellString(GetObjectName(SOURCE_CACHED_DATA))
    Return
EndIf
ActiveItemChangedEvent(curHwnd, curObjectId, curChildId, prevHwnd, prevObjectId, prevChildId)
EndFunction

Void Function ObjStateChangedEvent(Handle hObj, optional Int iObjType, Int nChangedState, Int nState, Int nOldState)
Var
    Handle hFocus = GetFocus()
If hObj == hFocus
&& iObjType == wt_TabControl
&& nChangedState & ctrl_selected
    ;just say the selected state, don't Include the pressed state:
    indicateControlState(wt_tabControl, ctrl_selected)
    Return
EndIf
If iObjType == wt_listBoxItem
&& !nState
    If !nOldState
        ;this occasionally happens when pressing Enter On a style in the taskpane
        ;and the Object gets this event before focus returns To the document
        Return
    ElIf nOldState == ctrl_selected
    && c_WordFocus.WindowClass == cwc_NetUIHwnd
        ;For Word 2007/2010,
        ;the Options dialog uses a listbox instead of tab controls For the multiple pages.
        ;When navigating this listbox,
        ;the deselection of a listbox item may happen before the focus moves To the New item.
        ;Do nothing For this state change.
        Return
    EndIf
EndIf
ObjStateChangedEvent(hObj, iObjType, nChangedState, nState, nOldState)
EndFunction

Void Function RunNavQuickKeysManager()
NavigationQuickKeysManager(1)
EndFunction

Int Function InTextWindow()
If c_WordFocus.windowCategory== wCat_document
    Return True
Else
    Return inTextWindow() ;default
EndIf
EndFunction

Int Function IsTextAnalysisValid()
;overwritten here so that the Function returns True For Word document windows and Outlook message windows.
If c_WordFocus.windowCategory== wCat_document
&& !UserBufferIsActive()
&& !quickNavKeyTrapping()
    Return True
EndIf
Return IsTextAnalysisValid()
EndFunction

Int Function ShouldForceComputerBraille(Handle hwndTrans)
;Overwritten here so that the user can type in contracted English Braille in the main document area.
If c_WordFocus.windowCategory== wCat_document
&& !UserBufferIsActive() Then
    Return False
EndIf
Return ShouldForceComputerBraille(hwndTrans)
EndFunction

Int Function ContractedBrailleInputAllowedNow()
;Overridden here For when quick keys mode is enabled.
If QuickNavKeyTrapping()
&& !UserBufferIsActive() Then
    Return False
EndIf
Return ContractedBrailleInputAllowedNow()
EndFunction

Int Function UsesUnderlyingDom()
If c_WordFocus.windowCategory== wCat_document
&& !globalMenuMode
&& !DialogActive()
&& QuickKeyNavigationModeActive()
    Return True
EndIf
Return UsesUnderlyingDom()
EndFunction

Int Function KeyHasJAWSModifier(String sKey)
Var String s = StringLower(sKey)
Return StringContains(s, "jawskey")
    || StringContains(s, "insert")
    || StringContains(s, "capslock")
EndFunction

Int Function IsDocumentAreaScriptException(optional Int bValidInOutlook)
If InHJDialog()
    SayFormattedMessage(OT_ERROR, cmsg337_L, cmsg337_S)
    Return True
EndIf
If c_WordFocus.windowCategory!= wCat_document
    If !KeyHasJAWSModifier(GetCurrentScriptKeyName())
        SayCurrentScriptKeyLabel()
        TypeCurrentScriptKey()
    else
        If bValidInOutlook
        && OutlookIsActive()
            sayMessage(ot_error, msgNotInOutlookMessage_l, msgNotInOutlookMessage_s)
        else
            SayFormattedMessage(OT_error, msgNotInDocumentWindow1_L)
        EndIf
    EndIf
    Return True
EndIf
Return False
EndFunction

Int Function SayCursorMovementException(Int UnitMovement, optional Int bMoved)
Return isVirtualPCCursor()
    || SayCursorMovementException(UnitMovement, bMoved)
EndFunction

Void Function SayPageUpDownUnit(Int UnitMovement)
If SayCursorMovementException(unitMovement)
    SayPageUpDownUnit(unitMovement)
    Return
EndIf
If c_WordFocus.windowCategory== wCat_document
    Return
EndIf
SayPageUpDownUnit(UnitMovement)
EndFunction

Void Function LineSpacingDescChangedEvent(String lineSpacingDescription)
; Outlook's old spell checker is now trying To report text inconsistencies, and it shouldn't be doing this.
If c_WordFocus.windowCategory== WCAT_SPELL_CHECKER Return False EndIf
Return LineSpacingDescChangedEvent(lineSpacingDescription)
EndFunction

Int Function IsSearchDocumentDialogType()
If c_WordFocus.windowCategory != wCat_Task_Pane
    Return False
EndIf
Var
    String sObjNameAtLevel1,
    String sObjNameAtLevel2
sObjNameAtLevel1 = GetObjectName(SOURCE_CACHED_DATA, 1)
sObjNameAtLevel2 = GetObjectName(SOURCE_CACHED_DATA, 2)
If StringCompare(sObjNameAtLevel1, on_Find_And_Replace) == 0
|| StringCompare(sObjNameAtLevel2, on_Find_And_Replace) == 0
|| StringCompare(sObjNameAtLevel1, on_Navigation_Pane) == 0
|| StringCompare(sObjNameAtLevel2, on_Navigation_Pane) == 0
    Return True
EndIf
If GetObjectName(SOURCE_CACHED_DATA) == wn_SearchDocument
    Return True
EndIf
Return False
EndFunction

Int Function ShouldNotifyIfContextHelp()
If UsingShortNameOfMultiLevelListObject()
    Return True
EndIf
Return ShouldNotifyIfContextHelp()
EndFunction

Void Function NotifyIfContextHelp()
If !ShouldNotifyIfContextHelp() Return EndIf
If UsingShortNameOfMultiLevelListObject()
    SayUsingVoice(vctx_message, cMsgContextHelp, OT_SMART_HELP)
    Return
EndIf
NotifyIfContextHelp()
EndFunction

Void Function ProcessBoundaryStrike(Handle hWnd, Int edge)
If IsReadOnlyVirtualMessage()
    ;Scoping To avoid calling the one in WordFunc:
    Return default::ProcessBoundaryStrike(hWnd, Edge)
EndIf
If c_WordFocus.windowCategory == wCat_document
||(OutlookIsActive() && c_WordFocus.WindowClass == wc_wwg)
    giScheduledDocumentTopAndBottomEdgeAlert =
    ScheduleFunction("DocumentTopAndBottomEdgeAlert", 3)
    Return
EndIf
If GetJCFOption(OPT_TOP_AND_BOTTOM_EDGE_ALERT)
    ProcessBoundaryStrike(hWnd, edge)
EndIf
EndFunction

Void Function DocumentTopAndBottomEdgeAlert()
giScheduledDocumentTopAndBottomEdgeAlert = 0
; If we're reading sentence or paragraph, must special case this:
Var String LastScript = GetScriptAssignedTo(GetCurrentScriptKeyName())
If StringContains(LastScript, "Arrow") ; paragraph reading
    SayParagraph()
    Return
ElIf StringContains(LastScript, "Listbox")
|| StringContains(LastScript, "Sentence") Then ; sentence reading
    SaySentence()
    Return
EndIf
Beep()
If !BrailleIsInputSource()
; If edit callbacks is Off, line navigation already reads this:
&& SupportsEditCallbacks()
    SayLine()
EndIf
EndFunction

Int Function NotifyZoomManyPages()
If getCurrentZoomLevel() == ZOOM_MANY_PAGES
    sayFormattedMessage(OT_ERROR, msgZoomManyPages_l, msgZoomManyPages_s)
    Return True
EndIf
Return False
EndFunction

Script ScriptFileName()
ScriptAndAppNames(msgWordForWindowsAppName)
EndScript

Void Function SayUIARegSetting ()
Var Int val
val=getRegistryEntryDWORD(1, "Software\Freedom Scientific\FSDomSrv", "MSWordNoUIA")
If val
    SayMessage(OT_status, "DOM")
else
    SayMessage(OT_status, "UIA")
EndIf
EndFunction

Script TestSayUIARegSetting()
SayUIARegSetting()
EndScript

Void Function SayActivePaneName()
If !IsWordDocumentActive()
    If c_WordFocus.RealWindowName == wn_applyStyles
        sayMessage(ot_dialog_name, wn_ApplyStyles)
    ElIf c_WordFocus.RealWindowName == wn_Styles
        sayMessage(ot_dialog_name, wn_Styles)
    EndIf
    Return
EndIf
SayActivePane()
EndFunction

Script switchPanes()
EnsureNoUserBufferActive()
sayCurrentScriptKeyLabel()
TypeKey(ksSwitchPanes)
delay(2, True)
SayActivePaneName()
EndScript

Script switchPanesReverse()
EnsureNoUserBufferActive()
sayCurrentScriptKeyLabel()
TypeKey(ksSwitchPanesReverse)
pause()
SayActivePaneName()
EndScript

Script SwitchDocumentView()
SayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
If WindowCategoryIsWordDocument()
    Pause()
    Var String sViewName = GetActiveDocumentViewName()
    SayFormattedMessage(ot_status,
        FormatString(msgDocumentView_l, sViewName),
        FormatString(msgDocumentView_s, sViewName))
EndIf
EndScript

Script ReadWordInContext()
readWordInContext()
EndScript

Void Function WindowMinMaxEvent(Handle hWindow, Int nMinMaxRest, Int nShow)
If c_WordTester.WindowStateToggledByScript
    c_WordTester.WindowStateToggledByScript = False
    If nMinMaxRest==1
        Say(msgWindowStateToggleMaximize, ot_screen_message)
    ElIf nMinMaxRest==2
        Say(msgWindowStateToggleRestore, ot_screen_message)
    EndIf
EndIf
EndFunction

Script ToggleWindowState()
c_WordTester.WindowStateToggledByScript = True
TypeKey(ksToggleWindowState) ; AltF10 in English
EndScript

Script AltF4()
ReleaseEditInterfaces()
;debug add back: wordFunc::AutoFinishEvent()
TypeCurrentScriptKey()
SayCurrentScriptKeyLabel()
EndScript

Script CloseDocumentWindow()
If StringContains(c_WordFocus.WindowClass, wc_wwf)
&& !DialogActive()
&& !StringContains(GetWindowClass(GetParent(GlobalFocusWindow)), cwc_Dlg32770)
    IndicateControlType(wt_MDIClient)
EndIf
PerformScript CloseDocumentWindow()
EndScript

Int Function ChooseHeadingLevelInSelectAHeadingDialog()
;This Function should be called only in the scripts assigned To Alt+Number, For the exception of handling the heading list HJDialog.
If !InHJDialog()
|| c_WordFocus.RealWindowName != cWn16 ; Heading List
 Return False
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
SayLine()
Return True
EndFunction

Script Alt1()
If ChooseHeadingLevelInSelectAHeadingDialog() Return EndIf
EnsureNoUserBufferActive()
If c_WordFocus.windowCategory== WCAT_MESSAGE
    PerformScript ReadOutlookHeader(1)
    Return
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
EndScript

Script Alt2()
If ChooseHeadingLevelInSelectAHeadingDialog() Return EndIf
EnsureNoUserBufferActive()
If c_WordFocus.windowCategory== WCAT_MESSAGE
    PerformScript ReadOutlookHeader(2)
    Return
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
EndScript

Script Alt3()
If ChooseHeadingLevelInSelectAHeadingDialog() Return EndIf
EnsureNoUserBufferActive()
If c_WordFocus.windowCategory== WCAT_MESSAGE
    PerformScript ReadOutlookHeader(3)
    Return
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
EndScript

Script Alt4()
If ChooseHeadingLevelInSelectAHeadingDialog() Return EndIf
EnsureNoUserBufferActive()
If c_WordFocus.windowCategory== WCAT_MESSAGE
    PerformScript ReadOutlookHeader(4)
    Return
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
EndScript

Script Alt5()
If ChooseHeadingLevelInSelectAHeadingDialog() Return EndIf
EnsureNoUserBufferActive()
If c_WordFocus.windowCategory== WCAT_MESSAGE
    PerformScript ReadOutlookHeader(5)
    Return
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
EndScript

Script Alt6()
If ChooseHeadingLevelInSelectAHeadingDialog() Return EndIf
EnsureNoUserBufferActive()
If c_WordFocus.windowCategory== WCAT_MESSAGE
    PerformScript ReadOutlookHeader(6)
    Return
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
EndScript

Script Alt7()
If ChooseHeadingLevelInSelectAHeadingDialog() Return EndIf
EnsureNoUserBufferActive()
If c_WordFocus.windowCategory== WCAT_MESSAGE
    PerformScript ReadOutlookHeader(7)
    Return
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
EndScript

Script Alt8()
If ChooseHeadingLevelInSelectAHeadingDialog() Return EndIf
EnsureNoUserBufferActive()
If c_WordFocus.windowCategory== WCAT_MESSAGE
    PerformScript ReadOutlookHeader(8)
    Return
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
EndScript

Script Alt9()
If ChooseHeadingLevelInSelectAHeadingDialog() Return EndIf
EnsureNoUserBufferActive()
If c_WordFocus.windowCategory== WCAT_MESSAGE
    PerformScript ReadOutlookHeader(9)
    Return
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
EndScript

Script Alt0()
If ChooseHeadingLevelInSelectAHeadingDialog() Return EndIf
EnsureNoUserBufferActive()
If c_WordFocus.windowCategory== WCAT_MESSAGE
    PerformScript ReadOutlookHeader(10)
    Return
EndIf
sayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
EndScript

Script SayCurrentSchemeName()
Var String sScheme = getCurrentSchemeName()
SayFormattedMessage(ot_user_requested_information,
    FormatString(msgSchemeName_l, sScheme),
    FormatString(msgSchemeName_s, sScheme))
EndScript

Script SelectAScheme()
Var String sPrevScheme = GetCurrentSchemeName()
PerformScript SelectAScheme() ; default
;update global scheme name in appropriate .jsi file.
Var String SchemeName = GetCurrentSchemeName()
If stringCompare(sPrevScheme, SchemeName) == 0
    Return
EndIf
If !SchemeIsDocSpecific() ; scheme same throughout app
    WriteSettingString(section_options, hKey_scheme, SchemeName, FT_CURRENT_JCF)
Else
    WriteSettingString("Doc", hKey_Scheme, SchemeName, FT_JSI, wdUser, getActiveDocumentJSIFileName())
EndIf
EndScript

Void Function ListLists()
Var
    String sList,
    Int index,
    Int nCurrentList
sList = GetListOfLists(LIST_ITEM_SEPARATOR)
If !sList
    SayFormattedMessage(ot_error, msgNoLists1_L)
    Return
EndIf
nCurrentList = GetListIndex()
index = DlgSelectItemInList(sList, msgSelectAListDialogName1_L, False, nCurrentList)
If index
    MoveToListByIndex(index)
EndIf
EndFunction

Script selectAList()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException(True) Then
    Return
EndIf
ListLists()
EndScript

Void Function ListTables()
Var
    String sList,
    Int index,
    Int nCurrentTable
sList = GetListOfTables(LIST_ITEM_SEPARATOR)
If !sList
    SayFormattedMessage(ot_error, msgNoTables1_L, msgNoTables1_l)
    Return
EndIf
nCurrentTable = GetTableIndex()
index = DlgSelectItemInList(sList, msgSelectATableDialogName1_L, False, nCurrentTable)
If index
    MoveToTableByIndex(index)
EndIf
If index != nCurrentTable
    ;The TableEnteredEvent will fire before the FocusChangedEvent,
    ;so set a variable used by FocusChangedEvent To test If this has happened.
    ;Normally, FocusChangedEvent happens before TableEnteredEvent,
    ;and TableEnteredEvent tests For this and does Not process all of the speech in the event.
    c_WordTester.FocusChangedOnSelectATable = True
EndIf
EndFunction

Script selectATable()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException(True) Then
    Return
EndIf
ListTables()
EndScript

Script routeJAWSCursorToPc()
If GetSelectionContext() & SelCtxFields
&& !IsObjectNavigationActive()
    routeJAWSCursorToField()
else
    performScript routeJAWSCursorToPc()
EndIf
EndScript

Script BrailleShowRevisionInfo()
Var
    Int nCell,
    String sRevisionText
;flash Braille message For revision information:
If c_WordFocus.windowCategory == wCat_document
&& isPCCursor()
    sRevisionText = GetSelectionContextRevisionText()
    If sRevisionText
        nCell = GetLastBrailleRoutingKey()
        If BrailleGetStatusCellCount()>0
        && nCell==-1
            BrailleRoutingButton(nCell)
            BrailleMessage(sRevisionText
                +cscSpace+GetRevisionTypeString(GetSelectionContextRevisionType())
                +cscSpace+formatString(msgRevAuthor_s, GetSelectionContextRevisionAuthor())
                +cscSpace+GetSelectionContextRevisionDate())
        else
            BrailleRoutingButton(nCell)
            BrailleRefresh()
        EndIf
        Return
    EndIf
EndIf
performScript BrailleRouting()
EndScript

Script NextCell()
If WindowCategoryIsWordDocument()
&& !IsReadOnlyVirtualMessage()
    If TableErrorEncountered(UnitMove_Next)
        Return
    EndIf
    If !NextCell()
        SayUsingVoice(VCTX_message, cMSGEndOfRow, OT_JAWS_message)
        Return
    EndIf
    SetDocumentTableNavType(TABLE_NAV_HORIZONTAL)
    Return
EndIf
PerformScript NextCell()
EndScript

Script PriorCell()
If WindowCategoryIsWordDocument()
&& !IsReadOnlyVirtualMessage()
    If TableErrorEncountered(UnitMove_Prior)
        Return
    EndIf
    If !PriorCell()
        SayUsingVoice(VCTX_message, cMSGBeginningOfRow, OT_JAWS_message)
        Return
    EndIf
    SetDocumentTableNavType(TABLE_NAV_HORIZONTAL)
    Return
EndIf
PerformScript PriorCell()
EndScript

Script UpCell()
If c_WordFocus.windowCategory == wCat_document
&& !IsReadOnlyVirtualMessage()
    If TableErrorEncountered(UnitMove_Up)
        Return
    EndIf
    If !UpCell()
        SayUsingVoice(VCTX_message, cMSGTopOfColumn, OT_JAWS_message)
        Return
    EndIf
    SetDocumentTableNavType(TABLE_NAV_VERTICAL)
    Return
EndIf
PerformScript UpCell()
EndScript

Script DownCell()
If c_WordFocus.windowCategory == wCat_document
&& !IsReadOnlyVirtualMessage()
    If TableErrorEncountered(UnitMove_Down)
        Return
    EndIf
    If !DownCell()
        SayUsingVoice(VCTX_message, cMSGBottomOfColumn, OT_JAWS_message)
        Return
    EndIf
    SetDocumentTableNavType(TABLE_NAV_VERTICAL)
    Return
EndIf
PerformScript DownCell()
EndScript

Script FirstCellInTable()
If WindowCategoryIsWordDocument()
&& !IsReadOnlyVirtualMessage()
    If !InTable()
    && GetCurrentScriptKeyName() == ks_Word_Browse_Objects
        ;Alt+Control+Home is the Word keystroke To Browse Object.
        ;Make sure that the Const exactly matches the name received by KeyPressedEvent.
        TypeCurrentScriptKey()
        Return
    EndIf
    If TableErrorEncountered(UnitMove_Start)
        Return
    EndIf
    SayUsingVoice(VCTX_message, cmsgBeginningOfTable, OT_JAWS_message)
    SetDocumentTableNavType(TABLE_NAV_TABLE_EXTENTS)
    FirstCell()
    Return
EndIf
PerformScript FirstCellInTable()
EndScript

Script LastCellInTable()
If WindowCategoryIsWordDocument()
&& !IsReadOnlyVirtualMessage()
    If TableErrorEncountered(UnitMove_End)
        Return
    EndIf
    SayUsingVoice(VCTX_message, cmsgEndOfTable, OT_JAWS_message)
    SetDocumentTableNavType(TABLE_NAV_TABLE_EXTENTS)
    LastCell()
    Return
EndIf
PerformScript LastCellInTable()
EndScript

Script MoveToStartOfRow()
If !InTable()
&& GetCurrentScriptKeyName() == ks_Word_MoveToStartOfRow
    ;Allowing Alt+Home To pass through means that
    ;Calendar can navigate To start and end of week when Not in tables
    SayCurrentScriptKeyLabel()
    TypeCurrentScriptKey()
    Return
EndIf
If WindowCategoryIsWordDocument()
&& !IsReadOnlyVirtualMessage()
    If TableErrorEncountered(UnitMove_First)
        Return
    EndIf
    SayUsingVoice(VCTX_message, cmsgStartOfRow, OT_JAWS_message)
    SetDocumentTableNavType(TABLE_NAV_ROW_EXTENTS)
    If !StartOfRow()
        SayUsingVoice(VCTX_message, cMsgStartOfRowFailed, OT_JAWS_message)
    EndIf
    Return
EndIf
PerformScript MoveToStartOfRow()
EndScript

Script MoveToEndOfRow()
If !InTable()
&& GetCurrentScriptKeyName() == ks_Word_MoveToEndOfRow
    ;Allowing Alt+Home To pass through means that
    ;Calendar can navigate To start and end of week when Not in tables
    SayCurrentScriptKeyLabel()
    TypeCurrentScriptKey()
    Return
EndIf
If WindowCategoryIsWordDocument()
&& !IsReadOnlyVirtualMessage()
    If TableErrorEncountered(UnitMove_Last)
        Return
    EndIf
    SayUsingVoice(VCTX_message, cmsgEndOfRow, OT_JAWS_message)
    SetDocumentTableNavType(TABLE_NAV_ROW_EXTENTS)
    If !EndOfRow()
        SayUsingVoice(VCTX_message, cMsgEndOfRowFailed, OT_JAWS_message)
    EndIf
    Return
EndIf
PerformScript MoveToEndOfRow()
EndScript

Script MoveToTopOfColumn()
Var String ScriptKeyName = GetCurrentScriptKeyName()
If (!InTable() || !GetFocus())
&& (ScriptKeyName == ks_Word_MoveToTopOfColumn || ScriptKeyName == ks_Word_MoveToTopOfColumn_Extended)
    ;Allowing Alt+PageUp To pass through means that
    ;Skype calls can be answered when Not in tables
    SayCurrentScriptKeyLabel()
    TypeCurrentScriptKey()
    Return
EndIf
If WindowCategoryIsWordDocument()
&& !IsReadOnlyVirtualMessage()
    If TableErrorEncountered(UnitMove_Top)
        Return
    EndIf
    SayUsingVoice(VCTX_message, cmsgTopOfColumn, OT_JAWS_message)
    SetDocumentTableNavType(TABLE_NAV_COLUMN_EXTENTS)
    If !TopOfColumn()
        SayFormattedMessage(OT_error, cMsgTopOfColumnFailed, cMSGNotInTable_S) ; Could Not move To Top of column
    EndIf
    Return
EndIf
PerformScript MoveToTopOfColumn()
EndScript

Script MoveToBottomOfColumn()
Var String ScriptKeyName = GetCurrentScriptKeyName()
If (!InTable() || !GetFocus())
&& (ScriptKeyName == ks_Word_MoveToBottomOfColumn || ScriptKeyName == ks_Word_MoveToBottomOfColumn_Extended)
    ;Allowing Alt+PageDown To pass through means that
    ;Skype calls can be terminated when Not in tables
    SayCurrentScriptKeyLabel()
    TypeCurrentScriptKey()
    Return
EndIf
If WindowCategoryIsWordDocument()
&& !IsReadOnlyVirtualMessage()
    If TableErrorEncountered(UnitMove_Bottom)
        Return
    EndIf
    SayUsingVoice(VCTX_message, cmsgBottomOfColumn, OT_JAWS_message)
    SetDocumentTableNavType(TABLE_NAV_COLUMN_EXTENTS)
    If !BottomOfColumn()
        SayFormattedMessage(OT_error, cMsgBottomOfColumnFailed, cMSGNotInTable_s) ; Could Not move To Bottom of column
    EndIf
    Return
EndIf
PerformScript MoveToBottomOfColumn()
EndScript

Script SayCell()
If IsVirtualPcCursor()
    PerformScript SayCell()
    Return
EndIf
If !InTable()
    SayMessage(ot_error, cMSGNotInTable_L)
    Return
EndIf
If TestForEndOfCellOrRowMarker(True)
    Return
EndIf
SayCellHeaders(OT_USER_REQUESTED_INFORMATION)
SayCell()
SayCellCoordinatesInfo()
EndScript

Script SayFirstCellInColumn()
EnsureNoUserBufferActive()
If WindowCategoryIsWordDocument()
    If InTable()
        Var String sText = GetColumnText(cscNull, cscNull, msgBlankCell1_l, 1, 1)
        If !IsTableUniform()
        && !sText
            sayMessage(ot_error, msgNonuniformTableFirstCellInColumnError)
        else
            Say(sText, ot_user_requested_information)
        EndIf
    Else
        sayMessage(ot_ERROR, cmsgNotInTable_l, cmsgNotInTable_s)
    EndIf
    Return
EndIf
EndScript

Script SayFirstCellInRow()
EnsureNoUserBufferActive()
If WindowCategoryIsWordDocument()
    If InTable()
        Say(GetRowText(cscNull, cscNull, msgBlankCell1_l, 1, 1), ot_user_requested_information)
    Else
        sayMessage(ot_ERROR, cmsgNotInTable_l, cmsgNotInTable_s)
    EndIf
    Return
EndIf
EndScript

Void Function readTableRow()
say(GetRowText(), ot_line, True)
EndFunction

Script readCurrentRow()
EnsureNoUserBufferActive()
If !inTable()
    SayMessage(ot_error, cMSGNotInTable_L)
    Return
EndIf
readTableRow()
EndScript

Script SayPriorRow()
If IsReadOnlyVirtualMessage()
    PerformScript SayPriorRow()
    Return
EndIf
EnsureNoUserBufferActive()
If !InTable()
    SayMessage(ot_error, cMSGNotInTable_L)
    Return
EndIf
SetDocumentTableNavType(TABLE_NAV_SAY_ROW)
If !UpCell()
    SayFormattedMessage(ot_error, msgFirstRow)
    Return
EndIf
EndScript

Script SayNextRow()
If IsReadOnlyVirtualMessage()
    PerformScript SayNextRow()
    Return
EndIf
EnsureNoUserBufferActive()
If !InTable()
    SayMessage(ot_error, cMSGNotInTable_L)
    Return
EndIf
SetDocumentTableNavType(TABLE_NAV_SAY_ROW)
If !DownCell()
    SayFormattedMessage(ot_error, msgLastRow)
    Return
EndIf
EndScript

Void Function readTableColumn()
say(GetColumnText(), ot_line, True)
EndFunction

Script ReadCurrentColumn()
EnsureNoUserBufferActive()
If !inTable()
    SayMessage(ot_error, cMSGNotInTable_L)
    Return
EndIf
If !IsTableUniform()
    sayMessage(ot_error, msgNonUniformTableColumnError_l, msgNonUniformTableColumnError_s)
    Return
EndIf
readTableColumn()
EndScript

Script SayPriorColumn()
EnsureNoUserBufferActive()
If !InTable()
    SayMessage(ot_error, cMSGNotInTable_L)
    Return
EndIf
SetDocumentTableNavType(TABLE_NAV_SAY_COLUMN)
If !PriorCell()
    SayFormattedMessage(ot_error, msgFirstColumn)
    Return
EndIf
If !IsTableUniform()
    sayMessage(ot_error, msgNonUniformTableColumnError_l, msgNonUniformTableColumnError_s)
    Return
EndIf
EndScript

Script SayNextColumn()
EnsureNoUserBufferActive()
If !InTable()
    SayMessage(ot_error, cMSGNotInTable_L)
    Return
EndIf
SetDocumentTableNavType(TABLE_NAV_SAY_COLUMN)
If !NextCell()
    SayFormattedMessage(ot_error, msgLastColumn)
    Return
EndIf
If !IsTableUniform()
    sayMessage(ot_error, msgNonUniformTableColumnError_l, msgNonUniformTableColumnError_s)
    Return
EndIf
EndScript

Void Function sayColumnHeader()
SayColumnTitle()
EndFunction

Script sayColumnTitle()
EnsureNoUserBufferActive()
If InTable()
    sayColumnTitle()
else
    SayFormattedMessage(ot_error, cMSGNotInTable_L, cMSGNotInTable_S)
EndIf
EndScript

Void Function sayRowHeader()
SayRowTitle()
EndFunction

Script sayRowTitle()
EnsureNoUserBufferActive()
If InTable()
    sayRowTitle()
else
    SayMessage(ot_error, cMSGNotInTable_L, cMSGNotInTable_S)
EndIf
EndScript

String Function GetHeadingSoundFile(Int iLevel)
Var
    String sHeadingKey,
    String sData1
sHeadingKey = IntToString(iLevel+WT_HTML_HEADING1-1)
smmGetBehavior(Section_smm_ControlType, sHeadingKey, sData1)
If StringContains(stringSegment(sData1, cScDoubleBackSlash , -1), FileNameExt_Wav)
    Return sData1
else
    Return cscNull
EndIf
EndFunction

Void Function SayCurrentHeading()
Var
    String sSoundFile,
    String sText,
    Int iLevel
If !inTable()
&& !isFormField()
    sText = GetCurrentHeading()
    If sText
        iLevel = getCurrentHeadingLevel()
        sSoundFile = GetHeadingSoundFile(iLevel)
        If sSoundFile
            PlaySound(sSoundFile)
        else
            sText = FormatString(MsgHeadingLevel, IntToString(iLevel))+cscSpace+sText
        EndIf
        sayMessage(ot_line, sText)
    EndIf
EndIf
EndFunction

Void Function ReportHeadingsNotAvailable(optional Int reason)
Var
    String message_L,
    String message_S
If OutlookIsActive()
    message_L = msgNoOutlookMessageHeadings_l
    message_S = msgNoOutlookMessageHeadings_s
Else
    message_L = msgNoHeadings_l
    message_S = msgNoHeadings_s
EndIf
If (product_MAGic == GetRunningFSProducts())
    ExMessageBox(msgMagNoHeadings_L, SelectAHeadingDialogName, MB_OK)
    Return
EndIf
SayMessage(OT_ERROR, message_L, message_S)
If shouldItemSpeak(OT_Error) == 1
    scheduleBrailleFlashMessageWithSpeechOutput(OT_ERROR, message_L, 8)
else
    scheduleBrailleFlashMessageWithSpeechOutput(OT_ERROR, message_S, 8)
EndIf
EndFunction

Int Function SelectAHeadingDialog()
If !dlgListOfHeadings()
    ReportHeadingsNotAvailable(NotAvailableReason_NotFound)
EndIf
Return True
EndFunction

Script ListHeadings()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException(True)
    Return
EndIf
SelectAHeadingDialog()
EndScript

Script SayField()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If IsActiveDocumentProtectedForm()
    performScript SayWindowPromptAndText()
ElIf GetSelectionContext() & SelCtxFields
    SayField()
EndIf
EndScript

Script selectAField()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
ListFields()
EndScript

Script SelectNextOrPriorField()
SayCurrentScriptKeyLabel()
TypeCurrentScriptKey()
;The SelectionChangedEvent will speak the New field,
;so the code which previously handled that functionality has been removed.
EndScript

Script listSpellingErrors()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If !IsCheckSpellingAsYouTypeEnabled()
    SayFormattedMessage(ot_smart_help, msgCheckSpellingDisabled1) ; option To check spelling as you type is disabled
    Return
EndIf
listSpellingErrors()
EndScript

Script listGrammaticalErrors()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If !IsCheckGrammarAsYouTypeEnabled()
    SayFormattedMessage(ot_smart_help, msgCheckGrammarDisabled1)
    Return
EndIf
listGrammaticalErrors()
EndScript

Script ListBookmarks()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
ListBookmarks()
EndScript

String Function formatAnnotationOutput(String RefText, String text, String author, optional String dateTime)
Var String result = RefText+cscBufferNewLine
result = result + text+cscBufferNewLine
If !stringIsBlank(author)
    result = result + formatString(msgAnnotationAuthor, author) + cscBufferNewLine
EndIf
If !stringIsBlank(DateTime)
    result = result + formatString(msgAnnotationDateTime, DateTime) + cscBufferNewLine
EndIf
Return result
EndFunction

Void Function announceComment(Int iOutputType)
Var
    Int index,
    Int count = GetAnnotationCountAtCaret(),
    String output ,
    String MessageToFormat,
    String Text,
    String Author,
    String refText,
    String Desc,
    String DateTime
If !count && ! GetProofreadingElementInfo(peComment, Text, Author, refText, Desc, DateTime)
    ProcessMessage (msgNoComment1_L, cscNull, ot_error, cscNull, MB_OK|MB_ICONERROR)
    Return
EndIf
count = count-1
For index=0 To count
    GetAnnotationAtCaret(index, refText, Author, Text, DateTime, Desc)
    ;For the output For comments, we want the refText because it distinguishes between comments and replies wheras the type does Not.
    If NotesDetection() >= wdVerbosityHigh
        MessageToFormat = formatAnnotationOutput(refText, Text, Author, DateTime)
    else
        MessageToFormat = formatAnnotationOutput(refText, Text, Author)
    EndIf
    If ! stringIsBlank(MessageToFormat)
        output = output+cscBufferNewLine+MessageToFormat
    EndIf
EndFor
ProcessMessage(output, output, iOutputType, msgCommentMessageBoxTitle, MB_OK|MB_ICONASTERISK)
EndFunction

Script announceComment()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If isSameScript()
    announceComment(ot_user_buffer)
    UserBufferAddText(cscBufferNewLine+FormatString(msgCommentDocumentText, GetSelectionCommentDocumentText(        )))
    UserBufferAddText(cscBufferNewLine+cmsgBuffExit)
else
    announceComment(ot_user_requested_information)
EndIf
EndScript

Script PostComment()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
Var
    String sText,
    String sAuthor,
    String sInitials,
    String sDesc,
    String sDate
If GetProofreadingElementInfo(peComment, sText, sAuthor, sInitials, sDesc, sDate)
    If NotesDetection() >= wdVerbosityHigh
        exMessageBox(FormatString(msgCommentWithDate_L, sText, sAuthor, sDate),
            msgCommentMessageBoxTitle, MB_OK|MB_ICONASTERISK)
    else
        exMessageBox(FormatString(msgComment1_L, sText, sAuthor),
            msgCommentMessageBoxTitle, MB_OK|MB_ICONASTERISK)
    EndIf
else
    exMessageBox(msgNoComment1_L, cscNull, MB_OK|MB_ICONERROR)
EndIf
EndScript

Script listComments()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
listComments()
EndScript

Void Function announceFootnoteOrEndNote(Int iOutputType)
Var
    String sText,
    String sAuthor,
    String sInitials,
    String sDesc,
    String sDate,
    String sMsg
If GetProofreadingElementInfo(peFootnote, sText, sAuthor, sInitials, sDesc, sDate)
    sMsg = formatString(msgFootnoteReference, sDesc, sText)
    ProcessMessage(sMsg, sMsg, iOutputType, msgFootnote, MB_OK|MB_ICONASTERISK)
ElIf GetProofreadingElementInfo(peEndNote, sText, sAuthor, sInitials, sDesc, sDate)
    sMsg = formatString(msgEndNoteReference, sDesc, SText)
    ProcessMessage(sMsg, sMsg, iOutputType, msgEndnote, MB_OK|MB_ICONASTERISK)
Else
    ProcessMessage(msgNoFootnoteOrEndNote1_L, msgNoFootnoteOrEndNote1_L, ot_error, msgError, MB_OK|MB_ICONERROR)
EndIf
EndFunction

Script announceFootnoteOrEndNote()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If isSameScript()
    announceFootnoteOrEndNote(ot_user_buffer)
    UserBufferAddText(cscBufferNewLine+cmsgBuffExit)
else
    announceFootnoteOrEndNote(ot_user_requested_information)
EndIf
EndScript

Script ListFootnotes()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
ListFootnotes()
EndScript

Script ListEndnotes()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
ListEndnotes()
EndScript

Int Function GetRevisionInfo(Int iOutputType, String ByRef sRevInfo, String ByRef sRevText)
Var
    String sAuthor,
    String sInitials,
    String sDesc,
    String sDate
sRevInfo = cscNull
If !GetProofreadingElementInfo(peRevision, sRevText, sAuthor, sInitials, sDesc, sDate)
    Return False
EndIf
If sRevText == cscSpace
    sRevText = cmsgSpace1
EndIf
If sDesc != cscNull
    sRevInfo=sDesc
else
    sRevInfo = GetRevisionTypeString(GetSelectionContextRevisionType())
EndIf
sRevInfo = sRevInfo+cscSpace+FormatOutputMessage(iOutputType, False,
    msgRevAuthor_L, msgRevAuthor_s, sAuthor)
sRevInfo = sRevInfo+cscSpace+FormatOutputMessage(iOutputType, False,
    msgRevDate_L, msgRevDate_s, sDate)
Return True
EndFunction

Script AnnounceRevision()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
Var
    String sRevInfo,
    String sRevText,
    Int bJAWSOnly =(getRunningFSProducts() == product_JAWS),
    Int iOutputType
If !IsActiveDocumentTrackChangesEnabled()
    ProcessMessage(msgAnnounceRevisionError_l, msgAnnounceRevisionError_s, ot_error, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
EnsureNoUserBufferActive()
If bJAWSOnly && isSameScript()
    iOutputType = ot_user_buffer
Else
    iOutputType = ot_user_requested_information
EndIf
If !GetRevisionInfo(iOutputType, sRevInfo, sRevText)
    ProcessMessage(msgNoRevision, null(), ot_error, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
If iOutputType == ot_user_buffer
    SayFormattedMessage(iOutputType,
        sRevInfo+cscBufferNewLine+sRevText,
        sRevInfo+cscBufferNewLine+sRevText)
    UserBufferAddText(cscBufferNewLine+cmsgBuffExit)
else
    BeginFlashMessage()
    Say(sRevText, iOutputType, True)
    ProcessMessage(sRevInfo, sRevInfo, iOutputType, msgRevision, MB_OK|MB_ICONINFORMATION, vctx_message)
    EndFlashMessage()
EndIf
EndScript

Script postRevision()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
Var
    String sRevInfo,
    String sRevText,
    Int iOutputType
If !IsActiveDocumentTrackChangesEnabled()
    ProcessMessage(msgAnnounceRevisionError_l, msgAnnounceRevisionError_s, ot_error, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
iOutputType = ot_user_buffer ; so MAGic always gets the text:
If !GetRevisionInfo(iOutputType, sRevInfo, sRevText)
    ProcessMessage(msgNoRevision, null(), ot_error, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
ProcessMessage(sRevInfo+cscBufferNewLine+sRevText, sRevInfo+cscBufferNewLine+sRevText, ot_user_requested_information, msgRevision, MB_OK|MB_ICONINFORMATION, vctx_message)
EndScript

Script listRevisions()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If !IsActiveDocumentTrackChangesEnabled()
    SayFormattedMessage(ot_error, msgTrackChangesNotEnabled1)
    Return
EndIf
listRevisions()
EndScript

Script RevisionDetectionToggle()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
Var Int iStatus = ShowRevisionsView()
If !iStatus
    If RevisionDetection() > 0
        setRevisionsManually(Off)
        sayMessage(ot_status, msgRevisionDetectionOff_l, msgRevisionDetectionOff_s)
    else
        sayMessage(ot_error, msgRevisionDetectionAlreadyOff)
    EndIf
else
    If !RevisionDetection() Then ; Return To default revision detection setting.
        setRevisionsManually(On)
        sayMessage(ot_status, msgRevisionDetectionDefault_l, msgRevisionDetectionDefault_s)
    else ;Revision detection is already On.
        sayMessage(ot_error, formatString(msgRevisionDetectionAlreadyOn, toggleRevisionDetection(True)))
    EndIf
EndIf
EndScript

Script ToggleTrackChanges()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
SayCurrentScriptKeyLabel()
TypeKey(ksToggleTrackChanges)
Pause()
If IsActiveDocumentTrackChangesEnabled()
    SayMessage(ot_help, msgTrackChangesOn_l, msgTrackChangesOn_S)
else
    SayMessage(ot_help, msgTrackChangesOff_l, msgTrackChangesOff_S)
EndIf
Refresh() ; Force FSDomNodeMSWord.dll To be reloaded so that the track changes state change is detected without a focus change.
EndScript

Script listObjects()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
listObjects()
EndScript

Void Function SayFontSize()
SayFormattedMessageWithVoice(vctx_message, ot_status, GetFontSizeString(), GetFontSizeString())
EndFunction

Script GrowFont1Point()
If QuickNavKeyTrapping()
    Return
EndIf
TypeKey(ksGrowFont1Point) ; ControlRightBracket in English
SayFontSize()
EndScript

Script ShrinkFont1Point()
If QuickNavKeyTrapping()
    Return
EndIf
TypeKey(ksShrinkFont1Point) ; ControlLeftBracket in English
SayFontSize()
EndScript

Script GrowFont()
If QuickNavKeyTrapping()
    Return
EndIf
TypeKey(ksGrowFont) ; ControlShiftPeriod in English
SayFontSize()
EndScript

Script ShrinkFont()
If QuickNavKeyTrapping()
    Return
EndIf
TypeKey(ksShrinkFont) ; ControlShiftComma in English
SayFontSize()
EndScript

Script sayFont()
sayFont()
EndScript

Script describeBorderOfTextUnit()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
describeBorderOfTextUnit()
EndScript

Script sayLineAndColumn()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
SayLineAndColumn()
EndScript

Script InsertComment()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
Var
    Int index,
    String sAuthor,
    String sInitials
TypeKey(GetScriptKeyName("InsertComment"))
GetCommentInfo(index, sAuthor, sInitials)
If sAuthor!=cscNull
    SayUsingVoice(vctx_message,
        FormatString(msgInsertingComment, IntToString(index), sAuthor, sInitials),
        ot_help)
EndIf
EndScript

Script toggleBetweenAllAndHeadingsOnly()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If isOutlineViewActive()
    TypeKey(ksToggleBetweenAllAndHeadingsOnly) ; AltShiftA in English
    pause()
    Var String sLevel = GetVisibleHeadingLevelString()
    If sLevel
        SayUsingVoice(vctx_message,
            FormatString(msgHeadingsOnly1_L, sLevel),
            ot_status)
    EndIf
Else
    ; Not in outline view.
    SayFormattedMessageWithVoice(vctx_message, ot_error, msgNotINOutlineView, msgNotInOutlineView)
EndIf
EndScript

Script showHeading1()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If isOutlineViewActive()
    TypeKey(ksShowHeading1) ; AltShift1 in English)
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status,
        GetOutlineViewStatusMessage(ot_status))
Else
    SayFormattedMessageWithVoice(vctx_message, ot_error,
        msgNotINOutlineView, msgNotInOutlineView)
EndIf
EndScript

Script showHeading2()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If isOutlineViewActive()
    TypeKey(ksShowHeading2) ; AltShift2 in English)
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status,
        GetOutlineViewStatusMessage(ot_status))
Else
    SayFormattedMessageWithVoice(vctx_message, ot_error,
        msgNotINOutlineView, msgNotInOutlineView)
EndIf
EndScript

Script showHeading3()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException(True)
    Return
EndIf
If isOutlineViewActive()
    TypeKey(ksShowHeading3) ; AltShift3 in English)
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status,
        GetOutlineViewStatusMessage(ot_status))
Else
    SayFormattedMessageWithVoice(vctx_message, ot_error,
        msgNotINOutlineView, msgNotInOutlineView)
EndIf
EndScript

Script showHeading4()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException(True)
    Return
EndIf
If isOutlineViewActive()
    TypeKey(ksShowHeading4) ; AltShift4 in English)
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status,
        GetOutlineViewStatusMessage(ot_status))
Else
    SayFormattedMessageWithVoice(vctx_message, ot_error,
        msgNotINOutlineView, msgNotInOutlineView)
EndIf
EndScript

Script showHeading5()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If isOutlineViewActive()
    TypeKey(ksShowHeading5) ; AltShift5 in English)
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status,
        GetOutlineViewStatusMessage(ot_status))
Else
    SayFormattedMessageWithVoice(vctx_message, ot_error,
        msgNotINOutlineView, msgNotInOutlineView)
EndIf
EndScript

Script showHeading6()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If isOutlineViewActive()
    TypeKey(ksShowHeading6) ; AltShift6 in English)
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status,
        GetOutlineViewStatusMessage(ot_status))
Else
    SayFormattedMessageWithVoice(vctx_message, ot_error,
        msgNotINOutlineView, msgNotInOutlineView)
EndIf
EndScript

Script showHeading7()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If isOutlineViewActive()
    TypeKey(ksShowHeading7) ; AltShift7 in English)
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status,
        GetOutlineViewStatusMessage(ot_status))
Else
    SayFormattedMessageWithVoice(vctx_message, ot_error,
        msgNotINOutlineView, msgNotInOutlineView)
EndIf
EndScript

Script showHeading8()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If isOutlineViewActive()
    TypeKey(ksShowHeading8) ; AltShift8 in English)
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status,
        GetOutlineViewStatusMessage(ot_status))
Else
    SayFormattedMessageWithVoice(vctx_message, ot_error,
        msgNotINOutlineView, msgNotInOutlineView)
EndIf
EndScript

Script showHeading9()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
If isOutlineViewActive()
    TypeKey(ksShowHeading9) ; AltShift9 in English)
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status,
        GetOutlineViewStatusMessage(ot_status))
Else
    SayFormattedMessageWithVoice(vctx_message, ot_error,
        msgNotINOutlineView, msgNotInOutlineView)
EndIf
EndScript

Script selectNextHeadingOrListLevelStyle()
If !isPcCursor()
    performScript mouseRight()
    Return
EndIf
If QuickNavKeyTrapping()
    Return
EndIf
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
TypeKey(ksSelectNextHeadingOrListLevelStyle) ; AltShiftRightArrow in English
pause()
sayStyleAtCursor()
EndScript

Script selectPriorHeadingOrListLevelStyle()
If !isPcCursor()
    performScript mouseLeft()
    Return
EndIf
If QuickNavKeyTrapping()
    Return
EndIf
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
TypeKey(ksSelectPriorHeadingOrListLevelStyle) ; AltShiftLeftArrow in English
pause()
sayStyleAtCursor()
EndScript

Script MoveItemDown()
If !isPcCursor()
    performScript mouseDown()
    Return
EndIf
If QuickNavKeyTrapping()
    Return
EndIf
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
TypeKey(ksMoveHeadingDown) ; AltShiftDownArrow in English
pause()
sayFormattedMessageWithVoice(VCTX_message, ot_status,
    msgMoveItemDown_L, msgMoveItemDown_S)
EndScript

Script MoveItemUp()
If !isPcCursor()
    performScript mouseUp()
    Return
EndIf
If QuickNavKeyTrapping()
    Return
EndIf
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
TypeKey(ksMoveHeadingUp) ; AltShiftUpArrow in English
pause()
sayFormattedMessageWithVoice(VCTX_message, ot_status,
    msgMoveItemUp_L, msgMoveItemUp_S)
EndScript

Void Function sayHorizontalPosition()
If WindowCategoryIsWordDocument()
&& isPcCursor()
    Var String sCursorHorizPos = GetCursorColString(GetActiveCursor(), getDesiredUnitsOfMeasure())
    SayFormattedMessageWithVoice(vctx_message, ot_status,
        formatString(msgFromLeft1_L, sCursorHorizPos),
        formatString(msgFromLeft1_S, sCursorHorizPos))
EndIf
EndFunction

Script indent()
If QuickNavKeyTrapping()
    Return
EndIf
TypeKey(ksIndent) ; CtrlM in English
If isPCCursor()
&& !UserBufferIsActive()
&& WindowCategoryIsWordDocument()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgIndent1_L, msgIndent1_S)
    delay(1)
    sayHorizontalPosition()
EndIf
EndScript

Script outdent()
If !WindowCategoryIsWordDocument()
|| IsReadOnlyMessage()
    SayCurrentScriptKeyLabel()
    typeCurrentScriptKey()
    Return
ElIf QuickNavKeyTrapping()
    Return
EndIf
typeCurrentScriptKey()
If IsPCCursor()
&& !UserBufferIsActive()
&& WindowCategoryIsWordDocument()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgOutDent1_L, msgOutdent1_S)
    delay(1)
    sayHorizontalPosition()
EndIf
EndScript

Void Function sayHangingIndent()
If WindowCategoryIsWordDocument()
&& isPcCursor()
    Var String sIndent = GetCursorPosString(GetActiveCursor(), smmGetDesiredUnitsOfMeasure())
    SayFormattedMessageWithVoice(vctx_message, ot_status, formatString(msgFromLeft1_L, sIndent), formatString(msgFromLeft1_S, sIndent))
EndIf
EndFunction

Script hangingIndent()
If QuickNavKeyTrapping()
    Return
EndIf
TypeKey(ksHangingIndent)
If isPCCursor()
&& !UserBufferIsActive()
&& WindowCategoryIsWordDocument()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgHangingIndent1_L, msgHangingIndent1_S)
    delay(1)
    sayHorizontalPosition()
EndIf
EndScript

Script removeHangingIndent()
If QuickNavKeyTrapping()
    Return
EndIf
TypeKey(ksRemoveHangingIndent)
If isPCCursor()
&& !UserBufferIsActive()
&& WindowCategoryIsWordDocument()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgRemoveHangingIndent1_L, msgRemoveHangingIndent1_S)
    delay(1)
    sayHorizontalPosition()
EndIf
EndScript

Int Function isFormatForFindAndReplaceDlg(String sFormatOff, String sFormatOn, String sMsgOff, String sMsgOn)
If DialogActive()
&& globalRealWindowName==wn_FindAndReplace
    Var String sObjName
    SaveCursor()
    InvisibleCursor()
    If FindString(GetCurrentWindow(), sc_Format, s_top, s_unrestricted)
        NextChunk()
        sObjName=GetObjectName()
        If stringContains(sObjName, sFormatOff)
            SayFormattedMessageWithVoice(vctx_message, ot_status, sMsgOff, cMsgSilent)
        ElIf StringContains(sObjName, sFormatOn)
            SayFormattedMessageWithVoice(vctx_message, ot_status, sMsgOn, cMsgSilent)
        EndIf
        RestoreCursor()
        Return True
    EndIf
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgNotFormatted, cMsgSilent)
    RestoreCursor()
    Return True
EndIf
Return False
EndFunction

Int Function IsNotificationPossible()
Return IsWindows10()
    && GetJCFOption(OPT_ENABLE_ACCESSIBLE_NOTIFICATION_EVENTS)
EndFunction

Script BoldText()
If QuickNavKeyTrapping()
    Return
EndIf
If IsDocumentAreaScriptException()
    Return
EndIf
TypeKey(ksBold) ; Ctrl+b in English
If !getRunningFSProducts() & product_JAWS
    Return sayCurrentScriptKeyLabel()
EndIf
If IsNotificationPossible()
&& !OutlookIsActive()
    Return
EndIf
pause()
If IsFormatForFindAndReplaceDlg(sc_NotBold, sc_bold, msgBoldOff1_l, msgBoldOn1_l)
    Return
EndIf
If fontIsBold()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgBoldOn1_L, cmsgOn)
else
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgBoldOff1_L, cmsgOff)
EndIf
If !isSelectionModeActive()
&& IsExtendedSelectionModeWatchActive()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgSelectionModeOff1_L, msgSelectionModeOff1_L)
    StopExtendedSelectionModeWatch()
EndIf
EndScript

Script ItalicText()
If QuickNavKeyTrapping()
    Return
EndIf
If IsDocumentAreaScriptException()
    Return
EndIf
TypeKey(ksItalic) ; Ctrl+i in English
If ! getRunningFSProducts() & product_JAWS
    Return sayCurrentScriptKeyLabel()
EndIf
If IsNotificationPossible()
&& !OutlookIsActive()
    Return
EndIf
pause()
If IsFormatForFindAndReplaceDlg(sc_NotItalic, sc_italic, msgItalicOff1_l, msgItalicOn1_l)
    Return
EndIf
If fontIsItalic()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgItalicOn1_L, cmsgOn)
else
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgItalicOff1_L, cmsgOff)
EndIf
If !isSelectionModeActive()
&& IsExtendedSelectionModeWatchActive()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgSelectionModeOff1_L, msgSelectionModeOff1_L)
    StopExtendedSelectionModeWatch()
EndIf
EndScript

Script UnderlineText()
If QuickNavKeyTrapping()
    Return
EndIf
If IsDocumentAreaScriptException()
    Return
EndIf
TypeKey(ksUnderline) ; Ctrl+u in English
If ! getRunningFSProducts() & product_JAWS
    Return sayCurrentScriptKeyLabel()
EndIf
If IsNotificationPossible()
&& !OutlookIsActive()
    Return
EndIf
pause()
If IsFormatForFindAndReplaceDlg(sc_NoUnderline, sc_underline, msgUnderlineOff1_l, msgUnderlineOn1_l)
    Return
EndIf
If fontIsUnderlined()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgUnderlineOn1_L, cmsgOn)
else
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgUnderlineOff1_L, cmsgOff)
EndIf
If !isSelectionModeActive()
&& IsExtendedSelectionModeWatchActive()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgSelectionModeOff1_L, msgSelectionModeOff1_L)
    StopExtendedSelectionModeWatch()
EndIf
EndScript

Script LeftJustify()
If QuickNavKeyTrapping()
    Return
EndIf
If IsDocumentAreaScriptException()
    Return
EndIf
TypeCurrentScriptKey() ; Ctrll in English
If ! getRunningFSProducts() & product_JAWS
    Return sayCurrentScriptKeyLabel()
EndIf
Pause()
BrailleRefresh()
SayParagraphAlignment(vctx_message, ot_status)
EndScript

Script CenterText()
If QuickNavKeyTrapping()
    Return
EndIf
If IsDocumentAreaScriptException()
    Return
EndIf
TypeCurrentScriptKey() ; CtrlE in English.
If ! getRunningFSProducts() & product_JAWS
    Return sayCurrentScriptKeyLabel()
EndIf
Pause()
BrailleRefresh()
SayParagraphAlignment(vctx_message, ot_status)
EndScript

Script RightJustify()
If IsReadOnlyVirtualMessage()
    ;This block should theoretically never be executed, since Script ReplyOrRightJustify in Outlook should have pre-empted it.
    If ksRightJustify == ksReply
        TypeKey(ksReply) ; CtrlR in English
    EndIf
    Return
ElIf QuickNavKeyTrapping()
|| UserBufferIsActive()
    Return
EndIf
If IsDocumentAreaScriptException()
    Return
EndIf
TypeCurrentScriptKey() ; CtrlR in English
If ! getRunningFSProducts() & product_JAWS
    Return sayCurrentScriptKeyLabel()
EndIf
Pause()
BrailleRefresh()
SayParagraphAlignment(vctx_message, ot_status)
EndScript

Script JustifyText()
If QuickNavKeyTrapping()
    Return
EndIf
If IsDocumentAreaScriptException()
    Return
EndIf
TypeCurrentScriptKey() ; CtrlJ in English
If ! getRunningFSProducts() & product_JAWS
    Return sayCurrentScriptKeyLabel()
EndIf
Pause()
BrailleRefresh()
SayParagraphAlignment(vctx_message, ot_status)
EndScript

Script convertShapesToInline()
If QuickNavKeyTrapping()
    Return
EndIf
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
convertShapesToInline()
EndScript

Script GoBack()
If c_WordFocus.windowCategory == wCat_document
&& HasNavigatedForwardInCurrentDocument()
    TrackLinkNavigation(MOVE_BACK)
    TypeKey(ksGoBack)
    SayFormattedMessageWithVoice(vctx_message, ot_help, msgReturnToTOC_l, msgReturnToTOC_s)
    If BrailleInUse()
        BrailleClearMessage()
    EndIf
    SayLine()
    Return
EndIf
SayCurrentScriptKeyLabel()
TypeKey(ksGoBack)
EndScript

Script GoForward()
If c_WordFocus.windowCategory == wCat_document
&& HasNavigatedForwardInCurrentDocument()
&& IsHyperlinkField()
    ;Enter must have been used at least once in a document
    ;To navigate forward before the Alt+Right is allowed To move forward:
    TrackLinkNavigation(MOVE_FORWARD)
    TypeKey(ksGoForward)
    SayFormattedMessageWithVoice(vctx_message, ot_help, msgForwardFromTOC_l, msgForwardFromTOC_s)
    If BrailleInUse()
        BrailleClearMessage()
    EndIf
    SayLine()
    Return
EndIf
SayCurrentScriptKeyLabel()
TypeKey(ksGoForward)
EndScript

Void Function ReportLinksNotAvailable(optional Int reason)
If product_MAGic == GetRunningFSProducts()
    ExMessageBox(cmsgMagNoLinks_L, SelectALinkDialogName, MB_OK)
    Return
EndIf
sayFormattedMessage(ot_error, cmsgNoLinks + cscSpace + msgCheckForLinkFields)
scheduleBrailleFlashMessageWithSpeechOutput(ot_error, cmsgNoLinks + cscSpace + msgCheckForLinkFields, 8, True)
EndFunction

Int Function SelectALinkDialog()
If UserBufferIsActive()
    default::SelectALinkDialog() ; default behaviors in userBuffer.
    Return True
EndIf
If InHJDialog()
    SayFormattedMessage(OT_error, cMSG337_L, cMSG337_S)
    Return True
EndIf
If !(DialogActive() || GetMenuMode())
&& c_WordFocus.WindowClass == wc_WordMainDocumentWindow
    If !dlgListOfLinks()
        ReportLinksNotAvailable(NotAvailableReason_NotFound)
    EndIf
    Return True
EndIf
Return False
EndFunction

Void Function ReadSpellCheckInfo(optional Int bAcknowledgeSuggestions)
Var
    Object oWindow,
    Object oItem,
    String sItemPrompt,
    String sItemText,
    String sListName,
    String sListValue,
    Int bSpellText,
    Handle hFocus = getFocus(),
    Handle hReal = getRealWindow(hFocus),
    String sBrlMSG,
    Int savedUseSDMOption
;obtained using iAccessible methods:
oWindow = GetUIAObjectTree(hReal)
If !oWindow Return EndIf
oItem = oWindow.FindByRole(ROLE_SYSTEM_TEXT)
sItemPrompt = oItem.name
sItemText = oItem.Value
bSpellText = True
sayMessage(OT_CONTROL_NAME, sItemPrompt)
sayMessage(OT_DIALOG_TEXT, sItemText)
If bSpellText
    spellString(sItemText)
EndIf
sBrlMSG = sItemPrompt + cscSpace + sItemText
;now For the suggestions list:
;Neither UIA nor iAccessible interface reliably gets grammatical error suggestions,
;so we will Use SDM To get the suggestion:
savedUseSDMOption = GetJCFOption(OPT_USE_SDM_API)
SetJCFOption(OPT_USE_SDM_API, 1)
sListName = SDMGetControlName(hReal, cID_O365_SuggestionListPrompt )
sListValue = SDMGetControlActiveItem(hReal, cID_O365_SpellingSuggestionsList)
If !sListValue
    sListValue = SDMGetControlActiveItem(getRealWindow(GetFocus()), cID_O365_GrammarSuggestionsList)
EndIf
SetJCFOption(OPT_USE_SDM_API, savedUseSDMOption)
If stringIsBlank(sListValue)
|| sListValue == noSelectedItem
    ;SDM failed To get suggestions, try UIA
    Var
        Object oUIA = CreateObjectEx("FreedomSci.UIA", 0, "UIAScriptAPI.x.manifest" ),
        Object treewalker = CreateUIARawViewTreeWalker(True),
        Object oListTypeCondition = oUIA.createIntPropertyCondition(UIA_ControlTypePropertyId, UIA_ListControlTypeId),
        Object oSuggestionList,
        Object oValuePattern
    If !treewalker
    || !oListTypeCondition
        Return
    EndIf
    treeWalker.currentElement = FSUIAGetFocusedElement()
    While treewalker.currentElement.controlType != UIA_WindowControlTypeId
    && UIAGetParent (treewalker.currentElement)
        treewalker.gotoParent()
    EndWhile
    oSuggestionList = treewalker.currentElement.findFirst(TreeScope_Descendants, oListTypeCondition)
    oValuePattern = oSuggestionList.getValuePattern()
    sListValue = oValuePattern.value
EndIf
If stringIsBlank(sListValue)
    ;UIA also failed To get suggestions
 If bAcknowledgeSuggestions
        SayMessage(ot_error, msgSuggestionsListNotAvailable_L, msgSuggestionsListNotAvailable_S)
    else
        SayMessage(ot_error, msgNoSpellingSuggestions1_L, msgNoSuggestions1_L)
    EndIf
    sBrlMSG = sBrlMSG + msgNoSuggestions1_L
    BrailleMessage(sBrlMSG)
    Return
EndIf
If stringContains(sListValue, scNoSelectedItem)
    sListValue = msgNoSpellingSuggestions1_L
    bSpellText = Off
EndIf
indicateControlType(wt_ListBox, sListName, sListValue)
If bSpellText
    spellString(sListValue)
EndIf
sBrlMSG = sBrlMSG + cscSpace + sListName + cscSpace + sListValue
BrailleMessage(sBrlMSG)
EndFunction

Void Function ReadSpellCheckInfoUIA(optional Int bAcknowledgeSuggestions)
; uses older AccessibleTreeBuilder To manage Word 2013 and versions of Word 2016 without suggestions as split buttons.
Var
    Int bGrammarError,
    Int bContainsSuggestion,
    Int bFocusInSuggestionList, ; For user tabs To suggestion list and press insert+f7
    Object oFocus = GetUIAObjectFocusItem(),
    Object oParent = oFocus.parent,
    Object oSuggestionList = oParent.FindByRole(ROLE_SYSTEM_LIST),
    Object oGrammarSuggestion,
    Int bSpellText,
    String sText,
    String sPrompt,
    String sSuggestion,
    String sExtraGrammarInfo,
    String sBrlMSG,
    String sTmp
If ReadProofingPaneWithSplitButtons() Return EndIf
If oFocus.Role == ROLE_SYSTEM_LISTITEM
    oSuggestionList = oFocus.parent
    oParent = oSuggestionList.parent
    bFocusInSuggestionList = True
EndIf
If !bFocusInSuggestionList&& ! oSuggestionList.FindByState(STATE_SYSTEM_SELECTED)
    bGrammarError = True
else
    If bFocusInSuggestionList
        sSuggestion = oFocus.name
    else
        sSuggestion = oSuggestionList.FindByState(STATE_SYSTEM_SELECTED).name
    EndIf
EndIf
oGrammarSuggestion = oSuggestionList.NextSibling
While oGrammarSuggestion && oGrammarSuggestion.role != ROLE_SYSTEM_STATICTEXT
    ; For those cases where buttons appear before the grammar label
    oGrammarSuggestion = oGrammarSuggestion.NextSibling
EndWhile
sTmp = oGrammarSuggestion.name
;Pick up the extra grammar text,
;e.g. explanation of grammar rules:
oGrammarSuggestion = oGrammarSuggestion.NextSibling
While oGrammarSuggestion && oGrammarSuggestion.role == ROLE_SYSTEM_STATICTEXT
    sTmp = oGrammarSuggestion.name
    If !stringIsBlank(sExtraGrammarInfo)
    && !stringIsBlank(sTmp)
        sExtraGrammarInfo = sExtraGrammarInfo + cscSpace
    EndIf
    sExtraGrammarInfo = sExtraGrammarInfo + sTmp
    oGrammarSuggestion = oGrammarSuggestion.NextSibling
EndWhile
sPrompt = oParent.name
sText = oParent.FirstChild.Name
sBrlMSG = sBrlMSG + sPrompt
bContainsSuggestion = ! stringIsBlank(sSuggestion)
If bGrammarError
    If bContainsSuggestion
        sPrompt = msgSuggestion
        sayMessage(OT_CONTROL_NAME, sPrompt)
        sBrlMSG = sBrlMSG + cscSpace + sPrompt
    else
        sayMessage(OT_CONTROL_NAME, sSuggestion)
        sayMessage(OT_LINE, sText)
        spellString(sText)
        sBrlMSG = sBrlMSG + cscSpace + sText
    EndIf
    If !bContainsSuggestion
        If bAcknowledgeSuggestions
            sayMessage(OT_ERROR, msgNoSpellingSuggestions1_L)
        EndIf
        sBrlMSG = sBrlMSG + cscSpace + msgNoSpellingSuggestions1_L
    else
        sayMessage(OT_CONTROL_NAME, sSuggestion)
        sayMessage(OT_LINE, sText)
        spellString(sText)
        sBrlMSG = sBrlMSG + cscSpace + sText
    EndIf
else
    sayMessage(OT_CONTROL_NAME, sPrompt)
    sBrlMSG = sPrompt
    sayMessage(OT_LINE, sText)
    spellString(sText)
    sBrlMSG = sBrlMSG + cscSpace + sText
    sPrompt = msgSuggestion
    If stringIsBlank(sSuggestion)
        If bAcknowledgeSuggestions
            sayMessage(OT_ERROR, msgNoSpellingSuggestions1_L)
        EndIf
        sBrlMSG = sBrlMSG + cscSpace + msgNoSpellingSuggestions1_L
    else
        sayMessage(OT_CONTROL_NAME, sPrompt)
        sBrlMSG = sBrlMSG + cscSpace + sPrompt
        sayMessage(OT_LINE, sSuggestion)
        spellString(sSuggestion)
        sBrlMSG = sBrlMSG + cscSpace + sSuggestion
    EndIf
EndIf
If !stringIsBlank(sExtraGrammarInfo)
    If getRunningFSProducts() & PRODUCT_MAGic
        ; do Not virtualize, causes crashes:
        sayMessage(OT_HELP, sExtraGrammarInfo)
        sBrlMSG = sBrlMSG + cscSpace + sExtraGrammarInfo
    else
        sayMessage(OT_HELP, msgReasonTextAvailable)
        sBrlMSG = sBrlMSG + cscSpace + msgReasonTextAvailable
        UserBufferClear()
        UserBufferDeactivate()
        UserBufferAddText(sExtraGrammarInfo+cscBufferNewLine+cMsgBuffExit)
        UserBufferActivate()
        If UserBufferIsActive()
            JAWSTopOfFile()
            SayLine()
        EndIf
    EndIf
EndIf
If !stringIsBlank(sBrlMSG)
    BrailleMessage(sBrlMSG)
EndIf
EndFunction

Int Function ReadMicrosoftEditorSuggestion(optional Object oElement)
If !c_WordFocus.InMicrosoftEditorProofingPaneIssueChecker Return False EndIf
Var
    Int iIndicateTypeAndPosition = False,
    Int iIndicateSuggestion = True
If !oElement
    oElement = FSUIAGetFocusedElement ()
    iIndicateTypeAndPosition = True
    iIndicateSuggestion = False
EndIf
If oElement.controlType != UIA_SplitButtonControlTypeId
|| !StringStartsWith (oElement.AutomationID, "SplitButton_", True)
    Return False
EndIf
Var
    Object oPane = FSUIAGetAncestorOfControlType (oElement, UIA_PaneControlTypeID),
    Object oIssueTypeCondition = FSUIACreateStringPropertyCondition (UIA_AutomationIDPropertyID, "DrillInPane_Title"),
    String sIssueType = oPane.findFirst(TreeScope_Children, oIssueTypeCondition).name,
    String sText
If StringIsBlank (sIssueType) Return False EndIf
If iIndicateSuggestion
    Say(msgSuggestion, OT_LINE)
EndIf
If sIssueType == wn_Proofing_Pane_Spelling
    Var String sSuggestion = StringSegment (oElement.name, ", ", 1)
    sText = StringSegmentRemove(oElement.name, ", ", 1)
    sText = StringSegmentRemove(sText, ", ", 1)
    Say (sSuggestion, OT_LINE)
    SpellString (sSuggestion)
else
    sText = oElement.name
EndIf
If iIndicateTypeAndPosition
    IndicateControlType (WT_SPLITBUTTON, sText)
    Say(PositionInGroup (), OT_POSITION)
else
    Say(sText, OT_LINE)
EndIf
Return True
EndFunction

Int Function ReadMicrosoftEditorIssueCheckerInfo(optional Int bAcknowledgeSuggestions, Int includeContainerName)
If !c_WordFocus.InMicrosoftEditorProofingPaneIssueChecker Return False EndIf
Var Object oPane = FSUIAGetParentOfElement (FSUIAGetFocusedElement ())
If oPane.controlType != UIA_PaneControlTypeId
    ;Some focusable elements in the issue checker are children of a pane.
    ;Others are grandchildren.
    ;Move up one more time and Then check again.
    oPane = FSUIAGetParentOfElement (oPane)
EndIf
If oPane.controlType != UIA_PaneControlTypeId
    ;Not in O365 spell check
    Return False
EndIf
Var
    Object oGroupCondition = FSUIACreateIntPropertyCondition (UIA_ControlTypePropertyID, UIA_GroupControlTypeID),
    Object oIssueTypeCondition = FSUIACreateStringPropertyCondition (UIA_AutomationIDPropertyID, "DrillInPane_Title"),
    Object oGroup = oPane.findFirst(TreeScope_Children, oGroupCondition),
    Object oElement = FSUIAGetFirstChildOfElement (oGroup),
    String sIssueType = oPane.findFirst(TreeScope_Children, oIssueTypeCondition).name
If StringIsBlank(sIssueType) Return False EndIf
If includeContainerName
    Say (oGroup.name, OT_LINE)
EndIf
If sIssueType == wn_Proofing_Pane_Spelling
    Var String sMisspelled = StringTrimLeadingBlanks (StringSegment (oElement.name, ", ", 2))
    Say (sMisspelled, OT_LINE)
    SpellString (sMisspelled)
    oElement = FSUIAGetFirstChildOfElement (oElement)
    Say (oElement.name, OT_LINE);word in context
else
    ;Grammatical error or other refinement
    Say (oElement.name, OT_LINE)
EndIf
If bAcknowledgeSuggestions
    Delay (5, False)
    Var Object oSuggestionsCondition = FSUIACreateStringPropertyCondition (UIA_AutomationIDPropertyID, "SplitButton_", PropertyConditionFlags_MatchSubstring)
    oSuggestionSplitButton = oPane.findFirst(TreeScope_Descendants, oSuggestionsCondition)
    If GetObjectTypeCode() == WT_STATIC
        ;Focus is On the text element containing the misspelled word.
        ;Read the first suggestion, as enter has been scripted To invoke it.
        If !ReadMicrosoftEditorSuggestion(oSuggestionSplitButton)
            Say(msgNoSuggestions1_L, OT_ERROR)
        EndIf
    else
        ;Focus is Not On the text element containing the misspelled word.
        ;Just announce the number of suggestions.
        If oSuggestionSplitButton.sizeOfSet
            SayFormattedMessage (OT_LINE, msgSuggestions, msgSuggestions, oSuggestionSplitButton.sizeOfSet)
        else
            Say(msgNoSuggestions1_L, OT_ERROR)
        EndIf
        EndIf
EndIf
Return True
EndFunction

Script ReadMistakeAndSuggestion()
If SelectALinkDialog()
    Return
EndIf
If ReadMicrosoftEditorIssueCheckerInfo(True, True)
    Return
EndIf
If c_WordFocus.windowCategory== WCAT_TASK_PANE
    If c_WordFocus.InProofingPaneSpellCheck
    || c_WordFocus.OutlookIsActive
        ReadSpellCheckInfoUIA(True)
        Return
    EndIf
    sayMessage(ot_error, msgTaskPaneLinkError_l, msgTaskpaneLinkError_s)
    Return
ElIf c_WordFocus.InProofingPaneSpellCheck
    ReadSpellCheckInfo(True)
    Return
EndIf
sayMessage(ot_error, msgNotInSpellChecker)
EndScript

Script SelectALink()
; We want insert f7 To repeat the Spellcheck functionality in case the Reason text is being read.
If UserBufferIsActive() && !(getRunningFSProducts() & PRODUCT_MAGic)
    If c_WordFocus.InProofingPaneSpellCheck
        ReadProofingPaneWithSplitButtons()
        Return
    EndIf
EndIf
performScript SelectALink()
EndScript

Script sayLanguageInUse()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
sayLanguageInUse()
EndScript

Script FocusToFirstFormField()
EnsureNoUserBufferActive()
If IsDocumentAreaScriptException()
    Return
EndIf
focusToFirstFormField()
EndScript

Script ShowItemsInVirtualViewer()
EnsureNoUserBufferActive(False)
If IsDocumentAreaScriptException()
    Return
EndIf
Var
    String sList,
    String sItem,
    Int iCount,
    Int iType,
    Int iChoice
sList = stringChopLeft(ListItemsToDisplay, 1)
iChoice = DlgSelectItemInList(sList, msgListOfItemsToDisplayInVV, False)
sItem = stringSegment(sList, cscListSeparator , iChoice)
If sItem == scComments
    iType = peComment
ElIf sItem == scFootnotes
    iType = peFootnote
ElIf sItem == scEndnotes
    iType = peEndnote
ElIf sItem == scRevisions
    iType = peRevision
else
    Return
EndIf
SayFormattedMessage(ot_smart_help, formatString(msgListItemsPleaseWait, sItem))
;a table in the revisions may cause revised text To Include list_item_separator,
;so temporarily Use some other character as the revision delimiter and Then clean up the list:
; This may help but will Not hurt For values of iType other than peRevision.
sList = GetListOfProofreadingElements(iType, "\001")
sList = StringReplaceSubstrings(sList, list_item_separator, cscSpace)
sList = StringReplaceSubstrings(sList, "\001", list_item_separator)
;now it's cleaned up, list_item_separator is safe To Use as the revision delimiter.
iCount = StringSegmentCount(sList, list_item_separator)
If iCount == 0
    SayMessage(ot_error, msgNoItemsToDisplay)
    Return
ElIf iCount == 1
    sItem = stringSegment(stringChopLeft(
        ListItemsToDisplay_singular, 1), cscListSeparator , iChoice)
EndIf
ShowListInVirtualViewer(iType, sItem, sList, iCount)
EndScript

Script ToggleWritingMode()
EnsureNoUserBufferActive()
toggleOverTypeMode()
EndScript

Script ToggleCase()
If QuickNavKeyTrapping()
    Return
EndIf
Var
    String sSelectedText,
    Int iLength,
    String sFirstSelectedWord,
    String sLastSelectedWord
SayCurrentScriptKeyLabel()
TypeKey(ksToggleCase)
If WindowCategoryIsWordDocument()
&& isPcCursor()
    sSelectedText = stringStripAllBlanks(GetSelectedText())
    iLength = StringLength(sSelectedText)
    If iLength> 1
    && iLength <= 255 Then ;about one line of standard 12-point text.
        Say(sSelectedText, OT_SPELL)
    ElIf iLength > 255
        sFirstSelectedWord = stringSegment(GetSelectedText(), cscSpace, 1)
        sLastSelectedWord = stringSegment(GetSelectedText(), cscSpace, -2)
        SayMessage(ot_selected_item, msgChangedCaseFrom)
        Say(sFirstSelectedWord, ot_spell)
        SayMessage(ot_selected_item, msgChangedCaseTo)
        Say(sLastSelectedWord, ot_spell)
    else
        SpellWord()
    EndIf
    If BrailleInUse()
        BrailleRefresh()
    EndIf
EndIf
EndScript

Script ToggleShowHideNonprintingCharacters()
TypeCurrentScriptKey()
SayCurrentScriptKeyLabel()
;With windows 8 and later,
;we do Not get a NewTextEvent To Let us know that something changed:
Delay(5)
Refresh()
EndScript

Script JAWSDelete()
If QuickNavKeyTrapping()
    Return
EndIf
PerformScript JAWSDelete()
EndScript

Script Delete()
performScript JAWSDelete()
EndScript

Script JAWSBackspace()
If QuickNavKeyTrapping()
    Return
EndIf
PerformScript JAWSBackSpace()
EndScript

Script Backspace()
performScript JAWSBackspace()
EndScript

Script ControlBackSpace()
If QuickNavKeyTrapping()
    Return
EndIf
Var String sText = getPriorWord()
If sText
    SayMessage(ot_line, sText)
else
    Say(cmsgBlank1, ot_screen_message)
EndIf
TypeCurrentScriptKey()
EndScript

Script DeleteWord()
If QuickNavKeyTrapping()
    Return
EndIf
Var
    Int iSelectionCtxFlags,
    Int iStyleCtxFlag
TypeKey(ksDeleteWord) ; CtrlDel in English
pause()
PCCursor()
iSelectionCtxFlags = GetSelectionContextFlags()
iStyleCtxFlag = iSelectionCtxFlags & selCtxStyle
If iStyleCtxFlag
    ToggleSelCtxFlag(iSelectionCtxFlags, selCtxStyle) ; turn it Off temporarily.
EndIf
SayWord()
If iStyleCtxFlag
    ToggleSelCtxFlag(iSelectionCtxFlags, selCtxStyle) ; turn it back On.
EndIf
If!isSelectionModeActive()
&& IsExtendedSelectionModeWatchActive()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgSelectionModeOff1_L, cMsgSilent)
    StopExtendedSelectionModeWatch()
EndIf
EndScript

Script PasteFromClipboard()
If !(GetRunningFSProducts() & product_JAWS)
    SayCurrentScriptKeyLabel()
    Return
EndIf
If QuickNavKeyTrapping()
    Return
EndIf
PerformScript PasteFromClipboard()
EndScript

Int Function ShouldUseLegacyCopyAndPasteFormat()
Var
    Int major,
    Int update,
    Int build
GetFixedProductVersion (GetAppFilePath (), major, 0, update, 0)
If major < 16
    Return True
EndIf
If major == 16
    If update < 17928
        Return True
    ElIf update == 17928
        build = StringToInt(StringSegment (GetVersionInfoString (GetAppFilePath (), cmsg283_L), ".", -1))
        If build < 20216
            Return True
        EndIf
    EndIf
EndIf
Return False
EndFunction

Script LegacyPasteFormat()
If ShouldUseLegacyCopyAndPasteFormat()
    PerformScript PasteFormat()
    Return
EndIf
SayCurrentScriptKeyLabel ()
TypeCurrentScriptKey ()
EndScript

Script LegacyCopyFormat()
If ShouldUseLegacyCopyAndPasteFormat()
    PerformScript CopyFormat()
    Return
EndIf
SayCurrentScriptKeyLabel ()
TypeCurrentScriptKey ()
EndScript

Script PasteFormat()
If IsDocumentAreaScriptException()
    Return
EndIf
If QuickNavKeyTrapping()
    ;read-only Messages have quick nav key trapping enabled,
    ;but we still want users To be able To move the Messages via the keystroke.
    If OutlookIsActive()
        SayCurrentScriptKeyLabel()
        TypeCurrentScriptKey ()
    EndIf
    Return
EndIf
TypeCurrentScriptKey ()
If WindowCategoryIsWordDocument()
    Pause()
    SayFormattedMessageWithVoice(vctx_message, ot_help, msgPasteFormat_l, msgPasteFormat_s)
EndIf
EndScript

Script CopyFormat()
If !(GetRunningFSProducts() & product_JAWS)
    SayCurrentScriptKeyLabel()
    TypeCurrentScriptKey()
    Return
EndIf
If IsDocumentAreaScriptException()
    Return
EndIf
If QuickNavKeyTrapping()
    Return
EndIf
TypeCurrentScriptKey ()
If WindowCategoryIsWordDocument()
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_help, msgCopyFormat_l, msgCopyFormat_s)
EndIf
EndScript

Script CutToClipboard()
If !(GetRunningFSProducts() & product_JAWS)
    PerformScript CutToClipboard()
    Return
EndIf
If QuickNavKeyTrapping()
    Return
EndIf
Var
    String sTheClass,
    Int iSubtype
sTheClass = c_WordFocus.WindowClass
iSubtype = GetWindowSubtypeCode(GlobalFocusWindow)
If (!GetSelectedText()
&& !(GetCharacterAttributes() & ATTRIB_HIGHLIGHT))
&& (iSubtype == wt_edit
|| iSubtype == wt_MultiLine_Edit
|| iSubtype == wt_ReadOnlyEdit
|| iSubtype == wt_PasswordEdit
|| iSubtype == wt_Upload_Edit
|| iSubtype == wt_EditCombo
|| iSubtype == wt_ListView
|| iSubtype == wt_ListViewItem
|| iSubtype == wt_TreeView
|| iSubtype == wt_TreeViewItem
|| iSubtype == wt_Static
|| sTheClass == wc_wordMainDocumentWindow)
    SayMessage(OT_ERROR, cmsgNothingSelected)
Else
    If !WillOverwriteClipboard()
        Return
    EndIf
    ClipboardTextChanged = Clipboard_Cut
    TypeKey(cksCut)
EndIf
EndScript

Script CopySelectedTextToClipboard()
If !(GetRunningFSProducts() & product_JAWS)
|| isVirtualPCCursor()
    PerformScript CopySelectedTextToClipboard()
    Return
EndIf
Var
    Handle hwnd,
    Int iSubType,
    String sTheClass
If IsSameScript()
    ; Double-clicking Control+C will open the Office Clipboard in the task pane
    TypeKey(ksCopySelectedTextToClipboard)
    If IsTextSelected()
        SayMessage(ot_help, msgCopiedToOfficeClipboard_l, msgCopiedToOfficeClipboard_s)
    else
        SayMessage(ot_help, msgOfficeClipboard_l, msgOfficeClipboard_s)
    EndIf
    Return
EndIf
hwnd=GetFocus()
iSubtype = GetWindowSubtypeCode(hwnd)
sTheClass = c_WordFocus.WindowClass
If (!GetSelectedText()
&& !(GetCharacterAttributes() & ATTRIB_HIGHLIGHT))
&& (iSubtype == wt_edit
|| iSubtype == wt_MultiLine_Edit
|| iSubtype == wt_ReadOnlyEdit
|| iSubtype == wt_PasswordEdit
|| iSubtype == wt_Upload_Edit
|| iSubtype == wt_EditCombo
|| iSubtype == wt_ListView
|| iSubtype == wt_ListViewItem
|| iSubtype == wt_TreeView
|| iSubtype == wt_TreeViewItem
|| iSubtype == wt_Static
|| sTheClass == wc_wordMainDocumentWindow)
    TypeKey(ksCopySelectedTextToClipboard)
    SayMessage(OT_ERROR, cmsgNothingSelected)
Else
    If !WillOverwriteClipboard()
        Return
    EndIf
    ClipboardTextChanged = CLIPBOARD_COPIED
    CopySelectionToClipboard()
EndIf
EndScript

Script JAWSFind()
;Activates native Find and Replace dialog For Outlook when in the message window.
;otherwise, performs default JAWSFind Function.
If OutlookIsActive()
&& !WindowCategoryIsWordDocument()
&& !isVirtualPCCursor()
&& !UserBufferIsActive()
    TypeKey(ksF4)
    Return
EndIf
performScript JAWSFind()
EndScript

Script MAGicFind()
performScript JAWSFind()
EndScript

Script GraphicsList()
SayMessage(ot_error,
    formatString(msgGraphicsListNotAvailable_l, GetCurrentScriptKeyName()),
    formatString(msgGraphicsListNotAvailable_s,     GetCurrentScriptKeyName()))
EndScript

Script TabKey()
c_WordTester.PressTabOrShiftTabCausedNewListItem = False
If c_WordFocus.windowCategory == wCat_document
    sayCurrentScriptKeyLabel()
    If OutlookIsActive()
    && IsActiveWindowProtected()
        TabInReadOnlyMessage(MOVE_FORWARD)
        Return
    EndIf
    If QuickNavKeyTrapping()
        If IsDocumentTableActive()
        && !AtLastCellInDocumentTable()
            TabKey()
        EndIf
        Return
    EndIf
    TabKey()
    If isPcCursor()
        If InList()
            c_WordTester.PressTabOrShiftTabCausedNewListItem = True
            Refresh(1)
            Pause()
            If BrailleInUse()
                BrailleRefresh()
            EndIf
            SayLine()
        EndIf
    EndIf
    Return
EndIf
PerformScript Tab()
EndScript

Script shiftTabKey()
c_WordTester.PressTabOrShiftTabCausedNewListItem = False
If c_WordFocus.windowCategory == wCat_document
    sayCurrentScriptKeyLabel()
    If OutlookIsActive()
    && IsActiveWindowProtected()
        TabInReadOnlyMessage(MOVE_BACK)
        Return
    EndIf
    If QuickNavKeyTrapping()
        If IsDocumentTableActive()
        && !AtFirstCellInDocumentTable()
            ShiftTabKey()
        EndIf
        Return
    EndIf
    shiftTabKey()
    If isPcCursor()
        If InList()
            c_WordTester.PressTabOrShiftTabCausedNewListItem = True
            Refresh(1)
            Pause()
            If BrailleInUse()
                BrailleRefresh()
            EndIf
            SayLine()
        EndIf
    EndIf
    Return
EndIf
PerformScript shiftTab()
EndScript

Script Enter()
SayCurrentScriptKeyLabel()
c_WordTester.PressEnterCausedNewListItem = False
Var Int typeCode
If c_WordFocus.windowCategory == wCat_document
    If OutlookIsActive()
        If IsHyperlinkField()
            EnterKey()
            Return
        EndIf
    EndIf
    If QuickNavKeyTrapping()
        ; Enter key has a Function in ZoomText and Fusion that was being trapped.
        If getRunningFSProducts() &(product_ZoomText | product_Fusion)
        && OutlookIsActive()
            enterKey()
        EndIf
        Return
    EndIf
    typeCode = getObjectSubtypeCode()
    If isPcCursor()
    && IsFormfield()
    && (typeCode == WT_ComboBox || typeCode == WT_Menu)
        If typeCode == wt_comboBox
            clickFormField()
        else
            TypeKey(cksAltDownArrow) ;alt+DownArrow
        EndIf
    ElIf IsHyperlinkField()
        TrackLinkNavigation(MOVE_FORWARD)
        EnterKey()
        sayLine()
    Else
        EnterKey()
        If InList()
            c_WordTester.PressEnterCausedNewListItem = True
        EndIf
    EndIf
    Return
EndIf
If c_WordFocus.InMicrosoftEditorProofingPaneIssueChecker
&& oSuggestionSplitButton && !oSuggestionSplitButton.isOffScreen
    FSUIAGetFirstChildOfElement (oSuggestionSplitButton).GetInvokePattern().Invoke()
    oSuggestionSplitButton = null()
    Return
EndIf
typeCode = getObjecttypeCode(True)
If oSuggestionSplitButton && !oSuggestionSplitButton.isOffScreen ; reset every time focus changes
&& typecode == WT_EDIT ; can be read-only, multiline or single-line
&& c_WordFocus.WindowClass == cwc_NetUIHwnd
    Var Object pattern = oSuggestionSplitButton.GetInvokePattern()
    If pattern.Invoke()
        ; must reread the spellcheck info but only If still in the read-only and Not On a button:
        delay(1)
        oSuggestionSplitButton = null() ; ensure recaching of New element
        If getObjectTypeCode(True) == typeCode Then ; spellCheck still in progress.
            performScript readMistakeAndSuggestion()
        EndIf
        Return
    EndIf
EndIf
If IsSearchDocumentDialogType()
    If c_WordFocus.WindowClass == cwc_Richedit60W
        ;For Word 2010,
        ;Text becomes selected as you enter a search term,
        ;and pressing Enter places focus On the Next Search Result button,
        ;but the first enstance of the found item is Not read automatically.
        ;So, perform ReadWordInContext when Enter is pressed after the search term is entered.
        EnterKey()
        Delay(2, True)
        Var Int IgnoreNotFoundMessage = False ;
        ; but expose the correct message:
        Var Int UseSearchStringNotFoundMessageInstead = True
        ReadWordInContext(IgnoreNotFoundMessage, UseSearchStringNotFoundMessageInstead)
    else
        ;ProcessNewTextEvent reads the word in context,
        ;so that the context is Not read before the document is updated.
        EnterKey()
    EndIf
    Return
EndIf
EnterKey()
EndScript

Script VirtualEnter()
If UserBufferIsActive()
|| isVirtualPCCursor()
    sayCurrentScriptKeyLabel()
    builtin::EnterKey()
EndIf
EndScript

Script ControlEnter()
PerformScript ControlEnter()
If WindowCategoryIsWordDocument()
&& !IsWordDocumentActive()
    SayLine()
EndIf
EndScript

Script NextDocumentWindow()
If WindowCategoryIsWordDocument()
&& InTable()
    TypeKey(cksControlTab)
    SayHorizontalPosition()
    Return
EndIf
PerformScript NextDocumentWindow()
EndScript

Script PreviousDocumentWindow()
If WindowCategoryIsWordDocument()
&& InTable()
    TypeKey(cksControlShiftTab)
    SayHorizontalPosition()
    Return
EndIf
PerformScript PreviousDocumentWindow()
EndScript

String Function GetActiveCursorName()
;Overwritten here To Handle the case For where the document is in Web view.
If StringContains(GetActiveCursorName(), CURSOR_FSDOM_EDIT)
    If IsPCCursor()
        Return cmsgPCCursorActive
    EndIf
EndIf
Return GetActiveCursorName()
EndFunction

Script PCCursor()
; must overwrite here so that JAWS does Not announce virtual cursor is active when quick keys are turned On.
Var Int bTurnOffFormsMode =
    IsFormsModeActive()
    && !IsJAWSCursor()
    && !IsInvisibleCursor()
    && !IsTouchCursor()
If IsObjectNavigationActive()
    If IsSameScript()
        ExitTouchNavigation()
    else
        BeginFlashMessage()
        sayMessage(OT_Status, cmsgTouchCursor_L, cmsgTouchCursor_L)
        If ShouldItemSpeak(ot_tutor)
            ;tutor Messages are normally Off For braile,
            ;but we want To make sure this is shown in braille:
            Say(cmsgTouchCursorDeactivateTutorMessage, ot_status)
        EndIf
        EndFlashMessage()
        Return
    EndIf
EndIf
ResetSynth()
PCCursor()
If QuickNavKeyTrapping()
&& WindowCategoryIsWordDocument()
&& !IsEmailMessage()
    SayFormattedMessage(ot_status, cmsg9_L, cmsg9_S) ; "PC Cursor"
    If BrailleInUse()
        RouteBrailleToPC()
        BrailleRefresh()
    EndIf
    Return
EndIf
If bTurnOffFormsMode
|| IsVirtualPCCursor()
    TurnOffFormsMode()
EndIf
If BrailleInUse()
    RouteBrailleToPC()
    BrailleRefresh()
EndIf
If IsVirtualPCCursor()
    SayFormattedMessage(ot_status, cMSG288_L, cMSG288_S) ; virtual pc cursor
else
    SayFormattedMessage(ot_status, cmsg9_L, cmsg9_S) ; "PC Cursor"
EndIf
EndScript

Script SayActiveCursor()
If !isPCCursor()
|| IsVirtualPcCursor()
|| !WindowCategoryIsWordDocument()
|| IsObjectNavigationActive()
    PerformScript SayActiveCursor()
    Return
EndIf
If GetActiveDocumentViewName() == msgWeb
    performScript SayActiveCursor()
    Return
EndIf
Var
    String sCursorPos,
    String sMsg_L,
    String sMsg_S
sCursorPos = GetCursorPosString(GetActiveCursor(), getDesiredUnitsOfMeasure())
If IsWordDocumentActive()
    sCursorPos = StringReplaceSubStrings(sCursorPos, sc_minus, cscSpace)
EndIf
sMsg_L = GetActiveCursorName()+cscBufferNewLine
    +sCursorPos+cscBufferNewLine
sMsg_S = sMsg_L
If !IsPCCursor()
    sMsg_L = sMsg_L+cmsg317_l
    sMsg_S = sMsg_S+cmsg317_s
EndIf
If quickNavState()
&& QuickNavKeyTrapping()
    sMsg_L = sMsg_L+cscBufferNewLine+cmsgNavigationModeOn_l
    sMsg_S = sMsg_S+cscBufferNewLine+cmsgNavigationModeOn_l
EndIf
sayMessage(ot_user_requested_information, sMsg_L, sMsg_S)
EndScript

Script SayTopLineOfWindow()
If WindowCategoryIsWordDocument()
&& IsPCCursor()
    SaveCursor()
    InvisibleCursor()
    RouteInvisibleToPC()
    JAWSPageUp()
    Say(GetWindowName(GetRealWindow(GetCurrentWindow())), ot_user_requested_information)
    RestoreCursor()
    Return
EndIf
performScript SayTopLineOfWindow()
EndScript

Script ReadOutlookHeader(Int iField)
If InHJDialog()
&& globalRealWindowName==cWn16 Then ; Heading List
    SayCurrentScriptKeyLabel()
    TypeKey(GetCurrentScriptKeyName())
    Return
EndIf
TypeKey(GetCurrentScriptKeyName())
EndScript

Script EMailHeader3Control()
TypeKey(ksEmailHeader3) ; Alt3 in English
EndScript

Script EMailHeader4Control()
TypeKey(ksEmailHeader4) ; Alt4 in English
EndScript

Script selectionByUnitMode()
If WindowCategoryIsWordDocument()
    ExtendedSelectionByUnitScriptRunEvent() ;this must run before the key is pressed
    TypeKey(ksSelectionByUnitMode) ; F8 in English
    pause()
    If IsExtendedSelectionModeWatchActive()
        saySelectedUnit()
        UpdateExtendedSelectionModeWatch()
        If !IsEntireDocumentSelected()
            sayWindow(getFocus(), read_highlighted)
        EndIf
    else
        If isSelectionModeActive()
            SayFormattedMessageWithVoice(vctx_message, ot_status, msgSelectionModeOn1_L, cmsgSilent)
            InitExtendedSelectionModeWatch()
        EndIf
    EndIf
else
    TypeKey(ksSelectionByUnitMode) ; F8 in English
    SayCurrentScriptKeyLabel()
EndIf
EndScript

Script reduceSelectionUnit()
If WindowCategoryIsWordDocument()
    ExtendedSelectionByUnitScriptRunEvent() ;this must run before the key is pressed
    TypeKey(ksReduceSelectionUnit) ; ShiftF8 in english
    pause()
    If IsExtendedSelectionModeWatchActive()
        saySelectedUnit()
        UpdateExtendedSelectionModeWatch()
        say(getSelectedText(), OT_LINE)
    else
        If isSelectionModeActive()
            SayFormattedMessageWithVoice(vctx_message, ot_status, msgSelectionModeOn1_L, cmsgSilent)
            InitExtendedSelectionModeWatch()
        EndIf
    EndIf
else
    TypeKey(ksSelectionByUnitMode) ; F8 in English
    SayCurrentScriptKeyLabel()
EndIf
EndScript

Script selectionByMovementMode()
If WindowCategoryIsWordDocument()
&& !IsExtendedSelectionModeWatchActive()
    If isVirtualPcCursor() ; Outlook virtualized message:
        sayMessage(OT_ERROR, msgExtendedSelectionNotAvailableVirtualizedMessages)
        Return
    EndIf
    TypeKey(ksSelectionByMovementMode) ; CtrlShiftF8 in English
    pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status, msgSelectionModeOn1_L, cmsgSilent)
    InitExtendedSelectionModeWatch()
    Return
EndIf
TypeCurrentScriptKey()
SayCurrentScriptKeyLabel()
EndScript

; When unselecting text in Microsoft Word, JAWS will only speak the
; unselected text If the unselection was caused by a builtin unselection
; Script Function. This is because when selected text is deleted, JAWS is
; informed of the deletion in the same way as of an unselection and
; there is no need To speak the text being deleted.
; Selection/unselection of all units other than paragraphs was already
; handled by internal functions, now paragraphs are as well.
; (There really is no need For SelectParagraph To be handled by an
; internal Function since text selection in Word is spoken
; unconditionally, but the symetry of having both functions is compelling.)

Script SaySelectedText()
Var
    Handle hFocus = GetFocus(),
    Int bSpell,
    Int i = 20,
    String sStartSelected,
    String sEndSelected,
    String sSelectedText = GetSelectedText(),
    Int iSelectedTextLength = StringLength(sSelectedText)
If c_WordFocus.windowCategory(hFocus) == WCAT_DOCUMENT
    bSpell =(IsSameScript() && GetRunningFSProducts() != product_MAGic)
    If iSelectedTextLength >= 1000
    && !bSpell
        While SubString(sSelectedText, i, 1) != cScSpace
            i = i + 1
        EndWhile
        sStartSelected = StringLeft(sSelectedText, i)
        i = 20
        While SubString(sSelectedText, iSelectedTextLength - i, 1) != cScSpace
            i = i + 1
        EndWhile
        sEndSelected = StringRight(sSelectedText, i)
        SayFormattedMessage(OT_USER_REQUESTED_INFORMATION, FormatString(msgSelectedHugeAmountOfText, IntToString(iSelectedTextLength), sStartSelected, sEndSelected))
        Return
    EndIf
EndIf
PerformScript SaySelectedText()
EndScript

Int Function ShouldSetQuickNavModeTo2()
If IsVirtualPCCursor() Return False EndIf
Return IsPCCursor()
    && !InHJDialog()
EndFunction

Script SayAll()
If ShouldSetQuickNavModeTo2()
    If !WindowCategoryIsWordDocument()
        If c_WordFocus.ObjectSubType == wt_multiLine_edit
        || c_WordFocus.WindowSubtype == wt_multiline_edit
            performScript SayAll() ; default
        else
            SayLine()
        EndIf
        Return
    EndIf
    If isMAGicRunning()
    && getJCFOption(OPT_HIGHLIGHT_STYLE )>0 Then
        If QuickNavKeyTrapping() Then
            SaveCurrentQuickKeyNavigationMode()
            setJCFOption(opt_quick_key_navigation_Mode, 2) ; On by default
            SetQuickKeyNavigationState(0)
        EndIf
        performScript SayAll() ; default
        Return
    EndIf
    If IsActiveDocumentProtectedForm()
        sayMessage(ot_error, msgErrorSayAllProtectedForm_l, msgErrorSayAllProtectedForm_s)
        Return
    EndIf
    setJCFOption(opt_quick_key_navigation_Mode, 2) ; On by default
EndIf
If ShouldSetQuickNavModeTo2()
    SaveCurrentQuickKeyNavigationMode()
    setJCFOption(opt_quick_key_navigation_Mode, 2) ; On by default
EndIf   ; end of user buffer and HJDialog
performscript SayAll()
SetQuickKeyNavigationState(1)
EndScript

Script SayAllFromLocation()
If !WindowCategoryIsWordDocument()
    If c_WordFocus.ObjectSubType == wt_multiLine_edit
    || c_WordFocus.WindowSubtype == wt_multiline_edit
        performScript SayAllFromLocation() ; default
    else
        SayLine(True)
    EndIf
    Return
EndIf
If isMAGicRunning()
&& getJCFOption(OPT_HIGHLIGHT_STYLE )>0 Then
    If QuickNavKeyTrapping() Then
        SaveCurrentQuickKeyNavigationMode()
        setJCFOption(opt_quick_key_navigation_Mode, 2) ; On by default
        SetQuickKeyNavigationState(0)
    EndIf
    performScript SayAllFromLocation() ; default
    Return
EndIf
If IsActiveDocumentProtectedForm()
    processMessage(msgErrorSayAllProtectedForm_l, msgErrorSayAllProtectedForm_s, ot_error, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
SaveCurrentQuickKeyNavigationMode()
setJCFOption(opt_quick_key_navigation_Mode, 2) ; On by default
performScript SayAllFromLocation()
SetQuickKeyNavigationState(1)
EndScript

Script MarkPlace()
If c_WordFocus.windowCategory != WCAT_DOCUMENT
|| !isPCCursor()
|| isVirtualPCCursor()
|| UserBufferIsActive()
|| OutlookIsActive()
    Return
EndIf
Var
    Int bIsTextSelected,
    Int iMarkedPlace,
    Int iCurCharPos
bIsTextSelected = IsTextSelected()
If !bIsTextSelected
&& atStartOfDocument()
    ProcessMessage(msgMarkedPlaceBeginningOfDocumentError_L, msgMarkedPlaceBeginningOfDocumentError_S, OT_ERROR, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
If !InDocumentMainText()
    ProcessMessage(msgMarkedPlaceSaveStoryError_l, msgMarkedPlaceSaveStoryError_l, OT_ERROR, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
If !WasDocumentEverSaved()
    ProcessMessage(msgMarkedPlaceSaveDocError_l, msgMarkedPlaceSaveDocError_s, OT_ERROR, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
If IsActiveDocumentProtectedForm()
|| IsActiveDocumentProtected()
    ProcessMessage(msgProtectedDocOrFormMarkingPlaceError_l, msgProtectedDocOrFormMarkingPlaceError_s, OT_ERROR, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
If bIsTextSelected
    ProcessMessage(msgSelectedTextMarkingPlaceError_l, msgSelectedTextMarkingPlaceError_l, OT_ERROR, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
iMarkedPlace = GetCurrentDocumentMarkedPlace()
iCurCharPos = GetCurCharPos()
If iMarkedPlace == iCurCharPos
    ProcessMessage(msgPlaceAlreadyMarked, null(), OT_ERROR, msgError, MB_OK|MB_ICONERROR)
    Return
EndIf
setCurrentDocumentMarkedPlace(iCurCharPos)
processMessage(msgMarkingPlace, null(), ot_help, cscNull, MB_OK|MB_ICONINFORMATION)
EndScript

Script ReturnToMarkedPlace()
If c_WordFocus.windowCategory != WCAT_DOCUMENT
|| !isPCCursor()
|| isVirtualPCCursor()
|| UserBufferIsActive()
|| OutlookIsActive()
    Return
EndIf
Var
    Int iMarkedPlace
;If place is already marked, Return To it.
;Otherwise, beep and say error message.
iMarkedPlace = GetCurrentDocumentMarkedPlace()
If iMarkedPlace
    If iMarkedPlace == GetCurCharPos()
        processMessage(msgAlreadyAtMarkedPlace_l, msgAlreadyAtMarkedPlace_s, OT_ERROR, msgError, MB_OK|MB_ICONERROR)
        Return
    EndIf
    If TotalDocumentCharCount() < iMarkedPlace
        processMessage(msgMarkedPlaceNotValidError_l, msgMarkedPlaceNotValidError_s, OT_ERROR, msgError, MB_OK|MB_ICONERROR)
        Return
    EndIf
    If ReturnToMarkedPlace(iMarkedPlace)
        sayUsingVoice(vctx_message, msgReturningToMarkedPlace, ot_help)
        scheduleBrailleFlashMessageWithSpeechOutput(OT_Help, msgReturningToMarkedPlace)
        If inTable()
            SayCell()
            Return
        EndIf
        SayWordAtMarkedPlace()
    EndIf
else
    beep()
    SayMessage(OT_ERROR, msgMarkedPlaceError_l, msgMarkedPlaceError_s)
EndIf
EndScript

Script SelectTextBetweenMarkedPlaceAndCurrentPosition()
If IsVirtualPCCursor()
|| OutlookIsActive()
    ;These should be handled by default:
    PerformScript SelectTextBetweenMarkedPlaceAndCurrentPosition()
    Return
EndIf
If c_WordFocus.windowCategory != WCAT_DOCUMENT
|| !isPCCursor()
|| UserBufferIsActive()
    Return
EndIf
;Now we are handling the Word document:
Var Int iMarkedPlace = GetCurrentDocumentMarkedPlace()
If !iMarkedPlace
    sayMessage(ot_error, FormatString(msgMarkedPlaceSelectingTextError_l), FormatString(msgMarkedPlaceSelectingTextError_s))
    Return
EndIf
If SelectTextBetweenMarkedPlaceAndPos(iMarkedPlace, GetCurCharPos())
    SayMessage(ot_status, msgMarkedPlaceSelectingText)
EndIf
EndScript

Script DefineATempPlaceMarker()
If IsVirtualPcCursor()
|| OutlookIsActive()
    performScript DefineATempPlaceMarker()
else
    PerformScript MarkPlace()
EndIf
EndScript

Script ShowMathViewer()
ShowMathViewerHelper(MathViewerRequestor_MSWord)
EndScript

Script ShowMathEditor()
Var String requestor = MathEditorRequestor_Default;
If (isOffice365())
    requestor = MathEditorRequestor_MSWord;
EndIf
ShowMathEditorHelper(requestor);
EndScript

Script DescribeTextAnnotationOrAttributes()
DescribeTextAnnotationOrAttributes(True)
EndScript

Int Function IsAutoCorrectExceptionCharacter(Int charValue)
Return charValue == AutocorrectApostrophe
    || charValue == AutocorrectLeftQuote
    || charValue == AutocorrectRightQuote
EndFunction

Script sayCharacter()
If handleNoCurrentWindow()
    Return
EndIf
If !isPCCursor()
|| UserBufferIsActive()
    performScript sayCharacter()
    Return
EndIf
If WindowCategoryIsWordDocument()
    If IsFormField()
    && c_WordFocus.ObjectSubType == wt_checkbox
        self::SayObjectTypeAndText()
        Return
    EndIf
ElIf InMultilevelListPane()
    IndicateControlType(wt_grid, GetWord2003MultiLevelListObjectNameOfFocusObject(), cscNull)
    Return
EndIf
performScript sayCharacter()
EndScript

Script sayNextCharacter()
If !IsPcCursor()
|| IsVirtualPCCursor()
|| UserBufferIsActive()
|| InHJDialog()
|| (DialogActive() && OutlookIsActive())
    PerformScript SayNextCharacter()
    Return
EndIf
If WindowCategoryIsWordDocument()
    If IsExtendedSelectionModeWatchActive()
        nSaySelectAfter = True
        SelectingText(True)
        SelectNextCharacter()
        SelectingText(False)
        nSaySelectAfter = False
        Return
    EndIf
    SetDocumentCaretMovementType(Unit_Char_Next)
    nextCharacter()
    If IsLeftButtonDown()
    || IsRightButtonDown()
        SelectingText(True)
        pause()
        SelectingText(False)
        Return
    EndIf
    If !SupportsEditCallbacks()
    && IsWordDocumentActive()
        ; Not all MSWord instances will support edit callbacks.
        ; When run as part of the Enterprise Express Editor, used by Lighthouse Houston, events are blocked by their addin.
        ; In this case we must force legacy behaviour and speak here.
        CaretMovedEvent(Unit_CHAR_Next)
    EndIf
    Return
EndIf
Var
    Int iType,
    String sClass,
    String sObjName,
    Handle hwnd
hwnd = GetFocus()
sClass = c_WordFocus.WindowClass
sObjName = GetObjectName()
iType = c_WordFocus.WindowSubtype
If !iType
    iType = c_WordFocus.ObjectSubType
EndIf
If InTaskPaneDialog()
&& (iType == wt_edit
|| iType == wt_EditCombo
|| sClass == cwc_RichEdit20W)
    NextCharacter()
    SayCharacter()
ElIf sObjName == scUnderlineStyle
&& sClass != wc_MsoCommandBar
    NextLine()
    SayMessage(ot_highlighted_screen_text, GetObjectName(SOURCE_CACHED_DATA))
ElIf sClass == wc_msoCommandBar
    NextCharacter()
ElIf iType == wt_tabControl
    NextCharacter()
;ensure that extended ASCII and Unicode characters are announced as they gain focus.
ElIf globalRealWindowName == wn_symbol
&& c_WordFocus.ObjectSubType == wt_bitmap
    nextCharacter()
    sayCharacter()
else
    performScript sayNextCharacter() ; default
EndIf
EndScript

Script sayPriorCharacter()
If !IsPcCursor()
|| IsVirtualPCCursor()
|| UserBufferIsActive()
|| InHJDialog()
|| (DialogActive() && OutlookIsActive())
    PerformScript SayPriorCharacter()
    Return
EndIf
If WindowCategoryIsWordDocument()
    If IsExtendedSelectionModeWatchActive()
        nSaySelectAfter = True
        SelectingText(True)
        SelectPriorCharacter()
        SelectingText(False)
        nSaySelectAfter = False
        Return
    EndIf
    SetDocumentCaretMovementType(Unit_Char_Prior)
    priorCharacter()
    If IsLeftButtonDown()
    || IsRightButtonDown()
     SelectingText(True)
     pause()
     SelectingText(False)
     Return
    EndIf
    If !SupportsEditCallbacks()
    && IsWordDocumentActive()
        ; Not all MSWord instances will support edit callbacks.
        ; When run as part of the Enterprise Express Editor, used by Lighthouse Houston, events are blocked by their addin.
        ; In this case we must force legacy behaviour and speak here.
        CaretMovedEvent(Unit_Char_Prior)
    EndIf
    Return
EndIf
Var
    Int iType,
    String sClass,
    String sObjName,
    Handle hwnd
hwnd = GetFocus()
sClass = c_WordFocus.WindowClass
sObjName = GetObjectName()
iType = c_WordFocus.WindowSubtype
If !iType
    iType = c_WordFocus.ObjectSubType
EndIf
If InTaskPaneDialog()
&&(iType == wt_edit
|| iType == wt_EditCombo
|| sClass == cwc_RichEdit20W)
    PriorCharacter()
    SayCharacter()
ElIf sObjName == scUnderlineStyle
&& sClass != wc_MsoCommandBar
    PriorLine()
    SayMessage(ot_highlighted_screen_text, GetObjectName(SOURCE_CACHED_DATA))
ElIf sClass == wc_msoCommandBar
    PriorCharacter()
ElIf iType == wt_tabControl
    PriorCharacter()
;ensure that extended ASCII and Unicode characters are announced as they gain focus.
ElIf globalRealWindowName == wn_symbol
&& c_WordFocus.ObjectSubType == wt_bitmap
    PriorCharacter()
    sayCharacter()
else
    performScript sayPriorCharacter() ;default
EndIf
EndScript

Void Function SayWordUnit(Int UnitMovement)
If SayCursorMovementException(unitMovement)
    SayWordUnit(UnitMovement)
    Return
EndIf
If InTaskPaneDialog()
&& GetObjectTypeCode() != wt_edit
    Return
EndIf
If c_WordFocus.WindowClass == cwc_RichEdit20W
    ;Using SayWord On this class will cause the dialog title and entire edit field To be spoken,
    ;So we Use GetWord instead:
    Say(GetWord(), ot_word, True)
    Return
EndIf
SayWordUnit(UnitMovement)
EndFunction

Script sayWord()
If handleNoCurrentWindow()
    Return
EndIf
If !IsPCCursor()
|| UserBufferIsActive()
    PerformScript sayWord()
    Return
EndIf
If WindowCategoryIsWordDocument()
    If IsFormField()
    && c_WordFocus.ObjectSubType == wt_checkbox
        self::SayObjectTypeAndText()
        Return
    EndIf
ElIf InMultilevelListPane()
    IndicateControlType(wt_grid, GetWord2003MultiLevelListObjectNameOfFocusObject(), cscNull)
    Return
EndIf
PerformScript sayWord()
EndScript

Script sayNextWord()
Var String sClass = c_WordFocus.WindowClass
If getMenuMode() == 2
&& !userBufferIsActive()
&& (sClass == wc_wwg || sClass == wc_wwn)
    ;escape from menus such as Smart Tag For paste:
    typeKey(cksEscape)
EndIf
If UserBufferIsActive()
|| IsVirtualPCCursor()
|| InHJDialog()
|| !IsPcCursor()
|| sClass==wc_wwn
|| sClass == wc_wwo
    PerformScript SayNextWord()
    Return
EndIf
If WindowCategoryIsWordDocument()
    If IsExtendedSelectionModeWatchActive()
        nSaySelectAfter = True
        SelectingText(True)
        SelectNextWord()
        SelectingText(False)
        nSaySelectAfter = False
        Return
    EndIf
    SetDocumentCaretMovementType(Unit_Word_Next)
    nextWord()
    If IsLeftButtonDown()
    || IsRightButtonDown()
     SelectingText(True)
     pause()
     SelectingText(False)
     Return
    EndIf
    If !SupportsEditCallbacks()
        ; Not all MSWord instances will support edit callbacks.
        ; When run as part of the Enterprise Express Editor, used by Lighthouse Houston, events are blocked by their addin.
        ; In this case we must force legacy behaviour and speak here.
        CaretMovedEvent(Unit_Word_Next)
    EndIf
    Return
EndIf
performScript sayNextWord()
EndScript

Script sayPriorWord()
Var String sClass = c_WordFocus.WindowClass
If getMenuMode() == 2
&& !userBufferIsActive()
&& (sClass == wc_wwg || sClass == wc_wwn)
    ;escape from menus such as Smart Tag For paste:
    typeKey(cksEscape)
EndIf
If UserBufferIsActive()
|| IsVirtualPCCursor()
|| !IsPcCursor()
|| InHJDialog()
|| sClass==wc_wwn
|| sClass == wc_wwo
    PerformScript SayPriorWord()
    Return
EndIf
If WindowCategoryIsWordDocument()
    If IsExtendedSelectionModeWatchActive()
        nSaySelectAfter = True
        SelectingText(True)
        SelectPriorWord()
        SelectingText(False)
        nSaySelectAfter = False
        Return
    EndIf
    SetDocumentCaretMovementType(Unit_Word_Prior)
    priorWord()
    If IsLeftButtonDown()
    || IsRightButtonDown()
     SelectingText(True)
     pause()
     SelectingText(False)
     Return
    EndIf
    If !SupportsEditCallbacks()
        ; Not all MSWord instances will support edit callbacks.
        ; When run as part of the Enterprise Express Editor, used by Lighthouse Houston, events are blocked by their addin.
        ; In this case we must force legacy behaviour and speak here.
        CaretMovedEvent(Unit_Word_Prior)
    EndIf
    Return
EndIf
performScript sayPriorWord()
EndScript

Script JAWSHome()
If InHJDialog()
    performScript JAWSHome() ; default
    Return
EndIf
If WindowCategoryIsWordDocument()
    SayCurrentScriptKeyLabel()
    If IsExtendedSelectionModeWatchActive()
        nSaySelectAfter     = True
        SelectingText(True)
        SelectFromStartOfLine()
        SelectingText(False)
        nSaySelectAfter     = False
        Return
    EndIf
    SetDocumentCaretMovementType(Unit_Line_Start)
    JAWSHome()
    If IsLeftButtonDown()
    || IsRightButtonDown()
     SelectingText(True)
     pause()
     SelectingText(False)
     Return
    EndIf
    If !SupportsEditCallbacks()
        ; Not all MSWord instances will support edit callbacks.
        ; When run as part of the Enterprise Express Editor, used by Lighthouse Houston, events are blocked by their addin.
        ; In this case we must force legacy behaviour and speak here.
        CaretMovedEvent(Unit_Line_Start)
    EndIf
    Return
EndIf
performScript JAWSHome() ; default
EndScript

Script Home()
performScript JAWSHome()
EndScript

Script JAWSEnd()
If InHJDialog()
    performScript JAWSEnd() ; default
    Return
EndIf
If WindowCategoryIsWordDocument()
    SayCurrentScriptKeyLabel()
    If IsExtendedSelectionModeWatchActive()
        nSaySelectAfter = True
        SelectingText(True)
        SelectToEndOfLine()
        SelectingText(False)
        nSaySelectAfter = False
        Return
    EndIf
    SetDocumentCaretMovementType(Unit_Line_End)
    JAWSEnd()
    If IsLeftButtonDown()
    || IsRightButtonDown()
     SelectingText(True)
     pause()
     SelectingText(False)
     Return
    EndIf
    If !SupportsEditCallbacks()
        ; Not all MSWord instances will support edit callbacks.
        ; When run as part of the Enterprise Express Editor, used by Lighthouse Houston, events are blocked by their addin.
        ; In this case we must force legacy behaviour and speak here.
        CaretMovedEvent(Unit_Line_End)
    EndIf
    Return
EndIf
performScript JAWSEnd() ;default
EndScript

Script end()
performScript JAWSEnd()
EndScript

Void Function SayLineUnit(Int UnitMovement, optional Int bMoved)
If InEmptyCopilotEditWithSuggestions()
    Return
EndIf

If c_WordFocus.ObjectSubType == WT_EDIT_SPINBOX
&& IsPCCursor()
&& RibbonsActive()
    ;ValueChangedEvent speaks the change:
    Return
EndIf
SayLineUnit(UnitMovement, bMoved)
EndFunction

Script SayLine()
If handleNoCurrentWindow()
    Return
EndIf
Var Int inMenus = menusActive()
If !isPcCursor()
|| UserBufferIsActive()
|| inMenus
    performScript sayLine()
    Return
EndIf
If !isVirtualPCCursor()
&& WindowCategoryIsWordDocument()
    If isSameScript()
        SpellLine()
    Else
        SetDocumentReadingStartLocation()
        indicateInconsistenciesInRange(CheckLine)
        ResetSpeechMarkupAttributes()
        self::SayLine()
    EndIf
    Return
EndIf
If InMultilevelListPane()
    IndicateControlType(wt_grid, GetWord2003MultiLevelListObjectNameOfFocusObject(), cscNull)
    Say(PositionInGroup(), ot_position)
    Return
EndIf
If GetObjectName(SOURCE_CACHED_DATA, 1) == wn_SearchResultsList
    Say(GetObjectDescription (), OT_LINE)
EndIf
Var Int iType = GetObjectSubTypeCode(SOURCE_CACHED_DATA)
If iType == WT_STATIC
&& ReadMicrosoftEditorIssueCheckerInfo(False, False)
    Return
ElIf iType == WT_SPLITBUTTON
&& ReadMicrosoftEditorSuggestion()
    Return
EndIf
PerformScript SayLine()
EndScript

Script sayNextLine()
If !IsPcCursor()
|| isVirtualPCCursor()
|| UserBufferIsActive()
|| InHJDialog()
    PerformScript SayNextLine()
    Return
EndIf
If c_WordFocus.ObjectSubType == WT_EDIT_SPINBOX
    NextLine()
    Return SayLineUnit(UnitMove_Next)
EndIf
If WindowCategoryIsWordDocument()
    If IsExtendedSelectionModeWatchActive()
        nSaySelectAfter = True
        SelectingText(True)
        SelectNextLine()
        SelectingText(False)
        nSaySelectAfter = False
        Return
    EndIf
    SetDocumentCaretMovementType(Unit_Line_Next)
    nextLine()
    If !SupportsEditCallbacks()
    && IsWordDocumentActive()
        ; Not all MSWord instances will support edit callbacks.
        ; When run as part of the Enterprise Express Editor, used by Lighthouse Houston, events are blocked by their addin.
        ; In this case we must force legacy behaviour and speak here in the WordClassic Scripts.
        ; However, Office365 we need To Use SayLine as CaretMovedEvent is intermittent.
        ; CaretMovedEvent needs To be silent in this case To avoid doubling On line navigation.
        ;CaretMovedEvent(Unit_Line_Next)
        ;Must be scheduled in order To prevent speaking the wrong line.
        ; The final parameter To scheduleFunction kills the timer On key press and On event.
        scheduleFunction("sayLine", 1, True)
    EndIf
    Return
EndIf
;ensure that extended ASCII and Unicode characters are announced as they gain focus.
If globalRealWindowName == wn_symbol
&& c_WordFocus.ObjectSubType == wt_bitmap
    NextLine()
    sayCharacter()
    Return
EndIf
performScript sayNextLine() ; default
EndScript

Script sayPriorLine()
If !IsPcCursor()
|| isVirtualPCCursor()
|| UserBufferIsActive()
|| InHJDialog()
    PerformScript SayPriorLine()
    Return
EndIf
If c_WordFocus.ObjectSubType == WT_EDIT_SPINBOX
    PriorLine()
    Return SayLineUnit(UnitMove_Prior)
EndIf
If WindowCategoryIsWordDocument()
    If IsExtendedSelectionModeWatchActive()
        nSaySelectAfter = True
        SelectingText(True)
        SelectPriorLine()
        SelectingText(False)
        nSaySelectAfter = False
        Return
    EndIf
    SetDocumentCaretMovementType(Unit_Line_Prior)
    PriorLine()
    If !SupportsEditCallbacks()
    && IsWordDocumentActive()
        ; Not all MSWord instances will support edit callbacks.
        ; When run as part of the Enterprise Express Editor, used by Lighthouse Houston, events are blocked by their addin.
        ; In this case we must force legacy behaviour and speak here in the WordClassic Scripts.
        ; However, Office365 we need To Use SayLine as CaretMovedEvent is intermittent.
        ; CaretMovedEvent needs To be silent in this case To avoid doubling On line navigation.
        ;CaretMovedEvent(Unit_Line_Next)
        ;Must be scheduled in order To prevent speaking the wrong line.
        ; The final parameter To scheduleFunction kills the timer On key press and On event.
        scheduleFunction("sayLine", 1, True)
        ;CaretMovedEvent(Unit_Line_Prior)
    EndIf
    Return
EndIf
;ensure that extended ASCII and Unicode characters are announced as they gain focus.
If globalRealWindowName == wn_symbol
&& c_WordFocus.ObjectSubType == wt_bitmap
    PriorLine()
    sayCharacter()
    Return
EndIf
performScript sayPriorLine() ; default
EndScript

Int Function getControlGroupsForSpellCheckerWithSplitButtons(Object UIA, Object treewalker,
    Object byRef notInDictionaryGroup, Object byRef suggestionsGroup, Object byRef otherActionsGroup)
If !UIA || !treewalker Return False EndIf
Var Int scope = TREESCOPE_DESCENDANTS
Var Object splitButtonCondition = UIA.CreateIntPropertyCondition(UIA_ControlTypePropertyId, UIA_SplitButtonControlTypeId)
Var Object buttonCondition = UIA.CreateIntPropertyCondition(UIA_ControlTypePropertyId, UIA_ButtonControlTypeId)
If !splitButtonCondition || !ButtonCondition Return False EndIf
If !treewalker.gotoParent() || treewalker.currentElement.controlType != UIA_GroupControlTypeId Return False EndIf
; notInDictionaryGroup contains the current sentence read-only edit and the Read Current Sentence buttons:
While treewalker.currentElement.controlType == UIA_GroupControlTypeId
&& !stringContains(treewalker.currentElement.name, wn_Proofing_Pane_Grammar)
&& !stringContains(treewalker.currentElement.name, wn_Proofing_Pane_Spelling)
&& treeWalker.goToPriorSibling()
EndWhile
If treewalker.currentElement.controlType != UIA_GroupControlTypeId
|| (!stringContains(treewalker.currentElement.name, wn_Proofing_Pane_Grammar)
&& !stringContains(treewalker.currentElement.name, wn_Proofing_Pane_Spelling))
    Return False
EndIf
notInDictionaryGroup = treewalker.currentElement.buildUpdatedCache()
; suggestionsGroup contains the split buttons where each suggestion is its own split button
If !treewalker.gotoNextSibling() Return False EndIf
; where "No suggestions" are found:
Var Object tmp = treeWalker.currentElement.findAll(TREESCOPE_Children, UIA.CreateRawViewCondition())
If tmp.count == 1
&& tmp(0).ClassName == "NetUIGroupHeader"
    suggestionsGroup = treewalker.CurrentElement
EndIf
While !suggestionsGroup
&& treewalker.currentElement.controlType == UIA_GroupControlTypeId
&& !treewalker.currentElement.findFirst(scope, splitButtonCondition)
&& treewalker.gotoNextSibling()
EndWhile
If treewalker.currentElement.controlType != UIA_GroupControlTypeId Return False EndIf
suggestionsGroup = treewalker.CurrentElement.buildUpdatedCache()
; other actions group is all buttons
If !treewalker.gotoNextSibling() Return False EndIf
While treewalker.currentElement.controlType == UIA_GroupControlTypeId
&& !treewalker.currentElement.findFirst(scope, buttonCondition)
&& treewalker.gotoNextSibling()
EndWhile
If treewalker.currentElement.controlType != UIA_GroupControlTypeId Return False EndIf
otherActionsGroup = treewalker.CurrentElement.buildUpdatedCache()
Return True
EndFunction

Int Function SpellProofingPaneSuggestionSplitButton()
If SayCursorMovementException(UnitMove_CURRENT) Then Return False EndIf
If !c_WordFocus.InProofingPaneSpellCheck Return False EndIf
Var Object element = FSUIAGetFocusedElement() ; focus On the split button and Not the pane:
If !element || element.controlType != UIA_SplitButtonControlTypeId Return False EndIf
; Microsoft separates the suggestion from the reference information with a comma.
; This is the same as has been done For a While in ReadProofingPaneWithSplitButtons Function.
Var String suggestion = stringSegment(element.name, ", ", 1); separate suggestion from reference info:
If !stringIsBlank(suggestion)
    spellString(suggestion)
    Return True
else
    Return False
EndIf
EndFunction

Void Function spellWord()
If SpellProofingPaneSuggestionSplitButton() Return EndIf
Return spellWord()
EndFunction

Void Function SpellLine()
If SpellProofingPaneSuggestionSplitButton() Return EndIf
Return spellLine()
EndFunction

Script OpenListBox()
If IsPcCursor()
    If inRibbons() Then PerformScript OpenListBox() Return EndIf
    If GlobalMenuMode
    && !IsVirtualRibbonActive()
        TypeKey(cksAltDownArrow)
        Pause()
        SayFormattedMessageWithVoice(vctx_message, ot_status, cmsg41_L, cmsgSilent) ;open list box
        SayFormattedMessage(ot_text, getObjectValue()) ; only say the contents of the edit combo without the prompt
        Return
    ElIf WindowCategoryIsWordDocument()
        Var Int subtypeCode = c_WordFocus.ObjectSubType
        If IsFormField()
        && (subtypeCode == wt_comboBox
        || subtypeCode == wt_DateTime
        || subtypeCode ==wt_Menu)
            ; TypeKey being assigned To an alt combination seems To be problematic.
            ; While typeKey("alt+downArrow") should rightfully work, it seems that MSWord
            ; behaves differently when JAWS is running because even passKeyThrough doesn't
            ; work. We will Use the mouse instead.
            saveCursor()
            JAWSCursor()
            saveCursor()
            RouteJAWSToPc()
            LeftMouseButton()
            pause()
            restoreCursor() ; Restore the JAWS cursor
            restoreCursor() ; restore the original cursor.
        ElIf subtypeCode == wt_comboBox
        || subtypeCode == wt_DateTime
        || subtypeCode ==wt_Menu
            ; the case where the form field context flag is Not On.
            TypeKey(cksAltDownArrow)
        else
            PerformScript OpenListBox ()
        EndIf
        Return
    EndIf
EndIf
If c_WordFocus.InProofingPaneSpellCheck
    TypeKey(cksAltDownArrow)
    Pause()
    SayFormattedMessageWithVoice(vctx_message, ot_status, cmsg41_L, cmsgSilent) ;open list box
    Return
EndIf
PerformScript OpenListBox()
EndScript

Script CloseListBox()
If IsPcCursor()
    If inRibbons() Then PerformScript CloseListBox() Return EndIf
    If GlobalMenuMode
    && !IsVirtualRibbonActive()
        TypeKey(cksAltUpArrow)
        SayFormattedMessageWithVoice(vctx_message, ot_status, cmsg42_L, cmsgSilent) ;close list box
        Return
    ElIf WindowCategoryIsWordDocument()
        Var Int subtypeCode = c_WordFocus.ObjectSubType
        If IsFormField()
        && (subtypeCode == wt_comboBox
        || subtypeCode == wt_DateTime
        || subtypeCode ==wt_Menu)
            TypeKey(cksAltUpArrow)
        ElIf subtypeCode == wt_comboBox
        || subtypeCode == wt_DateTime
        || subtypeCode ==wt_Menu
            ; the case where the form field context flag is Not On.
            TypeKey(cksAltUpArrow)
        else
            PerformScript CloseListBox ()
        EndIf
        Return
    EndIf
EndIf
PerformScript CloseListBox()
EndScript

Script SayNextSentence()
If IsPCCursor()
&& !IsVirtualPCCursor()
    If (WindowCategoryIsWordDocument() && ActiveDocumentProtectionType() <= 0)
    || IsEmailMessage()
        SetDocumentCaretMovementType(Unit_Sentence_Next)
        NextSentence()
        Return
    EndIf
EndIf
PerformScript SayNextSentence()
EndScript

Script SayPriorSentence()
If IsPCCursor()
&& !IsVirtualPCCursor()
    If (WindowCategoryIsWordDocument() && ActiveDocumentProtectionType() <= 0)
    || IsEmailMessage()
        SetDocumentCaretMovementType(Unit_Sentence_Prior)
        PriorSentence()
        Return
    EndIf
EndIf
PerformScript SayPriorSentence()
EndScript

Script SayNextParagraph()
If SayAllInProgress()
    SetSayAllRestart()
EndIf
If quickNavKeyTrapping()
    If !WindowCategoryIsWordDocument()
        Return
    EndIf
EndIf
If isPCCursor()
&& !IsVirtualPCCursor()
    If (WindowCategoryIsWordDocument() && ActiveDocumentProtectionType() <= 0)
    || IsEmailMessage()
        If IsExtendedSelectionModeWatchActive()
            nSaySelectAfter = True
            SelectingText(True)
            typeKey(cksControlDownArrow)
            SelectingText(False)
            nSaySelectAfter = False
            Return
        EndIf
        If IncludeBlankParagraphsForParagraphNavigation()
            ;This navigation type is Not recognized by CaretMovedEvent,
            ;so add the extra parameter To SetDocumentCaretMovementType which will force the recognition of this movement:
            SetDocumentCaretMovementType(Unit_Paragraph_Next, Unit_Paragraph_Next)
            typeKey(cksControlDownArrow)
        else
            SetDocumentCaretMovementType(Unit_Paragraph_Next)
            NextParagraph()
        EndIf
        Return
    EndIf
EndIf
performScript sayNextParagraph()
EndScript

Script SayPriorParagraph()
If SayAllInProgress()
    SetSayAllRestart()
EndIf
If quickNavKeyTrapping()
    If c_WordFocus.windowCategory!= wCat_document
        Return
    EndIf
EndIf
If isPCCursor()
&& !IsVirtualPCCursor()
    If (c_WordFocus.windowCategory == wCat_document&& ActiveDocumentProtectionType() <= 0)
    || IsEmailMessage()
        If IsExtendedSelectionModeWatchActive()
            nSaySelectAfter = True
            SelectingText(True)
            typeKey(cksControlUpArrow)
            SelectingText(False)
            nSaySelectAfter = False
            Return
        EndIf
        If IncludeBlankParagraphsForParagraphNavigation()
            ;This navigation type is Not recognized by CaretMovedEvent,
            ;so add the extra parameter To SetDocumentCaretMovementType which will force the recognition of this movement:
            SetDocumentCaretMovementType(Unit_Paragraph_Prior, Unit_Paragraph_Prior)
            typeKey(cksControlUpArrow)
        else
            SetDocumentCaretMovementType(Unit_Paragraph_Prior)
            PriorParagraph()
        EndIf
        Return
    EndIf
EndIf
performScript sayPriorParagraph()
EndScript

Script NextItem()
If dialogActive()
    PerformScript NextDocumentWindowByPage()
    Return
EndIf
If !InDocument()
&& !DialogActive()
    IndicateControlType(wt_MDIClient, cscSpace, msgScrnSensitiveHelp1_s)
    Return
EndIf
If isPCCursor()
&& WindowCategoryIsWordDocument()
    If QuickNavKeyTrapping()
        SetFindItemToPage()
    EndIf
    Var String sMsg = FormatString(msgNextItem, GetFindItemTypeString())
    SayFormattedMessageWithVoice(vctx_message, ot_help, sMsg, cmsgSilent)
    If BrowserTargetIsPage()
        ;The PageSectionColumnChangedEvent Function will speak the line when the page actually changes.
        SetDocumentCaretMovementType(Unit_Page_Next)
        TypeKey(ksCtrlPageDown)
    else
        TypeKey(ksCtrlPageDown)
        delay(2, True)
        SayLine()
    EndIf
    Return
EndIf
PerformScript NextDocumentWindow()
EndScript

Script PreviousItem()
If dialogActive()
    PerformScript PreviousDocumentWindowByPage()
    Return
EndIf
If !InDocument()
&& !DialogActive()
    IndicateControlType(wt_MDIClient, cscSpace, msgScrnSensitiveHelp1_s)
    Return
EndIf
If IsPCCursor()
&& WindowCategoryIsWordDocument()
    If QuickNavKeyTrapping()
        SetFindItemToPage()
    EndIf
    Var String smsg=FormatString(msgPrevItem, GetFindItemTypeString())
    SayFormattedMessageWithVoice(vctx_message, ot_help, sMsg, cMsgSilent)
    If BrowserTargetIsPage()
        ;The PageSectionColumnChangedEvent Function will speak the line when the page actually changes.
        SetDocumentCaretMovementType(Unit_Page_Prior)
        TypeKey(ksCtrlPageUp)
    else
        TypeKey(ksCtrlPageUp)
        delay(2, True)
        SayLine()
    EndIf
    Return
EndIf
PerformScript PreviousDocumentWindow()
EndScript

Script TopOfFile()
If IsPCCursor()
&& !isVirtualPCCursor()
&& !InHJDialog()
&& WindowCategoryIsWordDocument()
&& !UserBufferIsActive()
    SetDocumentCaretMovementType(Unit_Line_First)
    JAWSTopOfFile()
    Return
EndIf
PerformScript TopOfFile()
EndScript

Script BottomOfFile()
If IsPCCursor()
&& !isVirtualPCCursor()
&& !InHJDialog()
&& WindowCategoryIsWordDocument()
&& !UserBufferIsActive()
    SetDocumentCaretMovementType(Unit_Line_Last)
    JAWSBottomOfFile()
    Return
EndIf
PerformScript BottomOfFile()
EndScript

Void Function SayWindowTitleForApplication(Handle hAppWnd, Handle hRealWnd, Handle hCurWnd, Int iTypeCode)
Var
    String sMessageShort,
    String sMessageLong,
    String sAppTitle,
    String sPaneTitle,
    String sDocView,
    Handle hWnd,
    String sClass
; Outlook already overrides this Function where it needs To, Then calls Word where it doesn't.
GetAppUIAWindowAndPaneTitles(sAppTitle, sPaneTitle)
If WindowCategoryIsWordDocument()
&& !OutlookIsActive()
    sDocView = GetActiveDocumentViewName()
    sMessageShort = FormatString(cMsg29_S, sAppTitle,
        FormatString(msgDocumentView_s, sDocView))
    sMessageLong = FormatString(cmsg29_L, sAppTitle,
        FormatString(msgDocumentView_l, sDocView))
ElIf (c_WordFocus.windowCategory!= WCAT_UNKNOWN && c_WordFocus.windowCategory!= WCAT_SPELL_CHECKER)
|| OnFileTabButton()
|| OnRibbonButton()
|| OnBackstageViewPane()
|| InNUIDialogWindow()
    If sPaneTitle
        sMessageShort = FormatString(cMsg29_S, sAppTitle, sPaneTitle)
        sMessageLong = FormatString(cmsg29_L, sAppTitle, sPaneTitle)
    EndIf
EndIf
If sMessageShort
|| sMessageLong
    SayFormattedMessage(ot_user_requested_information, sMessageLong, sMessageShort)
else
    SayWindowTitleForApplication(hAppWnd, hRealWnd, hCurWnd, iTypeCode)
EndIf
EndFunction

Script UpALevel()
If !IsWordDocumentActive()
    ;For handling active user buffer.
    ;Call down the stack, but do Not restrict the scope:
    performScript UpALevel()
    Return
EndIf
If UserBufferIsActive()
    performScript UpALevel()
    self::sayFocusedWindow()
    If QuickNavKeyTrapping()
    && c_WordFocus.WindowClass == wc_WordMainDocumentWindow
        SetQuickKeyNavigationState(1)
    EndIf
    Return
EndIf
SayCurrentScriptKeyLabel()
; isDropdown is used For special menu types Not recognised by menuModeEvent such as the Insert Table, Insert Excel worksheet and insert column menu buttons
Var Int isDropdown =(c_WordFocus.WindowClass ==wc_MSOCommandBar
        && globalMenuMode==menubar_active)
EscapeKey()
If c_WordFocus.WindowClass == wc_WordMainDocumentWindow
    If !isSelectionModeActive()
    && IsExtendedSelectionModeWatchActive()
        SayFormattedMessageWithVoice(vctx_message, ot_status, msgSelectionModeOff1_L, cmsgSilent)
        StopExtendedSelectionModeWatch()
    EndIf
EndIf
EndScript

Script WindowKeysHelp()
If UserBufferIsActive()
    UserBufferDeactivate()
EndIf
SayFormattedMessage(OT_USER_BUFFER, cmsgWindowKeysHelpOfficeQuickSearch+cscBufferNewLine+msgWinKeysHelp1_L,
    cmsgWindowKeysHelpOfficeQuickSearch+cscBufferNewLine+msgWinKeysHelp1_S)
UserBufferAddText(cscBufferNewLine+cmsgBuffExit)
EndScript

Int Function WinwordHotKeyHelp()
If !getRunningFSProducts() & product_JAWS
    Return
EndIf
Var String strPage
If c_WordFocus.RealWindowName == wn_TemplatesAndAddIns
    SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp1_L, msgWHotKeyHelp1_S)
    Return True
ElIf c_WordFocus.RealWindowName == wn_PageSetup
    strPage = GetDialogPageName()
    If strPage == wn_Margins
        SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp2_L, msgWHotKeyHelp2_S)
    ElIf strPage == wn_PaperSize
        SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp3_L, msgWHotKeyHelp3_S)
    ElIf strPage == wn_PaperSource
        SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp4_L, msgWHotKeyHelp4_S)
    ElIf strPage == wn_Layout
        SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp5_L, msgWHotKeyHelp5_S)
    EndIf
    Return True
ElIf c_WordFocus.RealWindowName == wn_InsertTable
    SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp6_L, msgWHotKeyHelp6_S)
    Return True
ElIf c_WordFocus.RealWindowName == wn_Formula
    SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp7_L, msgWHotKeyHelp7_S)
    Return True
ElIf c_WordFocus.RealWindowName == wn_Font
    strPage = GetDialogPageName()
    If strPage == wn_CharacterSpacing
        SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp8_L, msgWHotKeyHelp8_S)
    else
        SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp9_L, msgWHotKeyHelp9_S)
    EndIf
    Return True
ElIf c_WordFocus.RealWindowName ==wn_Open
    SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp10_L, msgWHotKeyHelp10_S)
    ; save as and open Use same msgs_L here
    SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp11_L, msgWHotKeyHelp11_S)
    Return True
ElIf c_WordFocus.RealWindowName ==wn_SaveAs
    SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp12_L, msgWHotKeyHelp12_S)
    SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp14_L, msgWHotKeyHelp14_S)
    SayFormattedMessage(OT_USER_BUFFER, msgWHotKeyHelp15_L, msgWHotKeyHelp15_S)
    Return True
ElIf stringContains(c_WordFocus.RealWindowName, wn_SpellingAndGrammar)
|| stringContains(c_WordFocus.RealWindowName, wn_Spelling)
    SayFormattedMessage(OT_USER_BUFFER, msgWHotkeyHelp16_L, msgWHotkeyHelp16_S)
    Return True
else
    Return False
EndIf
EndFunction

Script HotKeyHelp()
If TouchNavigationHotKeys()
|| !getRunningFSProducts() & product_JAWS
    Return
EndIf
If MenusActive()
|| inHjDialog()
    performScript HotKeyHelp()
    Return
EndIf
Var
    Handle hwnd,
    String sOwner
If UserBufferIsActive()
    UserBufferDeactivate()
EndIf
hwnd = GetFocus()
If WindowCategoryIsWordDocument()
&& quickNavState()
&& !isVirtualPcCursor()
    If IsWordDocumentActive()
        SayFormattedMessage(ot_user_buffer, msgOutlookQuickKeys)
    else
        SayFormattedMessage(ot_user_buffer, msgQuickKeys)
    EndIf
    UserBufferAddText(cScBufferNewLine)
EndIf
If stringContains(c_WordFocus.RealWindowName, wn_SpellingAndGrammar)
|| stringContains(c_WordFocus.RealWindowName, wn_Spelling)
    SayFormattedMessage(OT_USER_BUFFER, msgJHotkeyHelp1_L, msgJHotkeyHelp1_S)
    UserBufferAddText(cScBufferNewLine)
    WinwordHotKeyHelp()
    UserBufferAddText(cscBufferNewLine+cmsgBuffexit)
    Return
EndIf
;For Outlook email Messages:
;Want To display keys that relate To header fields.
sOwner = GetWindowOwner(hwnd)
If StringContains(StringSegment(sOwner, cscDoubleBackSlash, StringSegmentCount(sOwner, cscDoubleBackslash)), an_envelope)
    SayFormattedMessage(OT_USER_BUFFER, msgHotKeyHelpEmailMessageCompose)
    AddHotKeyLinks()
    Return
EndIf
If OutlookIsActive()
    SayFormattedMessage(OT_USER_BUFFER, msgOutlookHotkeyHelp+cscBufferNewLine)
    AddAskFSCompanionHotKeyLink()
    UserBufferAddText(cscBufferNewLine+cMsgBuffExit)
    Return
EndIf
If isOutlineViewActive()
    SayFormattedMessage(OT_USER_BUFFER, msgJHotkeyHelpOutline+cscBufferNewLine)
EndIf
SayFormattedMessage(OT_USER_BUFFER, msgJHotkeyHelp3_L+cScBufferNewLine)
AddAskFSCompanionHotKeyLink()
SayMessage(OT_USER_BUFFER, cscBufferNewLine+cmsgBuffexit)
EndScript

Script ScreenSensitiveHelp()
If !getRunningFSProducts() & product_JAWS
    Return
EndIf
If IsSameScript()
    AppFileTopic(topic_Microsoft_Word)
    Return
EndIf
If UserBufferIsActive()
    UserBufferDeactivate()
    SayFormattedMessage(OT_USER_BUFFER, cMsgScreenSensitiveHelpBuf)
    Return
EndIf
If UsingShortNameOfMultiLevelListObject()
    SayFormattedMessage(OT_USER_BUFFER, GetObjectName())
    Return
EndIf
If ScreenSensitiveHelpForOffice()
    Return
EndIf
Var
    Handle WinHandle,
    String TheClass,
    Int CId
WinHandle = GetCurrentWindow()
TheClass = GetWindowClass(WinHandle)
If theClass == wc_wwf
    SayFormattedMessage(OT_USER_BUFFER, msgScrnSensitiveHelp1_L, msgScrnSensitiveHelp1_S)
    Return
ElIf WindowCategoryIsWordDocument()
    If IsActiveCursorOnMathContent()
        sayMessage(OT_USER_BUFFER, msgMathContentScreenSensitiveHelp)
    else
        sayDocumentWindowHelp()
    EndIf
    Return
EndIf
If theClass == wcF3Server
    ; we are focused On an inline shape.
    UserBufferClear()
    UserBufferActivate()
    sayInlineShapeHelp() ; change To user buffer add of the get String
    JAWSTopOfFile()
    SayAll(False)
    Return
EndIf
If StringContains(GetObjectName(), scBallon) ; help balloon
    SayFormattedMessage(ot_user_buffer, msgInformationBalloonScrnSensitiveHelp_l, msgInformationBalloonScrnSensitiveHelp_s)
    Return
ElIf IsExtendedSelectionModeWatchActive()
&& stringContains(c_WordFocus.RealWindowName, wn_FindAndReplace)
    If GetSelectedCharCount()
        SayFormattedMessage(OT_USER_BUFFER, FormatString(msgExtSelModeFindHelp1_L, GetSelectionInfo()))
    else ;nothing is selected
        SayFormattedMessage(OT_USER_BUFFER, msgExtSelModeFindHelp2_L)
    EndIf
    Return
EndIf
If !inOptionsDialog(winHandle)
    If GlobalMenuMode == MENUBAR_ACTIVE
        SayFormattedMessage(OT_USER_BUFFER, msgScrnSensitiveHelp4_L, msgScrnSensitiveHelp4_S)
        Return
    EndIf
EndIf
If GlobalMenuMode == MENU_ACTIVE
    self::ScreenSensitiveHelpForKnownClasses(wt_menu)
    Return
EndIf
PerformScript ScreenSensitiveHelp()
EndScript

String Function GetCustomTutorMessage()
If !getRunningFSProducts() & product_JAWS
    Return cscNull
EndIf
Var
    Handle hwnd,
    Int iObjType,
    String sClass,
    Int iWinType,
    String sObjName,
    Int iState,
    String sValue
hwnd = GetFocus()
Var Int typeCode = getObjectTypeCode(True) ; For edit fields
If OnEditFieldWithSuggestion()
    Return msgSpellCheckSentenceTutor
EndIf
If isResearchToolbar(hwnd)
    Return self::GetCustomTutorMessage()
EndIf
iObjType = c_WordFocus.ObjectSubType
sClass = c_WordFocus.WindowClass
iWinType = c_WordFocus.WindowSubtype
If StringContains(GetObjectName(), scBallon)
    Return msgInformationBalloonTutorHelp
ElIf globalMenuMode
&& iObjType == wt_combobox
&& iWinType == wt_Edit
    Return msgScreenSensitiveHelpEditCombo
ElIf isStatusBarToolBar()
    sObjName=GetObjectName()
    If sObjName == wn_PageNumber
        GetObjectInfoByName(hWnd, sObjName, 1, iObjType, iState, sValue)
        Return sValue+cscSpace+self::GetCustomTutorMessage()
    ElIf sObjName == WN_WordCount
        GetObjectInfoByName(hWnd, sObjName, 1, iObjType, iState, sValue)
        Return sValue+cscSpace+self::GetCustomTutorMessage()
    EndIf
    Return self::GetCustomTutorMessage()
Else
    Return self::GetCustomTutorMessage()
EndIf
EndFunction

String Function GetBasicLayerHelpTextMSWord()
Var
    String sHeading,
    String sMsg
sHeading = MarkupLayerHelpSectionTextAsHeading(msgBasicLayerHelpScreen_Heading_MSWord)
sMsg = ConvertTextToLinesWithHTMLLineBreak(msgBasicLayerHelpScreen_MSWord)
Return sHeading+"<br/>"+sMsg+"<br/>"
EndFunction

String Function GetBasicLayerHelpScreenText()
Return GetBasicLayerHelpTextMSWord()
    +GetBasicLayerHelpTextGeneral()
    +GetBasicLayerHelpTextMessaging()
    +GetBasicLayerHelpTextSecondaryLayer()
EndFunction

Int Function DoAcceleratorsForSuggestionsGroup(Object UIA, String keyName, Object group)
If !group Return False EndIf
If keyName != ksChange && keyName != ksChangeAll Return False EndIf
Var Object tmp = group.findAll(TREESCOPE_Children, UIA.CreateRawViewCondition())
If tmp.count == 1
&& tmp(0).ClassName == "NetUIGroupHeader"
    sayMessage(OT_ERROR, msgNoSuggestions1_L)
    Return
EndIf
If keyName == ksChangeAll
    sayMessage(OT_ERROR, msgChangeAllError)
    Return True
EndIf
If c_WordFocus.ObjectSubType == WT_SPLITBUTTON
    enterKey()
    Return True
EndIf
Var Object condition = FSUIACreateIntPropertyCondition(UIA_ControlTypePropertyId, UIA_SplitButtonControlTypeId)
If !condition Return False EndIf
Var Object element = group.findFirst(TREESCOPE_SUBTREE, condition)
If !element Return False EndIf
Var Object pattern = element.GetInvokePattern()
If !pattern Return False EndIf
If !pattern.Invoke() Return False EndIf
oSuggestionSplitButton = null()
If getObjectTypeCode() == WT_EDIT
    ; User pressed one of these buttons in the Current Sentence read-only edit box.
    oSuggestionSplitButton = null()
EndIf
Return True
EndFunction

Int Function doAcceleratorsForOtherActionsGroup(String keyName, Object group)
If !group Return False EndIf
If keyName != ksAddToDictionary
&& keyName != ksIgnore
&& keyName != ksIgnoreAll
    Return False
EndIf
Var Object condition = FSUIACreateIntPropertyCondition(UIA_ControlTypePropertyId, UIA_ButtonControlTypeId)
If !condition Return False EndIf
Var Object buttons = group.findAll(TREESCOPE_SUBTREE, condition)
If !buttons.count Return False EndIf
Var Object element
If keyName == ksIgnore
    element = buttons(0)
ElIf keyName == ksIgnoreAll
    element = buttons(1)
ElIf keyName == ksAddToDictionary
    element = buttons(2)
EndIf
If !element || !element.isEnabled Return False EndIf
Var Object pattern = element.GetInvokePattern()
If !pattern Return False EndIf
If !pattern.Invoke()
    pattern = element.GetLegacyIAccessiblePattern()
    If pattern.defaultAction
        pattern.doDefaultAction()
    else
        Return False ; no action was taken On button, Let default keystroke pass through.
    EndIf
EndIf
If getObjectTypeCode() == WT_EDIT
    ; User pressed one of these buttons in the Current Sentence read-only edit box.
    oSuggestionSplitButton = null()
EndIf
Return True
EndFunction

Int Function doAcceleratorsForSpellCheckerWithSplitButtons(String keyName)
Var Object UIA = CreateObjectEx("FreedomSci.UIA", 0, "UIAScriptAPI.x.manifest" )
If !UIA Return False EndIf
Var Object focusElement = UIA.GetFocusedElement().buildUpdatedCache()
If !focusElement Return False EndIf
Var Object treewalker = UIA.RawViewWalker()
If !treewalker Return False EndIf
treewalker.currentElement = focusElement
Var
    Object notInDictionaryGroup,
    Object suggestionsGroup,
    Object otherActionsGroup
If !getControlGroupsForSpellCheckerWithSplitButtons(UIA, treewalker,
        notInDictionaryGroup, suggestionsGroup, otherActionsGroup)
    Return False
EndIf
If keyName == ksChange || keyName == ksChangeAll
    Return DoAcceleratorsForSuggestionsGroup(UIA, keyName, suggestionsGroup)
ElIf keyName == ksAddToDictionary || keyName == ksIgnore || keyName == ksIgnoreAll
    Return doAcceleratorsForOtherActionsGroup(keyName, otherActionsGroup)
EndIf
Return False
EndFunction

Script SpellCheckAccelerators()
Var String keyName = stringLower(getCurrentScriptKeyName())
;For all accelerators from within Spellcheck dialog such as Change, Ignore, Change All, Ignore All, etc.
SayCurrentScriptKeyLabel()
If c_WordFocus.InProofingPaneSpellCheckWithSplitButtons
    If doAcceleratorsForSpellCheckerWithSplitButtons(keyName)
        Return
    EndIf
EndIf
typeCurrentScriptKey()
If c_WordFocus.windowCategory == WCAT_TASK_PANE
&& c_WordFocus.ObjectSubType == WT_BUTTON
    If c_WordFocus.InProofingPaneSpellCheck
        ;These accelerators don't work, so need To speak a message To that effect:
        sayMessage(OT_ERROR, msgProofingAcceleratorsNotAvailable)
    EndIf
EndIf
EndScript

String Function GetHeaderForNewAddressListField ()
Var
    Object oElement,
    Object oHeaderItemCondition,
    Object oHeaderItem,
    Object oHeaderItems,
    Object oRealWindow,
    Int iHeaderXCoordinate,
    Int iHeaderYCoordinate,
    Int x,
    Int y
oRealWindow = FSUIAGetElementFromHandle (GetRealWindow (GetCurrentWindow ()))
oElement = FSUIAGetFocusedElement ()
oHeaderItemCondition = FSUIACreateIntPropertyCondition (UIA_ControlTypePropertyId, UIA_HeaderItemControlTypeId)
oHeaderItems = oRealWindow.findAll(TreeScope_Descendants, OHeaderItemCondition)
oHeaderItem = GetFirstObjectWithClickablePoint (oHeaderItems)
oElement.GetClickablePoint( intRef(x), intRef(y))
oHeaderItem.GetClickablePoint(intRef(iHeaderXCoordinate), intRef(iHeaderYCoordinate))
oHeaderItem = FSUIAGetElementFromPoint (x, iHeaderYCoordinate)
Return oHeaderItem.name
EndFunction

Object Function GetFirstObjectWithClickablePoint (Object oArray)
Var
    Object oElement,
    Int x,
    Int y
ForEach oElement in oArray
    oElement.GetClickablePoint(intRef(x), intRef(y))
    If x != 0
    && y != 0
        Return oElement
    EndIf
EndForEach
Return Null()
EndFunction

Script SpeakPlaceMarkers()
If c_WordFocus.windowCategory == WCAT_DOCUMENT
&& isPCCursor()
    performScript ReturnToMarkedPlace()
    else
    performScript SpeakPlaceMarkers()
    EndIf
EndScript

Int Function ShouldIncludeView(String viewName)
If stringLeft(viewName, 11) == cWordPerfectPrefixJBSBase Then
    Return False
EndIf
If viewName == cWordClassicJBSBase Then
    Return False
EndIf

Return True
EndFunction

Script PictureSmartWithControl (optional Int serviceOptions)
Var Int forceCursor = c_WordFocus.IsWordDocumentActive > 0
PictureSmartWithControlCommon (PSServiceOptions_Single | serviceOptions, forceCursor)
EndScript

Script PictureSmartWithControlMultiService (optional Int serviceOptions)
Var Int forceCursor = c_WordFocus.IsWordDocumentActive > 0
PictureSmartWithControlCommon (PSServiceOptions_Multi | serviceOptions, forceCursor)
EndScript

Int Function InEmptyCopilotEditWithSuggestions()
If GetObjectAutomationId(0) != AutomationID_COPILOT_PROMPT
    && !StringIsBlank(GetObjectValue ())
    Return False
EndIf
    
Var Object menu
menu = FSUIAGetFocusedElement().ControllerFor(0)
If !menu
    Return False
EndIf

Return True
EndFunction

Int Function ShouldIgnoreSaySecondaryFocusSelectedItem()
If InEmptyCopilotEditWithSuggestions() Then
    Return False
EndIf

Return ShouldIgnoreSaySecondaryFocusSelectedItem()
EndFunction

Void Function SpeakSuggestionsAvailable()
If !InEmptyCopilotEditWithSuggestions()
    Return
EndIf
    
Var String text = GetSecondaryFocusSelectionText()
If !text Then
    SayUsingVoice (VCTX_MESSAGE, msgSuggestionsAvailable, OT_line)
EndIf
EndFunction


ZoomSoftware.jss

JAWS Script Language -- Complete ZoomSoftware.jss file

; Basic Scripts For the Zoom Conferencing Client.
; Prepared and updated by Brian Hartgen, Hartgen Consultancy, 27 January 2022. 
; Tested against Zoom Meetings Version 5, 9, 3, 3169
; JAWS version 2022.2201.54 
; New comments preceeded by a double at sign.

Include "hjconst.jsh" ; default constants, also includes HjIni.jsh For default section and key names
Include "hjglobal.jsh"
Include "MSAAConst.jsh"
Include "common.jsm"
Include "ZoomSoftware.jsm"

Import "Say.jsd"

Const
    ZoomNotificationWindowClass = "zoom_acc_notify_wnd",
    ZoomSchedulerComboBoxClass = "ZPWndSchedulerClass",
    ZoomSettingsComboBoxClass = "ZPSettingWndClass",
    ZoomChatClass = "ZPPTMainFrmWndClassEx"

Globals
    Int ZoomFirstTime, ; because we're Not storing settings any longer.
    Collection customBrailleComboBoxData,
    Int zUseTypeKey,
    String zRepeat,
    Int ZAlert,
    String zNotificationOutput,
    Int zChat,
    String SSpeakerName,
Int HasSpokenCategory,
Int Participants,
String ObjectName,
String PrevListOutput,
Int Line,
String ListOutput,
String zSText,
Int focusInChatEdit

; @@ For Notification Manager exclusions.

; For forcing refresh when MSAA alerts are received:
; We don't receive any events For some buttons where the name changes when the buttons is pressed To toggles something, one example is the Mute button in meetings.
; We will Use the MSAAAlertEvent as a trigger To attempt To detect a name change For these buttons by performing an MSAARefresh.
; But, performing an MSAARefresh now may cause both a focusChangedEvent and a NameChangedEvent, and this together with the MSAA alert announcement results in too many speech announcements.
; In cases where an alert is received immediately after a key press On a button, we do Not allow the MSAAAlertEvent code To continue processing but instead start watching For other events--focus change and name change.
; In the NameChangedEvent, If this event occurs within the time limit of the watch, and If the name change matches the button name,
; we tell the watcher that the NameChangedEvent code did the speaking;
; otherwise, the NameChangedEvent code will process as usual but will Not tell the event watcher that the desired speech output occurred.
; In FocusChangedEvent, If the watch For extra events is active and the focus did Not change,
; we assume that this focus change should be ignored and we do Not Handle speech output here.
; Finally, If the watch time expires and no events were detected To Handle the speech For the MSAAAlertEvent, we call the MSAAAlertEvent helper Function To process the alert which we would have ignored If some other event handled speaking it.
Const
    MSAAAlertSinceKeyPressMaxTime = 200 ;maximum number of ticks For associating an MSAA alert with being caused by a key press
Globals
    Int ConcludeWaitingForExtraEventsFromRefreshID, ;the schedule id of the Function ConcludeWaitingForExtraEventsFromRefreshID,
                ;which was set because we believe that an MSAA alert indicates that a button needs an MSAA refresh.
                ;The MSAARefresh will trigger other events, which we want To watch For and Handle For this special case.
                ; See functions: IsWaitingOnExtraEventsFromRefresh, MarkSpeechAsHandledInExtraEventFromRefresh, ConcludeWaitingForExtraEventsFromRefresh, MSAAAlertEvent, NameChangedEvent, FocusChangedEvent.
    Int CountOfExtraEventsSinceRefresh, ;Used To determine If events likely caused by MSAARefresh are fired.
    Collection ZoomDelayedMSAAAlertEventData ; Holds the params passed To MSAAAlertEvent, so that the event helper can be fired If needed when the watch For events expires.

Void Function AutoStartEvent ()
focusInChatEdit = False
Var String JAWSLanguage = stringLower (GetJFWLang ())
; preserve {} functionality For English users who potentially Use Dragon.
zUseTypeKey = (JAWSLanguage != "enu")
ShowSoundMixerDiscoveryDialog()
EndFunction

Void Function LoadNonJCFOptions ()
; Load preferences.
; @@ Older code commented out in the event there is a strategy change later down the road. But For now, we're Not retaining preferences.

; @@ When we restart JAWS, we must enable all alerts. Otherwise, keep the user's preference even when switching out of Zoom and back.
If ZoomFirstTime == 0 Then 
    Let ZoomFirstTime = 1
    ZAlert = 1 ; @@ We only want To set it To a value of 1 If JAWS is restarted.

    ; For now, we don't want this as it stores a preference.
    ; ZAlert = getNonJCFOption ("ZAlert")
    Let zChat = 0
    ; For now, we don't want this as it stores a preference.
    ; zChat = getNonJCFOption ("Chat")
EndIf ; End of Zoom first time run.
LoadNonJCFOptions () ; defaults
EndFunction

; To accompany Script To remind users as To what they've got.

Function SettingsReminder ()
If ZAlert== 0 Then 
    SayUsingVoice (VCTX_Message, MSGAlertsDisabled, ot_user_requested_information)
else
    SayUsingVoice (VCTX_Message, MSGAlertsEnabled, ot_user_requested_information)
EndIf
If zChat == 1 Then 
    SayUsingVoice (VCTX_Message, MSGExtendedChat, ot_user_requested_information)
else
    SayUsingVoice (VCTX_Message, MSGExtendedAlerts, ot_user_requested_information)
EndIf
EndFunction

Int Function IsWaitingOnExtraEventsFromRefresh()
Return ConcludeWaitingForExtraEventsFromRefreshID != 0
EndFunction

Void Function MarkSpeechAsHandledInExtraEventFromRefresh()
CountOfExtraEventsSinceRefresh = CountOfExtraEventsSinceRefresh + 1
EndFunction

Void Function CancelWaitingForExtraEventsFromRefresh()
If ConcludeWaitingForExtraEventsFromRefreshID
    UnScheduleFunction (ConcludeWaitingForExtraEventsFromRefreshID)
    ConcludeWaitingForExtraEventsFromRefreshID = 0
    CollectionRemoveAll(ZoomDelayedMSAAAlertEventData)
    CountOfExtraEventsSinceRefresh = 0
EndIf
EndFunction

Void Function ConcludeWaitingForExtraEventsFromRefresh()
ConcludeWaitingForExtraEventsFromRefreshID = 0
If !CountOfExtraEventsSinceRefresh
    ;We did Not detect any events where speech output was handled, so pass On the data recieved by MSAAAlertEvent To its handler:
    MSAAAlertEventHelper(ZoomDelayedMSAAAlertEventData.hwnd, ZoomDelayedMSAAAlertEventData.nTime, ZoomDelayedMSAAAlertEventData.SText, ZoomDelayedMSAAAlertEventData.nAlertLevel, ZoomDelayedMSAAAlertEventData.appName)
    CollectionRemoveAll(ZoomDelayedMSAAAlertEventData)
    Return
EndIf
CountOfExtraEventsSinceRefresh = 0
; We assume whatever desired announcement was handled in one of the extra events.
EndFunction

Void Function MSAAAlertEvent(Handle hwnd, Int nTime, String SText, Int nAlertLevel, String appName)
If getWindowClass (hwnd) != ZoomNotificationWindowClass Then; Not a Zoom Alert.
    Return MSAAAlertEvent (hwnd, nTime, SText, nAlertLevel, appName)
EndIf ; End of default Alert.
; See comment For forcing refresh when MSAA alerts are received:
If GetObjectRole() == role_system_PushButton
&& GetTickCount()-GetLastKeyPressTime() <= MSAAAlertSinceKeyPressMaxTime
    If !ZoomDelayedMSAAAlertEventData ZoomDelayedMSAAAlertEventData = New Collection EndIf
    ZoomDelayedMSAAAlertEventData.hwnd = hwnd
    ZoomDelayedMSAAAlertEventData.nTime = nTime
    ZoomDelayedMSAAAlertEventData.SText = SText
    ZoomDelayedMSAAAlertEventData.nAlertLevel = nAlertLevel
    ZoomDelayedMSAAAlertEventData.appName = appName
        ConcludeWaitingForExtraEventsFromRefreshID = ScheduleFunction("ConcludeWaitingForExtraEventsFromRefresh", 10)
    MSAARefresh()
    Return
EndIf
MSAAAlertEventHelper(hwnd, nTime, SText, nAlertLevel, appName)
EndFunction

Void Function MSAAAlertEventHelper(Handle hwnd, Int nTime, String SText, Int nAlertLevel, String appName)
Var
    String sMsgLong,
    String sMsgShort;
Let sMsgLong = SText
; Process the alerts and chats.
Let ZRepeat = SText ; Store the Alert For processing and output.
If StringContains (SText, MSGBandwidth) Then ; For when Zoom erroneously reports bandwidth is low
    Return
EndIf
; Are we recording or is recording paused? 
; Because synthetic speech announcing the recording status is now automatically transmitted To audience participants, we only need To say this If all alerts are enabled; If the user has specifically requested it, otherwise it is overbaring.
If ZAlert == 1 Then ; Alerts are enabled
    If StringContains (SText, MSGRecord) 
        || StringContains (SText, MSGPause) Then
 ; Change speech Messages. There is Braille output with this type.
 ; @@ For Notifications Manager.
 Var Collection NotificationRuleActions = ProcessNotification(sText, appName)
SayNotification (notificationRuleActions, ot_help)
If !notificationRuleActions.ExcludeFromNotificationHistory Then
    storeSpokenNotificationForRepeat (SText, appName) ; For New insert+Space&N keystroke.
EndIf
; @@ End of Notifications Manager
Return
EndIf ; Whether the user wants To hear this.
EndIf ; End of anything related To recording.

; Talking requires special handling.
If StringContains (SText, MSGTalking) Then ; Is the placeholder vacant or is someone actually talking.
    Let SSpeakerName = SText
    ProcessNameOfSpeaker () ; separate Function To ensure this is less cluttered.
Return
EndIf ; end of someone talking.
; User preference For incoming Messages.
If ZChat == 1  Then ; Chat Messages only are required.
    SpeakMessagesOnly ()
Return
EndIf ; end of user preference For chat Messages.

If StringIsBlank (zNotificationOutput) Then ; we have nothing.
    Let zNotificationOutput = ZRepeat
else ; add it To what we've got.
    Let zNotificationOutput = zNotificationOutput+"|"+ZRepeat
EndIf ; end of notification capture.
; If we've got this far and the user wants To hear Alerts Then send them To output.
If ZAlert == 1 Then 
        ; Change speech Messages. There is Braille output with this type.
        ; @@ For Notifications Manager
        notificationRuleActions = ProcessNotification(zRepeat, appName)
SayNotification (notificationRuleActions, ot_help)
; We don't want To save chat Messages, or alerts excluded from history by the user
If !NotificationRuleActions.ExcludeFromNotificationHistory && (!StringStartsWith(zRepeat, scChatMessageIndicator) && !StringStartsWith(zRepeat, scPersonalChatMessageIndicator)) Then
    StoreSpokenNotificationForRepeat(zRepeat, appName)
EndIf
; @@ End of Notifications Manager
EndIf ; end of Alert notifications If the user has selected them.

EndFunction

; special handling For speaker names.

Function ProcessNameOfSpeaker ()
Let SSpeakerName = StringTrimTrailingBlanks (SSpeakerName); avoid trailing space.
; StringsEqual is no longer necessary.
If SSpeakerName == MSGTalking Then ; Zoom has Not detected a speaker.
    SayUsingVoice (VCTX_Message, MSGSpeakerNotDetected, ot_user_requested_information)
else ; we have a speaker but the word Talking is unnecessary.
    Let SSpeakerName = StringReplaceSubstrings (SSpeakerName , MSGTalking, " ")
    Let SSpeakerName = StringTrimLeadingBlanks (SSpeakerName) ; clean output.
; Change speech Messages. There is Braille output with this type.
SayFormattedMessage (ot_help, SSpeakerName, SSpeakerName) 
EndIf ; end of whether we have legitimate name.

EndFunction

Void Function SpeakMessagesOnly ()
If StringStartsWith(zRepeat, scChatMessageIndicator) Then ; we want it If the user has selected chat only.
    If StringIsBlank (zNotificationOutput) Then ; we've got nothing so far.
        Let zNotificationOutput = zRepeat
    else ; add it To what we've got.
        Let zNotificationOutput = zNotificationOutput+"|"+zRepeat
    EndIf ; end of whether we have a chat message.
; Change speech Messages. There is Braille output with this type.
SayFormattedMessage (ot_help, ZRepeat, ZRepeat) 
EndIf ; whether the Alert contains a chat.
EndFunction

; older code For the time being.

Script SayAlert ()
If StringIsBlank (zRepeat) Then 
    sayMessage (OT_ERROR, MSGNoAlertsAvailable)
else
    SayMessage (OT_USER_REQUESTED_INFORMATION, zRepeat)
EndIf
EndScript

Script ToggleAlerts ()
; @@ New For January 2022.
If ZAlert== 0 Then 
    Let ZAlert= 1
    SayUsingVoice (VCTX_Message, MSGAlertsEnabled, OT_STATUS)
else
    Let ZAlert= 0
    SayUsingVoice (VCTX_Message, MSGAlertsDisabled, OT_STATUS)
EndIf
; @@ We're Not retaining this For now.
; WriteSettingInteger (Section_NonJCFOptions, "ZAlert", ZAlert, FT_CURRENT_JCF)
EndScript

Script ToggleChatMessages ()
If zChat == 0 Then 
    Let zChat = 1
    SayUsingVoice (VCTX_Message, MSGExtendedChat, ot_user_requested_information)
else
    Let zChat = 0
    SayUsingVoice (VCTX_Message, MSGExtendedAlerts, ot_user_requested_information)
EndIf
; @@ We're Not retaining this For now.
; WriteSettingInteger (Section_NonJCFOptions, "Chat", zChat, FT_CURRENT_JCF)
EndScript

 

Void Function SayAlertInfo ()
; A regular alert is produced here so If the user has disabled these we should ignore the request.
If ZAlert== 0 Then 
    Say (zRepeat, OT_USER_REQUESTED_INFORMATION)
EndIf
EndFunction

Script ScriptFileName()
ScriptAndAppNames (msgAppName)
EndScript

Script HotkeyHelp ()
If UserBufferIsActive () Then 
    UserBufferDeactivate ()
EndIf
UserBufferClear ()
SayFormattedMessage (Ot_User_Buffer, MSGHotkeyHelp+cscBufferNewLine+cscBufferNewLine)
SayFormattedMessage (Ot_User_Buffer, MSGPressEscape)
EndScript

Void Function sayZoomNotification (Int notificationNumber)
; we're doing stringSegments from the right, so subtract from 0 To make it a negative number
notificationNumber = (0-notificationNumber)
Var
    String output
Let output = StringSegment (zNotificationOutput, "|", notificationNumber)
If StringIsBlank (output) Then 
    sayMessage (OT_ERROR, MSGNoAlertsAvailable)
    Return
EndIf
If IsSameScript () Then 
    SayFormattedMessage (Ot_User_Buffer, output)
    SayFormattedMessage (Ot_User_Buffer, MSGPressEscape)
else
    Say (output, OT_USER_REQUESTED_INFORMATION)
EndIf
EndFunction

Script SayNotification1 ()
sayZoomNotification (1)
EndScript

Script SayNotification2 ()
sayZoomNotification (2)
EndScript

Script SayNotification3 ()
sayZoomNotification (3)
EndScript

Script SayNotification4 ()
sayZoomNotification (4)
EndScript

Script SayNotification5 ()
sayZoomNotification (5)
EndScript

Script SayNotification6 ()
sayZoomNotification (6)
EndScript

Script SayNotification7 ()
sayZoomNotification (7)
EndScript

Script SayNotification8 ()
sayZoomNotification (8)
EndScript

Script SayNotification9 ()
sayZoomNotification (9)
EndScript

Script SayNotification10 ()
sayZoomNotification (10)
EndScript

; Detect Participants List.

Function IsParticipantsList ()
Var
Handle grip,
String SParticipants
Let grip = GetFocus ()
Let SParticipants = GetWindowName (grip)
If StringContains (SParticipants, MSGParticipant) 
    || StringContains (SParticipants, MSGAttendee) Then ; this is the correct area but is it the List Box?
        If GetObjectType ()== "list box item" Then ; this is the Participants List.
Return True
else
    Return False
EndIf
EndIf
EndFunction

Function IsChatList ()
Var
Handle grip,
String SChats
Let grip = GetFocus ()
Let SChats= GetWindowName (grip)
If StringContains (SChats, MSGChat) 
    && GetObjectType ()== "list box item" Then ; this is the Chat List.
    Return True
else
    Return False
EndIf

EndFunction

 Void Function focusChangedEvent(Handle hwnd, Handle hwndPrev)
; Suppress unwanted speech, temporary measure. 
If hwnd == hwndPrev 
    If focusInChatEdit && IsFocusInChatEdit()
        Return
    ElIf IsWaitingOnExtraEventsFromRefresh()
        Return
    EndIf
EndIf
focusInChatEdit = IsFocusInChatEdit()

If IsParticipantsList () 
|| IsChatList () Then 
    Return
EndIf

; Default.
focusChangedEvent(hwnd, hwndPrev)

EndFunction
Int Function handleCustomWindows (Handle FocusWindow)
Var
    Handle realWindow,
    Int type,
    String realWindowName,
    String SObjectName,
    String output,
    Int WindowHierarchyX,
    ; For SayControlEX Function:
    String controlName,
    String controlType = getObjectType (),
    String controlValue
customBrailleComboBoxData = New Collection ; clear previously cached combo items
type = getObjectSubtypeCode ()
; identify the various controls
realWindow = GetRealWindow (focusWindow)
realWindowName = GetWindowName (realWindow)
WindowHierarchyX = GetWindowHierarchyX (focusWindow)
; Is this the Settings dialog?
If type == WT_LISTBOXITEM 
&& RealWindowName == MSGSettings Then ; it is the Settings List Box.
    If HasSpokenCategory == 0 Then ; speak the prompt To Let the user know the location.
        SayUsingVoice (VCTX_Message, MSGCategoryList, Ot_User_Requested_Information)
    EndIf ; End of whether we should say the prompt.
    Let HasSpokenCategory = 1 ; Set the flag so we don't say it again.
else
    Let HasSpokenCategory = 0 ; We can say the prompt now.
EndIf ; End of Settings List Box.
If GetObjectName(SOURCE_CACHED_DATA, 0)== MSGScreenShare Then ; Screen share is active but there is no focus.
    PerformScript Tab ()
Return
EndIf ; end of screen share.

If type != WT_COMBOBOX
; outside of meeting scheduler or Not On troublesome combo boxes.
    Return handleCustomWindows (focusWindow)
EndIf
Var String objectClassName = getObjectClassName ()
If WindowHierarchyX == 1 Then 
    controlName = MSGDate
    controlValue = GetObjectValue(SOURCE_CACHED_DATA)
ElIf WindowHierarchyX == 2 Then 
    controlName = MSGTime
    controlValue = GetObjectValue(SOURCE_CACHED_DATA)
ElIf WindowHierarchyX == 3 Then 
    controlName = MSGHours
    controlValue = GetObjectValue(SOURCE_CACHED_DATA)
ElIf WindowHierarchyX == 4 Then 
    controlName = MSGMinutes
    controlValue = GetObjectValue(SOURCE_CACHED_DATA)
ElIf objectClassName == ZoomSchedulerComboBoxClass 
|| objectClassName == ZoomSettingsComboBoxClass Then
    getDataFromCustomComboBoxes (controlName, controlValue)
EndIf ; end of timezone
If stringIsBlank (controlName) Then
Return handleCustomWindows (focusWindow)
EndIf
; just For code readability, the following variables are empty:
Var String controlState, String containerName, String containerType;
sayControlEX (focusWindow, controlName, controlType, controlState, containerName, containerType, controlValue)
Return True
EndFunction

Void Function getDataFromCustomComboBoxes (String byRef name, String byRef value)
Var String text = getObjectName ()
If ! stringContains (text, "(") && ! stringContains (text, ")") Then
    name = text
    value = getObjectValue (SOURCE_CACHED_DATA)
    Return
EndIf
name = stringSegment (text, "(", 1)
text = stringChopLeft (text, stringLength (name))
value = stringSegment (text, ")", 1)+")"
name = stringTrimTrailingBlanks (name)
value = stringTrimLeadingBlanks (value)
; Now remove extra content from Name component by substituting:
If stringContains (name, wnTimeZone) Then
    name = msgTimeZone
ElIf StringContains (name, wnMicrophone) Then
    name = msgMicrophone
ElIf stringContains (name, wnSpeakers) Then
    name = msgSpeakers
EndIf
EndFunction

Int Function BrailleCallbackObjectIdentify ()
Var
    Int typeCode = getObjectTypeCode (),
    String objectClassName = getObjectClassName (),
        String controlName, String controlValue
If typeCode == WT_DIALOG Then
; could be dialog or dialog page:
    Return WT_STATIC
ElIf ! typeCode && getObjectClassName () == "ZPFTEWndClass" Then
; a static whose name is relevant:
    Return WT_STATIC
EndIf
If objectClassName == ZoomSchedulerComboBoxClass 
|| objectClassName == ZoomSettingsComboBoxClass Then
; can't automatically pass Collection items into a param, so Use the local variables first:
    getDataFromCustomComboBoxes (controlName, controlValue)
    customBrailleComboBoxData.controlName = controlName
    customBrailleComboBoxData.ControlValue = controlValue
EndIf
If (focusInChatEdit)
    Return WT_EDIT
EndIf

Return BrailleCallbackObjectIdentify ()
EndFunction

Int Function BrailleAddObjectName (Int subtypeCode)
If (focusInChatEdit)
    Return True
EndIf
    
If subtypeCode != WT_COMBOBOX 
|| ! CollectionItemCount (customBrailleComboBoxData) Then
    Return BrailleAddObjectName (subtypeCode)
EndIf
BrailleAddString (customBrailleComboBoxData.ControlName, 0, 0, 0)
Return True
EndFunction

Int Function BrailleAddObjectValue (Int subtypeCode)
If subtypeCode == WT_COMBOBOX 
&& CollectionItemCount (customBrailleComboBoxData) Then
    BrailleAddString (customBrailleComboBoxData.ControlValue, 0, 0, 0)
    Return True
EndIf
; Handle edits.
; The Zoom Cloud Meeting app uses a single window containing all controls. 
;It does Not appear To support the UIA text pattern. 
;Text in the window is rendered in the OSM and JAWS can track the caret. 
;We thus add the focused line If the subtype code is WT_EDIT and the window class is ZPFTEWndClass etc.
If subtypeCode==WT_EDIT Then
    Var String class = GetWindowClass(GetFocus())
    If class=="ZPFTEWndClass" ; main window
        || class=="zWaitHostWndClass" ; Meeting ID or name field.
        || class=="ZPConfChatWndClass" ; meeting chat area.
        || class=="ConfMeetingInfoWndClass" Then
        BrailleAddFocusLine();
        Return True
    EndIf
EndIf

If (focusInChatEdit)
    BrailleAddFocusLine();
    Return True
EndIf

If subtypeCode != WT_STATIC Then
    Return BrailleAddObjectValue (subtypeCode)
EndIf
; where we have a dialog or dialog page with focus, and Braille would otherwise be empty:
Var String text = GetObjectName(SOURCE_CACHED_DATA)
If ! stringIsBlank (text) Then
    BrailleAddString (text, 0, 0, 0)
    Return True
EndIf
Return BrailleAddObjectValue (subtypeCode)
EndFunction

 

Script WindowKeysHelp ()
Var String help = msgWindowKeysHelp+cscBufferNewLine+cscBufferNewLine+cMsgBuffExit
If UserBufferIsActive () Then 
    UserBufferDeactivate ()
EndIf
UserBufferClear ()
sayMessage (OT_USER_BUFFER, help)
EndScript

Script ZoomNotifyCurrentSpeaker ()
; The Zoom keystroke is control+2, which conflicts with our notifications.
; We're Not doing anything but send the key, Zoom is responsible To push the notification back To us / any accessibility software when the keystroke is sent.
TypeKey (ksNotifyCurrentSpeaker)
; That's all we're doing now because the alert is dealt with elsewhere.
EndScript

Script AnnounceJAWSSettingsForZoom ()
; Now assigned To Control+F9. Included in Hotkey Help.
SettingsReminder()
EndScript

; Added For Settings Dialog.
 
 Script ScreenSensitiveHelp ()
If HasSpokenCategory == 1 Then ;; We are in the appropriate category list in the Settings dialog.
        If UserBufferIsActive () Then 
    UserBufferDeactivate ()
EndIf
UserBufferClear ()
SayFormattedMessage(ot_user_buffer, MSGZoomCategoryList+cscBufferNewLine+cscBufferNewLine)
    SayFormattedMessage(ot_user_buffer, MSGPressEscape)
else ; Default
    performScript ScreenSensitiveHelp()
EndIf   

EndScript
; The following scripts are required To facilitate access To Participant and Chat Lists. Temporary measure.

Script Tab ()
CancelWaitingForExtraEventsFromRefresh()
performscript tab ()
pause ()
If IsParticipantsList () Then 
    SayUsingVoice (VCTX_Message, MSGParticipantsList, ot_user_requested_information)
    sayline ()
EndIf
If IsChatList () Then 
    SayUsingVoice (VCTX_Message, MSGChatList, ot_user_requested_information)
    sayline ()
EndIf

EndScript

Script ShiftTab()
CancelWaitingForExtraEventsFromRefresh()
performscript ShiftTab()
pause ()
If IsParticipantsList () Then 
    SayUsingVoice (VCTX_Message, MSGParticipantsList, ot_user_requested_information)
    sayline ()
EndIf
If IsChatList () Then 
    SayUsingVoice (VCTX_Message, MSGChatList, ot_user_requested_information)
    sayline ()
EndIf

EndScript

Script SayNextLine ()
CancelWaitingForExtraEventsFromRefresh()
If IsParticipantsList () 
|| IsChatList () Then 
    If IsPCCursor () Then 
        PerformScript SayNextLine ()
        pause ()
        SayLine ()
    else
        PerformScript SayNextLine ()
    EndIf
else
    PerformScript SayNextLine ()
EndIf
EndScript

Script SayPriorLine()
CancelWaitingForExtraEventsFromRefresh()
If IsParticipantsList () 
|| IsChatList () Then 
    If IsPCCursor () Then 
        PerformScript SayPriorLine ()
        pause ()
        SayLine ()
    else
        PerformScript SayPriorLine ()
    EndIf
else
    PerformScript SayPriorLine ()
EndIf
EndScript

Script JAWSHome ()
CancelWaitingForExtraEventsFromRefresh()
PerformScript JAWSHome ()
If IsParticipantsList () 
|| IsChatList () Then 
    If IsPCCursor () Then 
        pause ()
        SayLine ()
    EndIf
EndIf
EndScript

Script JAWSEnd ()
CancelWaitingForExtraEventsFromRefresh()
PerformScript JAWSEnd ()
If IsParticipantsList () 
|| IsChatList () Then 
        If IsPCCursor () Then 
        pause ()
        SayLine ()
    EndIf
EndIf
EndScript

Int Function IsFocusInChatEdit()
If (!GetObjectIsEditable ())
    Return False
EndIf

Var String currentClass = GetWindowClass (GetFocus ())
If (currentClass != ZoomChatClass) 
    Return False
EndIf

Return True
EndFunction

Void Function NameChangedEvent (Handle hwnd, Int objId, Int childId, Int nObjType,
    String sOldName, String sNewName)
If IsWaitingOnExtraEventsFromRefresh()
&& GetObjectSubtypeCode() == wt_button
&& sNewName == getObjectname()
    ; We are assuming an MSAARefresh coincides with a name change For the button in focus, and that this is the event we want To speak.
    MarkSpeechAsHandledInExtraEventFromRefresh()
EndIf
If (focusInChatEdit)
    Return ; do nothing here To prevent default from running
EndIf
NameChangedEvent (hwnd, objId, childId, nObjType, sOldName, sNewName)
EndFunction

Void Function SayObjectTypeAndText(optional Int nLevel, Int includeContainerName, Int drawHighLight)
If (focusInChatEdit)
    Return IndicateControlType (WT_EDIT, cscNull, GetLine())
EndIf

SayObjectTypeAndText(nLevel, includeContainerName, drawHighLight)
EndFunction

Int Function GetMeetingShareRect(Int byref left, Int byref top, Int byref right, Int byref bottom)
Var Handle hApp = GetAppMainWindow(GetFocus())
Var Handle hShare = FindWindow(hApp, cscNull, wnMeetingShare)
If !hShare || !GetWindowRect (hShare, left, right, top, bottom) Then
    Return False
EndIf
If !IsValidRect(left, top, right, bottom)
    Return False
EndIf
Var Handle hTools = FindWindow(hApp, cscNull, wnMeetingTools)
If hTools && IsWindowVisible(hTools) Then
    Var Int mtLeft, Int mtTop, Int mtRight, Int mtBottom
    If GetWindowRect (hTools, mtLeft, mtRight, mtTop, mtBottom) Then
        bottom = min(bottom, mtTop)
    EndIf
EndIf
Return True
EndFunction

Void Function PictureSmartAllInOneZoom (Int serviceOptions)
Var
    Int left, Int top, Int right, Int bottom
If GetMeetingShareRect(left, top, right, bottom)
    PictureSmartWithAreaShared(serviceOptions, left, top, right, bottom)
    Return
EndIf
PerformScript PictureSmartWithControl(serviceOptions)
EndFunction

Script PictureSmartAllInOne (optional Int serviceOptions)
PictureSmartAllInOneZoom (PSServiceOptions_Single | serviceOptions)
EndScript

Script PictureSmartAllInOneMultiService (optional Int serviceOptions)
PictureSmartAllInOneZoom (PSServiceOptions_Multi | serviceOptions)
EndScript

Int Function SetCustomBackgroundOCRRect()
Var
    Int iLeft, Int iRight, Int iTop, Int iBottom
If !GetMeetingShareRect(iLeft, iTop, iRight, iBottom)
    Return False
EndIf
Return UpdateBackgroundOCRRectCollection(iLeft, iTop, iRight, iBottom)
EndFunction