"Script File examination

Hello:
Dear all , I have intended  to examine the script competency if it has
been shared within ilder  JAWS users , the purpose of that is to
ensure it's sufficient usefulness to them , I want a ninth , eighth ,
seventh , and even a sixth JAWS exploiter  to analyse , I' am just
attempting to reduce the enormous financial amount , of course , we
may think of any major applications  which the candidate may rely upon
more periodically , my great target is the your confidence   ,
I' am about to leave JAWS permanently to the mackintosh , but I would
like to assist as best as I could.
I look forward to hear from you.
Mostafa Al'mahdy.
On msn tonight , for a pleasant English conversation:
blind_user_forever@xxxxxxxxxxx
-- 
Best Wishs.
It's always hope that gives meaning to life.
__________________________________
; JAWS script file for Windows Live Messenger version 14
; Copyright 2007-2010 by Freedom Scientific Inc.


include "HjConst.jsh"
include "HJGlobal.jsh"
include "common.jsm"
include "TutorialHelp.jsm"
include "MsnHelper.jsh"
include "Windows Live Messenger.jsh"
include "Windows Live Messenger.jsm"
include "HjHelp.jsh"

Script ScriptFileName ()
ScriptAndAppNames (
        GetVersionInfoString (GetAppFilePath(),scProductName)
        +cscSpace
        +GetVersionInfoString (GetAppFilePath(),scProductVersion))
EndScript

Void Function AutoStartEvent ()
If !giMsnHasBeenLoaded Then
        LoadPersonalSettings()
        let giMsnHasBeenLoaded=TRUE
EndIf
let giVerbosityLevel=GetVerbosity()
let giMessageIndex=FALSE
If StringLength(gsClickingSound)<2 Then
        Let gsClickingSound = FindJAWSSoundFile (fNameMsnTyping )
EndIf
EndFunction

Void Function AutoFinishEvent ()
let giVerbosityLevel=FALSE
let GlobalObjectName=cscNull
let giObjSubType=FALSE
let giIsInContactList=FALSE
let gbInQuickSearchField=FALSE
let GlobalCurrentControl=FALSE
let GlobalRealWindowName=cscNull
StopAnyTypingTicks()
EndFunction

Void Function KeyPressedEvent (int nKey, string strKeyName, int nIsBrailleKey, 
int nIsScriptKey)
ProcessBXModifiedKey(strKeyName)
if !gbKeyboardHelp && ! InHJDialog () then
        ; Check to see if it is a key assigned to a script...
        If nIsScriptKey Then
                ; Check to see if it is the F11, F12, or accent...
                If nKey != kiF11 && nKey != kiF12 && nKey != kiGrave Then
                        let giMessageIndex=FALSE ; Reset message counter.
                        let giQuickReview=FALSE
                EndIf
        EndIf
        If KeyIsSpacebar(nKey,strKeyName,nIsBrailleKey) then
                ; When these checkboxes are present, ObjState fires twice, so 
bypassing.
                If giObjSubType == wt_CheckBox Then
                        If (StringContains(GlobalObjectName,onRemember)
                        || 
StringContains(GlobalObjectName,onSignInAutomaticallyCheckBox)) Then
                                Delay(2)
                                SayLine()
                                Return
                        EndIf
                EndIf
        EndIf
EndIf
KeyPressedEvent (nKey,strKeyName,nIsBrailleKey,nIsScriptKey)
EndFunction

Void Function FocusChangedEvent (handle FocusWindow, handle PrevWindow)
var
        handle hReal,
        handle hAppWindow,
        string RealName,
        int iSubType
let GlobalFocusWindow=FocusWindow
let hReal=GetRealWindow(FocusWindow)
Let RealName = GetWindowName (hReal)
let hAppWindow=GetAppMainWindow(FocusWindow)
let GlobalRealWindow=hReal
let GlobalRealWindowName=RealName
let GlobalAppWindow=hAppWindow
let GlobalCurrentControl=GetControlId(FocusWindow)
let GlobalFocusWindow = FocusWindow
let GlobalPrevObjectName = GlobalObjectName
let GlobalObjectName=GetObjectName(TRUE)
if (GlobalPrevApp != hAppWindow && hAppWindow != FocusWindow) then
        If (! GlobalWasHjDialog) || InHjDialog () then
                If ! HandleCustomAppWindows (hAppWindow) then
                        SayWindowTypeAndText (hAppWindow)
                EndIf
        EndIf
endIf
If ((GlobalPrevRealName != RealName) ; name has changed
|| (GlobalPrevReal != hReal)) then ; or handle has changed, then
        If ((hReal != hAppWindow) && (hReal != FocusWindow)) then
                If ! HandleCustomRealWindows (hReal) then
                        SayWindowTypeAndText (hReal)
                EndIf ; End of HandleCustomReal check
        EndIf ; End of Real window isn't appWindow or Focus Window. check
endIf ; End of Real window check.
If ! HandleCustomWindows (FocusWindow) then
        SayFocusedWindow()
EndIf
let GlobalPrevApp=hAppWindow
let GlobalPrevReal=hReal
let GlobalPrevRealName=RealName
let GlobalPrevFocus=FocusWindow
EndFunction


void function SayFocusedWindow()
if IsOptionsLayoutRadioButton(GlobalFocusWindow) then
        if 
InSameGroupOptionsLayoutRadioButton(GlobalFocusWindow,GlobalPrevFocus) then
                SayOptionsLayoutRadioButton(false)
        else
                SayOptionsLayoutRadioButton(true)
        EndIf
        return
EndIf
SayFocusedWindow()
EndFunction

Int Function HandleCustomAppWindows (handle hAppWnd)
var
        string sLastThread
let GlobalRealWindowClass=GetWindowClass(GlobalRealWindow)
If IsInConversationWindow() Then
        let giIsNotTheFocusedConversation=FALSE
        let sLastThread=ProcessConversations (ciOne)
        If StringLength(sLastThread)>ciThree  Then
                Say(sLastThread,OT_SCREEN_MESSAGE)
                Return TRUE
        EndIf
ElIf  StringContains(GlobalRealWindowName,wn_SendAnInstantMessage) Then
        
IndicateControlType(GetObjectSubTypeCode(),wn_SendAnInstantMessage,cscSpace)
;       PerformScript SayLine()
                Return TRUE
EndIf
Return FALSE
EndFunction

Int Function HandleCustomRealWindows (handle hReal)
let GlobalRealWindowClass=GetWindowClass(GlobalRealWindow)
Return FALSE
EndFunction

Int Function HandleCustomWindows (handle hWnd)
var
        int iSubType,
        string sObjDesc,
        string sWinName,
        string sWinText,
        string sObjName
let gbInQuickSearchField=FALSE
let gsBrlQuickSearchFieldText=cscNull
let gsBrlQuickSearchResults=cscNull
let giPrevObjSubType=giObjSubType
let giObjSubType=GetObjectSubTypeCode(TRUE)
let iSubType=GetWindowSubTypeCode(hWnd)
let GlobalWindowClass=GetWindowClass(hWnd)
let sObjDesc= GetObjectDescription(TRUE)
let sObjName=GlobalObjectName ; To alter object name without altering global 
variable's contents.
let sWinName=GetWindowName(hWnd)
If giItemHasSpoken Then
                let giItemHasSpoken=FALSE
                Return TRUE
EndIf
If SayFocusedHJDialogWindow(GlobalFocusWindow) then
        return true
EndIf
If IsInConversationWindow() Then
        let giIsInContactList=FALSE
EndIf
; Contact list...
If StringContains(sObjName,wn_QuickSearch) Then
        let gbInQuickSearchField=TRUE
EndIf
If (giObjSubType == wt_OutlineButton || giObjSubType == wt_TreeViewItem)
&& (StringContains(sObjDesc,scHideContacts)
|| StringContains(sObjDesc,scShowContacts)
|| StringContains(sObjDesc,scInteract)) Then
        ; Contact list 7.5
        If !giIsInContactList Then
                Say(wn_ContactList,OT_SCREEN_MESSAGE)
                let giIsInContactList=TRUE
        EndIf
        Delay(1)
        If  giObjSubType == wt_TreeViewItem Then
                If giObjSubType != giPrevObjSubType  Then
                        IndicateControlType(giObjSubType)
                EndIf
                ; Strips email address and mobile phone numbers from contact's 
name...
                If StringContains(sObjName,scLessThan) Then
                        let sObjName=SubString (sObjName, 1, 
StringContains(sObjName,scEmailStartPoint))
                EndIf
                ; Optionally strips [Online] status from contact's name...
                If !giShowContactListOnlineStatus Then
                        let 
sObjName=StringReplaceSubStrings(sObjName,scOnline,cscNull)
                EndIf
                ; Just announce the item...
                Say(sObjName,OT_SCREEN_MESSAGE)
                Return TRUE
        EndIf ; End of tree view item in contact list.
        If giObjSubType == wt_OutlineButton Then
                Delay(1)
                If giUseObjectInfo Then
                        let giUseObjectInfo=FALSE
                        let sObjName=GetObjectName(TRUE)
                Else
                        let sObjName=GetLine()
                EndIf
                IndicateControlType(giObjSubType,sObjName,cscSpace)
                If StringContains(sObjDesc,scHideContacts) Then
                        Say(cmsgExpanded,ot_status)
                ElIf StringContains(sObjDesc,scShowContacts) Then
                        Say(cmsgCollapsed,ot_status)
                EndIf ; End of check for hide/show.
                Return True
        EndIf ; End of Msn 8 check.
        SayLine()
        Return TRUE
EndIf ; End of Contact list expand/collapse buttons.
;Prevent speaking of "Selected" for button: onFocus = selection, hence is 
redundant.
if giObjSubType == WT_BUTTON
;The only bit that's on here is selected, hence not using bitwise:
&& getControlAttributes () == CTRL_SELECTED then
        SayObjectActiveItem ()
        return TRUE;
endIf
If (giObjSubType == WT_MenuBar
|| (giObjSubType == WT_ListBoxItem) && iSubType != wt_ListView)
&& giObjSubType != giPrevObjSubType Then
        If (StringContains(GlobalObjectName,scWaysYouCan) ||  
StringContains(GlobalObjectName,scHideContacts)) Then
                let giIsInContactList=TRUE
                IndicateControlType(wt_ListBox,wn_ContactList)
        ElIf (StringContains(GlobalRealWindowName,wn_InviteSomeone)
        || StringContains(GlobalRealWindowName,wn_ContactPickerDialog)
        || StringContains(GlobalRealWindowName,wn_SendAnInstantMessage)) Then
                IndicateControlType(wt_ListBox,wn_SelectContacts,cscSpace)
                PerformScript SayLine()
                Return True
        EndIf
        If (StringContains(GlobalRealWindowName,wn_Winks)
        || StringContains(GlobalRealWindowName,wn_Backgrounds)) Then
                Let sObjName=StringSegment (GetObjectName(), scComma, -1)
                Say(sObjName,OT_SCREEN_MESSAGE)
                Return
        EndIf ; End of My Winks and My Backgrounds.
        PerformScript SayLine()
        Return TRUE
EndIf
let giIsInContactList=FALSE
If (giObjSubType == wt_Menu
&& !GlobalMenuMode
&& StringContains(GetWindowTextEx (hWnd, FALSE, FALSE),scSortByGroups)) Then
        If giObjSubType != giPrevObjSubType  Then
                IndicateControlType(giObjSubType,cscSpace,cscSpace)
        EndIf
        SayLine()
        Return TRUE
EndIf
Return FALSE
EndFunction

void function PlayTypingTicks()
PlaySound (gsClickingSound)
if giScheduleTypingTicks then
        ScheduleFunction("PlayTypingTicks",5)
EndIf
EndFunction

void function StopAnyTypingTicks()
if giScheduleTypingTicks then
        UnscheduleFunction(giScheduleTypingTicks)
        let giScheduleTypingTicks = 0
EndIf
EndFunction

int function StatusBarTextReview(int nObjType, string sObjName, string 
sObjValue, int bmanualCheck)
if nObjType != wt_static
|| sObjName != onStatusBarText then
        return false
EndIf
If StringContains(sObjValue,scIsWriting)
|| StringContains(sObjValue,scIsRecording) Then
        If giTypingAnnounce
        && !bManualCheck then
                Say(sObjValue,OT_SCREEN_MESSAGE)
        EndIf
        If giTypingSounder Then
                PlaySound (gsClickingSound)
                if !bManualCheck then
                        let giScheduleTypingTicks = 
ScheduleFunction("PlayTypingTicks",5)
                EndIf
        EndIf
else
        StopAnyTypingTicks()
EndIf
return true
EndFunction

Void Function ValueChangedEvent (handle hwnd, int objId, int childId, int 
nObjType, string sObjName, string sObjValue, int bIsFocusObject)
var
        string stmp,
        string sWinName,
        string sUserName,
        string sAppClass
if InHJDialog() then
        ValueChangedEvent (hwnd, objId,childId, nObjType,sObjName, 
sObjValue,bIsFocusObject)
        return
EndIf
If GetWindowClass (hWnd) == cwc_DirectUIHWND then
        If StringContains(sObjName,onHistory) Then
                StopAnyTypingTicks()
                If hWnd != GetFocus() Then
                        let sWinName=GetWindowName(GetParent(hWnd))
                        let sUserName=StringReplaceSubstrings (sWinName, 
wn_Conversation, cscNull)
                        let sUserName=StringReplaceSubstrings (sUserName, 
wn_MobileDevice, cscNull)
                        let sUserName=StringReplaceSubstrings (sUserName, 
scEllipses, cscNull)
                        If giAutomaticSpeaking
                        && !SayAllInProgress () Then
                                Say(sObjValue,ot_screen_message); Do not say 
"User Says:" as the conversation is just starting up.
                        EndIf
                        Return
                EndIf
                If giAutomaticSpeaking Then
                        ;This handles the speaking of the contact info, 
depending on the Contact Speaking option:
                        If ! giSpeakContactWithMessage then
                                if (StringContains (sObjValue, scSays)) then
                                        Let stmp = StringRight (sObjValue, 
StringLength (scSays))
                                        if StringCompare (stmp, scSays) == 0 
then
                                                Return;the string 'Says:' is in 
fact the latter part, meaning this is most likely the incoming contact string.
                                                ;The downside of course is one 
could end their message with this exact string match.
                                        endIf
                                endIf
                        EndIf
                        Say(sObjValue,ot_user_requested_information)
                        let giQuickReview=TRUE
                        let giMessageIndex=FALSE
                        Return
                EndIf
        EndIf
        If IsInConversationWindow () Then
                if StatusBarTextReview(nObjType,sObjName,sObjValue,false) then
                        return
                elif sObjName == onInfoBar then
                        Say(sObjValue,OT_SCREEN_MESSAGE)
                        return
                EndIf
        EndIf
        ; Contact Quick Search field processing...
        let gsBrlQuickSearchFieldText=cscNull
        let gsBrlQuickSearchResults=cscNull
        If gbInQuickSearchField  Then
                let gsBrlQuickSearchFieldText=GetLine()
                let gsBrlQuickSearchResults=sObjName
                Say(sObjName,ot_Screen_Message)
        EndIf
EndIf
If nObjType == WT_COMBOBOX  Then
        let sAppClass=GetWindowClass(GetAppMainWindow(hWnd))
        If (sAppClass == cwc_DirectUIHWND
        || sAppClass == wc_MsnContactsDialog
        || GetWindowName(GlobalAppWindow) == wn_AudioVideoSetup ) Then
                Say(sObjValue,ot_line)
        EndIf
EndIf
ValueChangedEvent (hwnd, objId,childId, nObjType,sObjName, 
sObjValue,bIsFocusObject)
EndFunction

String Function ProcessConversations (int iMessageCount)
var
        handle hWnd,
        string sValue,
        string sSpeaker,
        string sMessageThread,
        string sTmpString,
        string sSegment,
        int iCount,
        int iLoopCount,
        int iSubType,
        int iState,
        int iSpeakerIndex,
        int iMessageThreadIndex,
        int iNewConversationFlag
MSAARefresh (); make sure the history window has in fact updated right.
GetObjectInfoByName (GlobalAppWindow, onHistory, 1, iSubType, iState, sValue)
If StringContains(sValue,scSeparator) Then
        let sValue=StringReplaceSubstrings (sValue, scSeparator, cscNull)
        ;let sValue=StringReplaceSubstrings (sValue, scConversationExtra, 
cscNull)
EndIf;That's the initial Blurb.
;here's separators for actual messages:
If StringContains(sValue,scSeparator2) Then
        let sValue=StringReplaceSubstrings (sValue, scSeparator2, 
scCarriageReturn)
        ;let sValue=StringReplaceSubstrings (sValue, scSeparator2, cscNull)
endIf
; Voice glip...
If StringContains(sValue,scVoiceClip) Then
        let sValue=StringReplaceSubstrings (sValue, scPlayStopSaveAs, cscNull)
EndIf
; If the double-return separator exists...
If StringContains(sValue,scDoubleReturns) Then
        let sValue=StringReplaceSubstrings (sValue, scDoubleReturns, 
scCarriageReturn)
EndIf
; Processing nudges...
If StringContains(sValue,scJustSentYouANudge)
||      StringContains(sValue,scYouSentANudge) Then
        let iCount=StringSegmentCount (sValue, scCarriageReturn)+1 ; Number of 
indexes to process.
        let sTmpString=cscNull
        let iLoopCount=1
        While(iCount>iLoopCount)
                let sSegment=StringSegment (sValue, scCarriageReturn, 
iLoopCount)
                If StringContains(sSegment,scJustSentYouANudge) Then
                        let sTmpString=sTmpString+scDoubleReturns+sSegment
                Else
                        let sTmpString=sTmpString+scCarriageReturn+sSegment
                EndIf
                let iLoopCount=iLoopCount+1
        EndWhile
        let sValue=sTmpString
EndIf ; End nudge processing
; Starting a new conversation...
If StringContains(StringSegment (sValue, scCarriageReturn, 
4),scEndOfConversation) Then
        let iNewConversationFlag=TRUE
EndIf
; Decide what message thread is requested, and calculate the index 
accordingly...
If iMessageCount < 2 Then
        If iNewConversationFlag Then ; Get the thread from the top of the 
thread stack...
                let iSpeakerIndex=2
                let iMessageThreadIndex=3
        Else ; Get thread from bottom of stack...
                let iSpeakerIndex=-2
                let iMessageThreadIndex=-1
        EndIf ; End of current message thread request...
Else ; Requesting thread other than current...
        If iNewConversationFlag Then ; Count offset for first thread being at 
top of stack...
                let iSpeakerIndex=(-2*(iMessageCount-1))
                let iMessageThreadIndex=(iSpeakerIndex+1)
        Else ; Count from bottom of stack...
                let iSpeakerIndex=(-2*iMessageCount)
                let iMessageThreadIndex=(iSpeakerIndex+1)
                ;Verify that iSpeakerIndex contains 'Says' as the final segment.
        EndIf ; End of other than current message thread request...
EndIf ; End of index calculation.
; Get appropriate text...
let sSpeaker=StringSegment (sValue, scCarriageReturn, iSpeakerIndex)
let sMessageThread=StringSegment (sValue, scCarriageReturn, iMessageThreadIndex)
If !giSpeakContactWithMessage Then
        ; Say just the message text...
        Return sMessageThread
Else ; Announce speaker and text...
        Return sSpeaker+cscBufferNewLine+sMessageThread
EndIf
EndFunction

int function IsOptionsChangeSoundButton()
return GetWindowClass(GetFocus()) == cwc_DirectUIHWND
        && StringCompare(GetObjectName(TRUE),objn_ChangeSound) == 0
EndFunction

int function IsOptionsLayoutRadioButton(handle hWnd)
var
        int iCtrl
let iCtrl = GetControlID(hWnd)
return GetWindowClass(GetParent(hWnd)) == cWc_dlg32770
        && GetWindowSubtypeCode(hWnd) == wt_RadioButton
        && iCtrl >= id_OptionsLayout_Favorites_1stRadioButton
        && iCtrl <= id_OptionsLayout_OtherContacts_4thRadioButton
EndFunction

int function InSameGroupOptionsLayoutRadioButton(handle hWnd1, handle hWnd2)
var
        int iCtrl1,
        int iCtrl2
if !IsOptionsLayoutRadioButton(hWnd1)
|| !IsOptionsLayoutRadioButton(hWnd2) then
        return false
EndIf
let iCtrl1 = GetControlID(hWnd1)
let iCtrl2 = GetControlID(hWnd2)
return (iCtrl1 <= id_OptionsLayout_Favorites_4thRadioButton && iCtrl2 <= 
id_OptionsLayout_Favorites_4thRadioButton)
        || (iCtrl1 >= id_OptionsLayout_OtherContacts_1stRadioButton && iCtrl2 
>= id_OptionsLayout_OtherContacts_1stRadioButton)
EndFunction

string function GetOptionsLayoutRadioButtonMainGroupName(handle hWnd)
var
        handle hGroup
if GetWindowSubtypeCode(hWnd) != wt_RadioButton then
        return cscNull
EndIf
let hGroup = 
GetPriorWindow(GetPriorWindow(FindDescendantWindow(GetParent(hWnd),id_OptionsLayout_Favorites_1stRadioButton)))
if hGroup then
        return GetWindowName(hGroup)
else
        return cscNull
EndIf
EndFunction

string function GetOptionsLayoutRadioButtonSubGroupName(handle hWnd)
var
        handle hGroup,
        int iCtrl
if GetWindowSubtypecode(hWnd) != wt_RadioButton then
        return cscNull
EndIf
let iCtrl = GetControlID(hWnd)
if iCtrl >= id_OptionsLayout_Favorites_1stRadioButton
&& iCtrl <= id_OptionsLayout_Favorites_4thRadioButton then
        let hGroup = 
GetPriorWindow(FindDescendantWindow(GetParent(hWnd),id_OptionsLayout_Favorites_1stRadioButton))
elif iCtrl >= id_OptionsLayout_OtherContacts_1stRadioButton
&& iCtrl <= id_OptionsLayout_OtherContacts_4thRadioButton then
        let hGroup = 
GetPriorWindow(FindDescendantWindow(GetParent(hWnd),id_OptionsLayout_OtherContacts_1stRadioButton))
EndIf
if hGroup then
        return GetWindowName(hGroup)
else
        return cscNull
EndIf
EndFunction

string function GetOptionsLayoutRadioButtonName(handle hWnd)
var
        int iCtrl
;the names of the buttons are not available through MSAA or OSM,
;so they are assigned manually.
;note that the button ID's are not necessarily sequential.
let iCtrl = GetControlID(hWnd)
if iCtrl == id_OptionsLayout_Favorites_1stRadioButton
|| iCtrl == id_OptionsLayout_OtherContacts_1stRadioButton then
        return msg_OptionsLayout_RadioButtoName_LargeIcons
ElIf iCtrl == id_OptionsLayout_Favorites_2ndRadioButton
|| iCtrl == id_OptionsLayout_OtherContacts_2ndRadioButton then
        return msg_OptionsLayout_RadioButtoName_MediumIcons
ElIf iCtrl == id_OptionsLayout_Favorites_3rdRadioButton
|| iCtrl == id_OptionsLayout_OtherContacts_3rdRadioButton then
        return msg_OptionsLayout_RadioButtoName_SmallIcons
ElIf iCtrl == id_OptionsLayout_Favorites_4thRadioButton
|| iCtrl == id_OptionsLayout_OtherContacts_4thRadioButton then
        return msg_OptionsLayout_RadioButtoName_StatusOnly
else
        return cscNull
EndIf
EndFunction

void function SayOptionsLayoutRadioButton(int bFullFormat)
var
        handle hWnd
let hWnd = GetCurrentWindow()
if bFullFormat then
        ;The radio button are two separate groups under a larger group.
        ;Say the major group name, then get the minor group name and say it.
        
Say(GetOptionsLayoutRadioButtonMainGroupName(hWnd),ot_control_group_name)
        IndicateControlType(WT_GROUPBOX 
,GetOptionsLayoutRadioButtonSubGroupName(hWnd),cmsgSilent)
EndIf
Say(GetOptionsLayoutRadioButtonName(hWnd),ot_control_name)
IndicateControlState(wt_RadioButton,GetControlAttributes())
if bFullFormat then
        Say(PositionInGroup(),ot_position)
EndIf
return true
EndFunction

Script ReviewMessageThread (int iMessageThreadCount)
var
        int iLength,
        string sThread
If !IsInConversationWindow() Then
        Say(msgNotInConversationWindow,OT_ERROR)
        Return
EndIf
MSAARefresh ()
let giIsNotTheFocusedConversation=FALSE
let sThread=ProcessConversations(iMessageThreadCount)
let iLength=StringLength(sThread)
If (!iLength
|| (iLength == ciOne && sThread == cscBufferNewLine)) Then
        ; No thread...
        
Say(MsgNoMessageThread+cscSpace+IntToString(iMessageThreadCount),OT_ERROR)
        Return
EndIf
; Thread does exist...
If IsSameScript()
&& !giQuickReview Then
        ; Put it in the virtual viewer
        ShowInViewer(sThread)
        Return
EndIf
Say(sThread,OT_USER_REQUESTED_INFORMATION)
EndScript

Script ReviewConversation (int iDirection)
var
        string sThread
If !IsInConversationWindow() Then
        Say(msgNotInConversationWindow,OT_ERROR)
        Return
EndIf
let giIsNotTheFocusedConversation=FALSE
If iDirection Then ; Step through forward, starting at message 10...
        If giMessageIndex<2 Then
                let giMessageIndex=10
        Else
                let giMessageIndex=giMessageIndex-1
        EndIf
Else ; Step through backwards...
        If giMessageIndex>9 Then
                let giMessageIndex=1
        Else
                let giMessageIndex=giMessageIndex+1
        EndIf
EndIf
let sThread=ProcessConversations(giMessageIndex)
If StringLength(sThread)<ciThree Then
        ; No thread...
        Say(MsgNoMessageThread+cscSpace+IntToString(giMessageIndex),OT_ERROR)
Else  ; Thread does exist...
        Say(sThread,OT_USER_REQUESTED_INFORMATION)
EndIf
EndScript

Script Enter ()
If !StringContains(GlobalObjectName,onInput) Then
        SayCurrentScriptKeyLabel()
EndIf
EnterKey()
EndScript

void Function CheckForSomeoneTyping (int bManual)
var
        string sValue,
        int iSubType,
        int iState
If !IsInConversationWindow () Then
        Return
EndIf
If GetObjectInfoByName (GetAppMainWindow(GetFocus()), onStatusBarText, 1, 
iSubType, iState, sValue) Then
        StatusBarTextReview(iSubtype, onStatusBarText, sValue, bManual)
EndIf
EndFunction

Script GoToHistoryWindow ()
If IsInConversationWindow() Then
        If !StringContains(GetObjectName(TRUE),onHistory) Then
                ; If not already in history field...
         If !ClickObjectByName(GlobalAppWindow,onHistory,1) Then
                        Say (msgHistoryNotFound, OT_ERROR)
                Else  ; Move successful!
                        Say(msgMoveToHistory,OT_SCREEN_MESSAGE)
                EndIf ; End of click object.
        EndIf ; End of history field check
Else ; Not in conversation window.
        Say(msgNotInConversationWindow,OT_ERROR)
EndIf
EndScript

Int Function IsInConversationWindow ()
return GetWindowClass(GetParent(GetFocus())) == wc_MessageWindowParentClass
|| (getWindowClass (getFocus ()) == cwc_DirectUIhWND
 && getObjectSubtypeCode (TRUE) == WT_MULTILINE_EDIT)
EndFunction

Script SayPriorLine ()
var
        string sObjName,
        string sObjDesc,
        int iObjSubType,
        string sWinName
if !IsPcCursor ()
|| IsVirtualPcCursor ()
|| GlobalMenuMode Then
        PerformScript SayPriorLine ()
        return
EndIf
let iObjSubType=GetObjectSubTypecode()
let sWinName=GetWindowName(GetFocus())
If GlobalWindowClass  == cwc_DirectUIHWND Then
        If iObjSubType == WT_MENUBAR Then
                PriorLine()
                Say(GetObjectName(),OT_SCREEN_MESSAGE)
                Return
        EndIf
        If iObjSubType == wt_ListBoxItem  Then
                let sObjName=GetObjectName(TRUE)
                PriorLine()
                Delay(1)
                If StringContains(GlobalRealWindowName,wn_Emoticons) Then
                        Let sObjName=ProcessMyEmoticonsItems ()
                        let giItemHasSpoken=TRUE
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        Return
                ElIf (StringContains(GlobalRealWindowName,wn_Winks)
                || StringContains(GlobalRealWindowName,wn_Backgrounds)) Then
                        Let sObjName=StringSegment (sObjName, scComma, -1)
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        let giItemHasSpoken=TRUE
                        Return
                EndIf ; End of My emoticons, MyWinks, and MyBackgrounds
                If (StringContains(GlobalRealWindowName,wn_InviteSomeone)
                || StringContains(GlobalRealWindowName,wn_ContactPickerDialog)
                || 
StringContains(GlobalRealWindowName,wn_SendAnInstantMessage)) Then
                let sObjDesc=GetObjectDescription(TRUE)
                        If StringContains(GetObjectName(),scNotSelected) Then
                                Let sObjDesc=cmsg_NotChecked+cscSpace+sObjDesc
                        Else
                                Let sObjDesc=cmsg_Checked+cscSpace+sObjDesc
                        EndIf
                        Say(sObjDesc,OT_SCREEN_MESSAGE)
                        Return
                EndIf ; End of Invite Someone to CONVERSATION>
      ; To announce the state of the items in create a new group dialogue
      If StringContains(GlobalRealWindowName, WN_CreateNewGroup) then
        Say (GetObjectState (), OT_STATUS)
      EndIf
                Say(GetLine(),OT_SCREEN_MESSAGE)
                Return
        EndIf ; End of listboxItem
EndIf ; End of DirectUI class.
; Font dialog...
If  iObjSubType == wt_EditCombo
&& ( sWinName == wn_Fonts
|| sWinName == wn_FontStyle
|| sWinName == wn_FontSize) Then
        PriorLine()
        SayObjectActiveItem(FALSE)
        Return
EndIf
; Prevent overchatter in quick search window.
  If giIsInContactList && GlobalPrevObjectName != GlobalObjectName then
    let GlobalPrevObjectName = GlobalObjectName
    PriorLine ()
    Return
  EndIf
PerformScript SayPriorLine()
EndScript

Script SayNextLine ()
var
        string sObjName,
        string sObjDesc,
        int iObjSubType,
        string sWinName
if !IsPcCursor ()
|| IsVirtualPcCursor ()
|| GlobalMenuMode
|| InHJDialog () Then
        PerformScript SayNextLine ()
        return
EndIf
let iObjSubType=GetObjectSubTypecode()
let sWinName=GetWindowName(GetFocus())
If GlobalWindowClass  == cwc_DirectUIHWND Then
        If iObjSubType == WT_MENUBAR Then
                NextLine()
                Say(GetObjectName(),OT_SCREEN_MESSAGE)
                Return
        EndIf
        If iObjSubType == wt_ListBoxItem  Then
                let sObjName=GetObjectName(TRUE)
                NextLine()
                Delay(1)
                If StringContains(GlobalRealWindowName,wn_Emoticons) Then
                        Let sObjName=ProcessMyEmoticonsItems ()
                        let giItemHasSpoken=TRUE
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        Return
                ElIf (StringContains(GlobalRealWindowName,wn_Winks)
                || StringContains(GlobalRealWindowName,wn_Backgrounds)) Then
                        Let sObjName=StringSegment (sObjName, scComma, -1)
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        let giItemHasSpoken=TRUE
                        Return
                EndIf ; End of My emoticons, MyWinks, and MyBackgrounds
                If (StringContains(GlobalRealWindowName,wn_InviteSomeone)
                || StringContains(GlobalRealWindowName,wn_ContactPickerDialog)
                || 
StringContains(GlobalRealWindowName,wn_SendAnInstantMessage)) Then
                        let sObjDesc=GetObjectDescription(TRUE)
                        If StringContains(GetObjectName(),scNotSelected) Then
                                Let sObjDesc=cmsg_NotChecked+cscSpace+sObjDesc
                        Else
                                Let sObjDesc=cmsg_Checked+cscSpace+sObjDesc
                        EndIf
                        Say(sObjDesc,OT_SCREEN_MESSAGE)
                        Return
                EndIf ; End of Invite Someone to CONVERSATION>
      ; To announce the state of the items in create a new group dialogue
      If StringContains(GlobalRealWindowName, WN_CreateNewGroup) then
        Say (GetObjectState (), OT_STATUS)
      EndIf
                Say(GetLine(),OT_SCREEN_MESSAGE)
                Return
        EndIf ; End of listboxItem
EndIf ; End of DirectUI class.
; Font dialog...
If  iObjSubType == wt_EditCombo
&& ( sWinName == wn_Fonts
|| sWinName == wn_FontStyle
|| sWinName == wn_FontSize) Then
        NextLine()
        SayObjectActiveItem(FALSE)
        Return
EndIf
PerformScript SayNextLine()
EndScript

Script SayNextCharacter ()
var
        string sObjName,
        int iObjSubType
if !IsPcCursor ()
|| IsVirtualPcCursor ()
|| GlobalMenuMode Then
        PerformScript SayNextCharacter ()
        return
EndIf
let iObjSubType=GetObjectSubTypeCode()
If GlobalWindowClass  == cwc_DirectUIHWND Then
        If iObjSubType == wt_ListBoxItem  Then
                NextCharacter()
                If (StringContains(GlobalRealWindowName,wn_Winks)
                || StringContains(GlobalRealWindowName,wn_Backgrounds)) Then
                        Let sObjName=StringSegment (GetObjectName(), scComma, 
-1)
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        Return
                EndIf ; End of My Winks and My Backgrounds.
                If StringContains(GlobalRealWindowName,wn_Emoticons) Then
                        Let sObjName=ProcessMyEmoticonsItems ()
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        Return
                EndIf ; End of My emoticons
                Say(GetLine(),OT_SCREEN_MESSAGE)
                Return
        EndIf ; End of listboxItem
EndIf ; End of DirectUI class.
PerformScript SayNextCharacter()
EndScript

Script SayPriorCharacter ()
var
        string sObjName,
        int iObjSubType
if !IsPcCursor ()
|| IsVirtualPcCursor ()
|| GlobalMenuMode Then
        PerformScript SayPriorCharacter ()
        return
EndIf
let iObjSubType=GetObjectSubTypeCode()
If GlobalWindowClass  == cwc_DirectUIHWND Then
        If iObjSubType == wt_ListBoxItem  Then
                PriorCharacter()
                If (StringContains(GlobalRealWindowName,wn_Winks)
                || StringContains(GlobalRealWindowName,wn_Backgrounds)) Then
                        Let sObjName=StringSegment (GetObjectName(), scComma, 
-1)
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        Return
                EndIf ; End of My Winks and My Backgrounds.
                If StringContains(GlobalRealWindowName,wn_Emoticons) Then
                        Let sObjName=ProcessMyEmoticonsItems ()
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        Return
                EndIf ; End of My emoticons
                Say(GetLine(),OT_SCREEN_MESSAGE)
                Return
        EndIf ; End of listboxItem
EndIf ; End of DirectUI class.
PerformScript SayPriorCharacter()
EndScript

Script SayLine ()
var
        int iSubType,
        int iObjSubType,
        string sObjState,
        string sObjName,
        string sObjDesc,
        string sText
if !IsPCCursor()
|| UserBufferIsActive()
|| GlobalMenuMode then
        PerformScript SayLine()
        return
EndIf
if IsOptionsChangeSoundButton() then
        
IndicateControlType(wt_button,GetObjectName(0,2)+cscSpace+GetObjectName(1),cscSpace)
        return
ElIf IsOptionsLayoutRadioButton(GetCurrentWindow()) then
        if SayOptionsLayoutRadioButton(true) then
                return
        EndIf
EndIf
let iObjSubType=GetObjectSubTypeCode(TRUE)
let iSubType=GetWindowSubTypeCode(GlobalFocusWindow)
If GetWindowClass(GlobalFocusWindow)  == cwc_DirectUIHWND Then
        let sObjName=StringTrimTrailingBlanks(GetObjectName(TRUE))
        let sObjDesc=GetObjectDescription()
        If iObjSubType == WT_MENUBAR
        || iObjSubType == wt_Menu Then
                If IsSameScript() Then
                        Say(sObjName,OT_SPELL)
                Else
                        Say(sObjName,OT_SCREEN_MESSAGE)
                EndIf
                Return
        EndIf
        If iObjSubType == wt_ListBoxItem  Then
                If StringContains(GlobalRealWindowName,wn_ContactPickerDialog) 
Then
                        let sObjDesc=GetObjectDescription(TRUE)
                        If StringContains(GetObjectName(),scNotSelected) Then
                                Let sObjDesc=cmsg_NotChecked+cscSpace+sObjDesc
                        Else
                                                Let 
sObjDesc=cmsg_Checked+cscSpace+sObjDesc
                        EndIf
                        If IsSameScript() Then
                                Say(sObjDesc,OT_SPELL)
                                Return
                        EndIf
                        Say(sObjDesc,OT_SCREEN_MESSAGE)
                        Return
                EndIf
                If (StringContains(GlobalRealWindowName,wn_Winks)
                || StringContains(GlobalRealWindowName,wn_Backgrounds)) Then
                        Let sObjName=StringSegment (GetObjectName(), scComma, 
-1)
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        If IsSameScript() Then
                                Say(sObjName,OT_SPELL)
                        EndIf
                        Return
                EndIf ; End of My Winks and My Backgrounds.
                If StringContains(GlobalRealWindowName,wn_Emoticons) Then
                        Let sObjName=ProcessMyEmoticonsItems ()
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        If IsSameScript() Then
                                Say(sObjName,OT_SPELL)
                        EndIf
                        Return
                EndIf ; End of My emoticons
                If (StringContains(GlobalRealWindowName,wn_InviteSomeone)
                || 
StringContains(GlobalRealWindowName,wn_SendAnInstantMessage)) Then
                        If StringContains(sObjName,scNotSelected) Then
                                Let sObjName=cmsg_NotChecked+cscSpace+sObjDesc
                        Else
                                Let sObjName=cmsg_Checked+cscSpace+sObjDesc
                        EndIf
                        Say(sObjName,OT_SCREEN_MESSAGE)
                        If IsSameScript() Then
                                Say(sObjName,OT_SPELL)
                        EndIf
                        Return
                        EndIf ; End of Invite Someone to Conversation
                If IsSameScript() Then
                        Say(GetLine(),OT_SPELL)
                Else
                        Say(GetLine(),OT_SCREEN_MESSAGE)
                EndIf
                Return
        EndIf ;End of listboxItem
        If giObjSubType == wt_OutlineButton Then
                IndicateControlType(giObjSubType,sObjName,cscSpace)
                If StringContains(sObjDesc,scHideContacts) Then
                        Say(cmsgExpanded,ot_status)
                ElIf StringContains(sObjDesc,scShowContacts) Then
                        Say(cmsgCollapsed,ot_status)
                EndIf ; End of check for hide/show.
        Return
        EndIf ; End of Msn 8 check.
        ; Contact Quick Search field processing...
        If gbInQuickSearchField
        && gsBrlQuickSearchFieldText != cscNull Then
                let 
sText=GlobalObjectName+cscSpace+gsBrlQuickSearchFieldText+cscSpace+gsBrlQuickSearchResults
                If IsSameScript() Then
                        Say(sText,ot_Spell)
                Else
                        Say(sText,ot_Screen_Message)
                EndIf
                Return
        EndIf
EndIf ; End of DirectUI class.
If IsSameScript () Then
        SpellLine ()
        Return
EndIf
PerformScript SayLine()
EndScript

script SayWord()
if !IsPCCursor()
|| UserBufferIsActive()
|| GlobalMenuMode then
        PerformScript SayWord()
        return
EndIf
if IsOptionsChangeSoundButton() then
        
IndicateControlType(wt_button,GetObjectName(0,2)+cscSpace+GetObjectName(1),cscSpace)
        return
ElIf IsOptionsLayoutRadioButton(GetCurrentWindow()) then
        if SayOptionsLayoutRadioButton(false) then
                return
        EndIf
EndIf
PerformScript SayWord()
EndScript

script SayCharacter()
if !IsPCCursor()
|| UserBufferIsActive()
|| GlobalMenuMode then
        PerformScript SayCharacter()
        return
EndIf
if IsOptionsChangeSoundButton() then
        
IndicateControlType(wt_button,GetObjectName(0,2)+cscSpace+GetObjectName(1),cscSpace)
        return
ElIf IsOptionsLayoutRadioButton(GetCurrentWindow()) then
        if SayOptionsLayoutRadioButton(false) then
                return
        EndIf
EndIf
PerformScript SayCharacter()
EndScript

Script CheckStatusLine ()
var
        string sValue,
        int iSubType,
        int iState
If GetObjectInfoByName(GlobalAppWindow,onStatusBarText,1,iSubType, 
iState,sValue) Then
        Say(sValue,OT_USER_REQUESTED_INFORMATION)
Else
        Say(msgStatusBarNotFound,OT_ERROR)
EndIf
EndScript

Script CheckContactStatus ()
var
        string sValue,
        int iSubType,
        int iState
If !GetObjectInfoByName(GlobalAppWindow, onInfoBar, 1, iSubType, iState, 
sValue) Then
        Say(msgInfoBarEmpty,OT_ERROR)
Else
        Say(sValue,OT_USER_REQUESTED_INFORMATION)
EndIf
EndScript

; Verbosity functions begin here...

String Function ToggleAnnounceContactSignIn (int iRetVal)
If not iRetVal Then
        Let GlobalMsnAnnounceSignIn = !GlobalMsnAnnounceSignIn
EndIf  ; update it
If GlobalMsnAnnounceSignIn Then
        return MsgEnabled
Else
        return MsgDisabled
EndIf
EndFunction

String Function ToggleAnnounceContactSignInHlp()
return msgToggleAnnounceContactSignInHlp
EndFunction

String Function ToggleAutomaticSpeaking (int iRetVal)
If not iRetVal Then
        Let giAutomaticSpeaking = !giAutomaticSpeaking
EndIf  ; update it
If giAutomaticSpeaking  then
        return MsgEnabled
Else
        return MsgDisabled
EndIf
EndFunction

String Function ToggleAutomaticSpeakingHlp()
return msgToggleAutomaticSpeakingHlp
EndFunction

String Function ToggleSpeakContactWithMessage (int iRetVal)
If not iRetVal Then
        Let giSpeakContactWithMessage = !giSpeakContactWithMessage
EndIf  ; update it
If giSpeakContactWithMessage  then
        return MsgEnabled
Else
        return MsgDisabled
EndIf
EndFunction

String Function ToggleSpeakContactWithMessageHlp()
return msgToggleSpeakContactWithMessageHlp
EndFunction

String Function ToggleTypingSounder (int iRetVal)
If not iRetVal Then
        Let giTypingSounder = !giTypingSounder
EndIf  ; update it
If giTypingSounder  then
        return MsgEnabled
Else
        return MsgDisabled
EndIf
EndFunction

String Function ToggleTypingSounderHlp()
return msgToggleTypingSounderHlp
EndFunction

String Function ToggleContactListOnlineStatus (int iRetVal)
If not iRetVal Then
        Let giShowContactListOnlineStatus = !giShowContactListOnlineStatus
EndIf  ; update it
If giShowContactListOnlineStatus Then
        return MsgEnabled
Else
        return MsgDisabled
EndIf
EndFunction

String Function ToggleContactListOnlineStatusHlp()
return msgToggleContactListOnlineStatusHlp
EndFunction

String Function ToggleTypingAnnounce (int iRetVal)
If not iRetVal Then
        Let giTypingAnnounce = !giTypingAnnounce
EndIf  ; update it
If giTypingAnnounce  then
        return MsgEnabled
Else
        return MsgDisabled
EndIf
EndFunction

String Function ToggleTypingAnnounceHlp()
return msgToggleTypingAnnounceHlp
EndFunction

Void Function LoadPersonalSettings ()
let giShowContactListOnlineStatus = IniReadInteger (Section_SoundOptions , 
hKey_ShowContactListOnlineStatus,1,fn_MsnMessengerJsi)
let giTypingSounder = IniReadInteger (Section_SoundOptions , hKey_TypingSounder 
, 1, fn_MsnMessengerJsi)
let giTypingAnnounce = IniReadInteger (Section_SoundOptions, 
hKey_TypingAnnounce,1, fn_MsnMessengerJsi)
let giSpeakContactWithMessage = IniReadInteger (Section_SoundOptions, 
hKey_SpeakContactWithMessage, 1, fn_MsnMessengerJsi)
let giAutomaticSpeaking = IniReadInteger (Section_SoundOptions, hKey_Automatic, 
1, fn_MsnMessengerJsi)
let GlobalMsnAnnounceSignIn = IniReadInteger (Section_SoundOptions, 
hKey_AutoSignInAnnounce, 2, fn_MsnMessengerJsi)
; Not used in Msn Messenger, but needed for Jsi file with Windows Messenger.
Let giMsnTypingRepeat=IniReadInteger (Section_SoundOptions, hKey_TypingRepeat, 
2, fn_MsnMessengerJsi )
Let giMSNSpeakMail=IniReadInteger (Section_SoundOptions, hKey_SpeakMail, 1, 
fn_MsnMessengerJsi )
Let giMSNReviewMode=IniReadInteger (Section_SoundOptions, hKey_ReviewMode, 1, 
fn_MsnMessengerJsi )
Let giMSNSuppressLocalEcho=IniReadInteger (Section_SoundOptions, 
hKey_SuppressLocalEcho, FALSE, fn_MsnMessengerJsi )
Let giMSNPlaySwitchingSound=IniReadInteger (Section_SoundOptions, 
hKey_PlaySwitchingSound, 1, fn_MsnMessengerJsi )
EndFunction

Int Function SavePersonalSettings ()
Var
        int iResult
let iResult =IniWriteInteger (Section_SoundOptions, hKey_TypingSounder, 
giTypingSounder, fn_MsnMessengerJsi)
IniWriteInteger (Section_SoundOptions, hKey_TypingAnnounce, giTypingAnnounce, 
fn_MsnMessengerJsi)
IniWriteInteger (Section_SoundOptions, 
hKey_ShowContactListOnlineStatus,giShowContactListOnlineStatus,fn_MsnMessengerJsi)
IniWriteInteger (Section_SoundOptions, hKey_SpeakContactWithMessage, 
giSpeakContactWithMessage, fn_MsnMessengerJsi)
IniWriteInteger (Section_SoundOptions, hKey_AutoSignInAnnounce, 
GlobalMsnAnnounceSignIn, fn_MsnMessengerJsi)
IniWriteInteger (Section_SoundOptions, hKey_Automatic, giAutomaticSpeaking, 
fn_MsnMessengerJsi)
; Saved for Jsi compatibility with Windows Messenger.
iniWriteInteger (Section_SoundOptions, hKey_TypingRepeat, 
giMsnTypingRepeat,fn_MsnMessengerJsi)
iniWriteInteger (Section_SoundOptions, hKey_SpeakMail, 
giMSNSpeakMail,fn_MsnMessengerJsi)
iniWriteInteger (Section_SoundOptions, hKey_ReviewMode, 
giMSNReviewMode,fn_MsnMessengerJsi)
iniWriteInteger (Section_SoundOptions, hKey_SuppressLocalEcho, 
giMSNSuppressLocalEcho,fn_MsnMessengerJsi)
iniWriteInteger (Section_SoundOptions, hKey_PlaySwitchingSound, 
giMSNPlaySwitchingSound,fn_MsnMessengerJsi)
return iResult
EndFunction

Script AdjustJAWSOptions()
Var
        int iPrevAutoSignInAnnounce,
        int iPrevShowContactListOnlineStatus,
        int iPrevAutomaticSpeaking,
        int iPrevTypingAnnounce,
        int iPrevTypingSounder,
        int iPrevSpeakContactWithMessage,
        string sList
let iPrevShowContactListOnlineStatus=giShowContactListOnlineStatus
let iPrevAutoSignInAnnounce = GlobalMsnAnnounceSignIn
let iPrevAutomaticSpeaking = giAutomaticSpeaking
let iPrevTypingAnnounce = giTypingAnnounce
let iPrevTypingSounder = giTypingSounder
let iPrevSpeakContactWithMessage = giSpeakContactWithMessage
let sList =
        jvToggleTypingSounder
        + jvToggleTypingAnnounce
        + jvToggleSpeakContactWithMessage
        + jvToggleAutomaticSpeaking
        + jvToggleAnnounceContactSignIn
        + jvToggleContactListOnlineStatus
ConvertListToNodeList(sList,GetActiveConfiguration ())
OptionsTreeCore(sList)
If iPrevAutoSignInAnnounce != GlobalMsnAnnounceSignIn
|| iPrevShowContactListOnlineStatus != giShowContactListOnlineStatus
|| iPrevAutomaticSpeaking != giAutomaticSpeaking
|| iPrevTypingAnnounce != giTypingAnnounce
|| iPrevTypingSounder != giTypingSounder
|| iPrevSpeakContactWithMessage != giSpeakContactWithMessage Then
        If savePersonalSettings() then
                SayUsingVoice(VCTX_MESSAGE, msgPersonalSettingsSaved,OT_STATUS)
        Else
                SayFormattedMessage(ot_error, msgPersonalSettingsNotSaved)
        EndIf
EndIf
If giTypingAnnounce
|| giTypingSounder Then
        CheckForSomeoneTyping (false)
EndIf
EndScript

Script ScreenSensitiveHelp ()
var
        int iSubType,
        int iObjSubType,
        string SWinName,
        string SWinClass,
        string sHelp_L,
        string sHelp_S,
        string sObjName,
        string sObjDesc
let SWinClass = GetWindowClass (GlobalFocusWindow)
let iSubType=GetWindowSubTypeCode(GlobalFocusWindow)
let sWinName=GetWindowName(GlobalFocusWindow)
let iObjSubType=GetObjectSubTypeCode(TRUE)
let sObjName=GetObjectName(TRUE)
let sObjDesc=GetObjectDescription(TRUE)
If !iSubType Then
        let iSubType=iObjSubType
EndIf
if IsSameScript () then
        AppFileTopic(TOPIC_MSN_MESSENGER)
        return
EndIf
If UserBufferIsActive () then
        PerformScript ScreenSensitiveHelp()
        Return
EndIf
If iSubType == wt_ButtonMenu
|| iSubType == wt_ButtonDropDown
|| iSubType == wt_ButtonDropDownGrid Then
        SayFormattedMessage(ot_user_buffer,msgButtonMenu)
        Return
EndIf
if GlobalMenuMode  then
        If iObjSubType == WT_MENUBAR
        && sWinClass  == cwc_DirectUIHWND Then
                let 
sHelp_L=FormatString(msgScreenSensitiveHelpCustomMenuBar_L,GetScriptKeyName(csnSayPriorCharacterScript),
                        GetScriptKeyName(csnSayNextCharacterScript), 
GetScriptKeyName(csnSayPriorLineScript),
                        
GetScriptKeyName(csnSayNextLineScript),GetScriptKeyName(csnEnterScript))
                let 
sHelp_S=FormatString(msgScreenSensitiveHelpCustomMenuBar_S,GetScriptKeyName(csnSayPriorCharacterScript),
                        GetScriptKeyName(csnSayNextCharacterScript), 
GetScriptKeyName(csnSayPriorLineScript),
                        
GetScriptKeyName(csnSayNextLineScript),GetScriptKeyName(csnEnterScript))
                SayFormattedMessage(OT_USER_BUFFER, sHelp_l, sHelp_S)
                Return
        EndIf
        if GlobalMenuMode == 2 then
                ScreenSensitiveHelpForKnownClasses (WT_MENU)
        else
                ScreenSensitiveHelpForKnownClasses (WT_MENUBAR)
        EndIf
        return
EndIf ; End of menus.
; Conversation window...
If IsInConversationWindow() Then
        If sObjName == onHistory Then
                let 
sHelp_L=FormatString(msgScreenSensitiveHelpHistory_L,GetScriptKeyName(snReviewMessageThreadOneScript),
                
GetScriptKeyName(snReviewMessageThreadTenScript),GetScriptKeyName(snGoToHistoryWindowScript))
                let 
sHelp_S=FormatString(msgScreenSensitiveHelpHistory_S,GetScriptKeyName(snReviewMessageThreadOneScript),
                
GetScriptKeyName(snReviewMessageThreadTenScript),GetScriptKeyName(snGoToHistoryWindowScript))
        ElIf sObjName == onInput Then
                let 
sHelp_L=FormatString(msgScreenSensitiveHelpInput_L,GetScriptKeyName(csnEnterScript),
                GetScriptKeyName(snSelectEmoticonsScript))
                let 
sHelp_s=FormatString(msgScreenSensitiveHelpInput_S,GetScriptKeyName(csnEnterScript),
                GetScriptKeyName(snSelectEmoticonsScript))
        Else
                ScreenSensitiveHelpForKnownClasses (iSubType)
                Return
        EndIf
        SayFormattedMessage(OT_USER_BUFFER, sHelp_l, sHelp_S)
        Return
EndIf ; End of Conversation window
; Contact list...
If (iObjSubType == wt_TreeViewItem
|| iObjSubType == wt_OutlineButton)
|| giIsInContactList Then
;&& (StringContains(sObjDesc,scHideContacts)
;|| StringContains(sObjDesc,scShowContacts)
;|| StringContains(sObjDesc,scWaysYouCan)) Then
        ; Contact list 7.5
        let sHelp_L=FormatString(msgScreenSensitiveHelpContactTree_L, 
GetScriptKeyName(csnSayPriorCharacterScript),GetScriptKeyName(csnSayNextCharacterScript))
        let sHelp_S=FormatString(msgScreenSensitiveHelpContactTree_S, 
GetScriptKeyName(csnSayPriorCharacterScript),GetScriptKeyName(csnSayNextCharacterScript))
        SayFormattedMessage(OT_USER_BUFFER, sHelp_l, sHelp_S)
        Return
EndIf ; End of contact list Msn7.5
If (StringContains(sObjName,scWaysYouCan)
|| StringContains(sObjName,scHideContacts)
|| StringContains(sObjName,scShowContacts))
&& iObjSubType == wt_ListBoxItem Then
        ; Contact list MSN7.0
        let sHelp_L=msgScreenSensitiveHelpContactList_L
        let sHelp_s=msgScreenSensitiveHelpContactList_s
        SayFormattedMessage(OT_USER_BUFFER, sHelp_l, sHelp_S)
        Return
EndIf ; End of contact list 7.0
ScreenSensitiveHelpForKnownClasses (iSubType)
EndScript

Script HotKeyHelp ()
var
        int iSubType,
        int iObjSubType,
        string SWinName,
        string SWinClass,
        string sHelp_L,
        string sHelp_S,
        string sObjName
let SWinClass = GetWindowClass (GlobalFocusWindow)
let iSubType=GetWindowSubTypeCode(GlobalFocusWindow)
let sWinName=GetWindowName(GlobalFocusWindow)
let iObjSubType=GetObjectSubTypeCode(TRUE)
let sObjName=GetObjectName(TRUE)
If !iSubType Then
        let iSubType=iObjSubType
EndIf
If UserBufferIsActive () then
         UserBufferDeactivate ()
         Return
EndIf
If IsInConversationWindow() Then
        let sHelp_L=msgHotKeyHelpConversationWindow_L+cscBufferNewLine
        let sHelp_S=msgHotKeyHelpConversationWindow_S+cscBufferNewLine
        SayFormattedMessage(OT_USER_BUFFER,sHelp_L, sHelp_S)
        Return
ElIf giIsInContactList Then
        let sHelp_L=msgHotKeyHelpContactList_L  ;+cscBufferNewLine
        let sHelp_S=msgHotKeyHelpContactList_S  ;+cscBufferNewLine
        SayFormattedMessage(OT_USER_BUFFER,sHelp_L, sHelp_S)
        ; Added the Press Escape phrase to the end of the buffer
        UserBufferAddText (cScBufferNewLine)
        UserBufferAddText (cMsgBuffExit, cScNull, cScNull, cFont_Aerial, 12, 0, 
rgbStringToColor(cColor_BLACK), rgbStringToColor(cColor_White))
        Return
ElIf StringContains(GlobalRealWindowName,wn_MainWindow) Then
        let sHelp_L=msgHotKeyHelpConversationWindow_L+cscBufferNewLine
        let sHelp_S=msgHotKeyHelpConversationWindow_S+cscBufferNewLine
        SayFormattedMessage(OT_USER_BUFFER,sHelp_L, sHelp_S)
        AddHotkeyLinks()
        Return
EndIf
PerformScript HotkeyHelp()
EndScript

Script AssignConversation (int iConversationID)
var
        string sName,
        handle hWnd
If IsInConversationWindow() Then
        let hWnd=GetParent(GetFocus())
        let 
sName=StringLeft(GlobalRealWindowName,StringContains(GlobalRealWindowName,wn_Conversation)-1)
        If iConversationID == ciOne Then
                let hMsnWindow1=hWnd
                let gsConversationName1=sName
        ElIf iConversationID == ciTwo Then
                let hMsnWindow2=hWnd
                let gsConversationName2=sName
        ElIf iConversationID == ciThree Then
                let hMsnWindow3=hWnd
                let gsConversationName3=sName
        ElIf iConversationID == ciFour Then
                let hMsnWindow4=hWnd
                let gsConversationName4=sName
        ElIf iConversationID == ciFive Then
                let hMsnWindow5=hWnd
                let gsConversationName5=sName
        EndIf ; End of ID check.
        
SayUsingVoice(VCTX_MESSAGE,sName+msgAssignedTo+IntToString(iConversationID),OT_USER_REQUESTED_INFORMATION)
Else
        Say(msgNotInConversationWindow,OT_ERROR)
EndIf
EndScript

int function BrailleCallbackObjectIdentify()
var
        string sClass,
        string sName
if GetWindowClass(GetFocus()) == cwc_DirectUIhWND then
        if GetObjectName(true) == objn_ChangeSound then
                return wt_button
        EndIf
EndIf
BrailleCallbackObjectIdentify()
EndFunction

Script SayBottomLineOfWindow()
If IsInConversationWindow() Then
        ; If in the Conversation window, the status line needs announcing.
        PerformScript CheckStatusLine()
        Return
EndIf
PerformScript SayBottomLineOfWindow()
EndScript

Script QuickReview()
let giQuickReview=TRUE
let giIsNotTheFocusedConversation=FALSE
If IsSameScript() Then
        let giQuickReview=ciTwo
EndIf
        PerformScript ReviewMessageThread(giQuickReview)
let giQuickReview=FALSE
EndScript

Script SelectEmoticons ()
var
        int iIndex
If !giEmoticonsListHasBeenBuilt Then
        BuildEmoticonsList()
EndIf
Let iIndex = DlgSelectItemInList (gsEmoticonsList, wn_EmoticonsTitle, 
FALSE,TRUE)
TypeString (StringSegment (gsEmoticonCodesList, cscSpace, iIndex))
EndScript

Void Function BuildEmoticonsList ()
var
        string sKeyName,
        string sTmp,
        int iLoopCounter,
        int iEmoticonCount
let gsEmoticonsList=cscNull
let gsEmoticonCodesList=cscNull
let iEmoticonCount = IniReadInteger (Section_Emoticons , hKey_EmoticonCount , 
0, "MsnMessenger.Jsi")
Let iLoopCounter =1
While (iLoopCounter <= iEmoticonCount)
        Let sKeyName = hKey_Emoticon + IntToString (iLoopCounter)
        let sTmp=IniReadString (Section_Emoticons, sKeyName, cscNull, 
fn_MsnMessengerJsi)
        Let gsEmoticonCodesList = gsEmoticonCodesList+ StringSegment (sTmp, 
sc_Grave , 1)+cscSpace
        Let gsEmoticonsList = gsEmoticonsList+ StringSegment (sTmp, sc_Grave , 
2)+scBar
        Let iLoopCounter=iLoopCounter+1
endWhile
If StringRight(gsEmoticonsList,1) == scBar Then
        let gsEmoticonsList=StringChopRight(gsEmoticonsList,1)
EndIf
If !StringLeft(gsEmoticonsList,ciOne) == scBar Then
        let giEmoticonsListHasBeenBuilt=TRUE
EndIf
EndFunction

Script SayLastAlertInfo()
var
        string sAlertText,
        string sAlertInfo,
        int iAlertLevel
If !GetLastMSAAAlertInfo(sAlertText, iAlertLevel) Then
        Say(msgNoAlertInformation,OT_ERROR)
        Return
EndIf
let sAlertInfo=FormatString(msgAlertLevel,IntToString(iAlertLevel),sAlertText)
Say(sAlertInfo,OT_SCREEN_MESSAGE)
EndScript

Void Function ShowInViewer (string sText)
if !sText then
        Say(msgTextNotAvailable,ot_status)
        return
EndIf
if UserBufferIsActive() then
        UserBufferDeactivate()
EndIf
UserBufferClear()
UserBufferAddText(sText+cscBufferNewLine+cscBufferNewLine+msgBufferCloseLink)
UserBufferActivate()
JAWSTopOfFile()
SayAll()
EndFunction

Script ManualCheckForTyping ()
CheckForSomeoneTyping (true)
EndScript

void function ObjStateChangedEvent (handle hObj,int iObjType,int 
nChangedState,int nState, int nOldState)
var
        string sObjDesc,
        string sObjName
let sObjName=GetObjectName()
If iObjType == wt_CheckBox Then
        If (StringContains(sObjName,onRemember)
        || StringContains(sObjName,onSignInAutomaticallyCheckBox)) Then
                Return
        EndIf
EndIf
If giIsInContactList then
        Return
EndIf
If iObjType == wt_ListBoxItem Then
        If (StringContains(GlobalRealWindowName,wn_ContactPickerDialog)
        || StringContains(GlobalRealWindowName,wn_InviteSomeone)
        || StringContains(GlobalRealWindowName,wn_SendAnInstantMessage)) Then
                let sObjDesc=GetObjectDescription(TRUE)
                If StringContains(GetObjectName(),scNotSelected) Then
                        Let sObjDesc=cmsg_NotChecked+cscSpace+sObjDesc
                Else
                                        Let 
sObjDesc=cmsg_Checked+cscSpace+sObjDesc
                EndIf
                Say(sObjDesc,OT_SCREEN_MESSAGE)
        EndIf
    ; announcement of checkboxes in the list in Create Group dialogue.
    If StringContains(GlobalRealWindowName, WN_CreateNewGroup) then
      IndicateControlType (WT_CHECKBOX, GetLine ())
      If nState then
        IndicateControlState (WT_CHECKBOX, 1)
      Else
        IndicateControlState (WT_CHECKBOX, 2)
      EndIf
    EndIf
  Return
EndIf
ObjStateChangedEvent (hObj,iObjType,nChangedState,nState, nOldState)
EndFunction

String Function ProcessMyEmoticonsItems ()
var
        int iState,
        int iEnd,
        string sLastSegment,
        string sEmoticon
let iState=GetJcfOption(opt_indicate_selected)
SetJcfOption(opt_indicate_selected,0)
let sEmoticon=GetObjectName()
let sLastSegment=StringSegment(sEmoticon,cscSpace,-1) ; Gets last item in 
string.
let iEnd=StringContains(sEmoticon,sLastSegment)+StringLength(sLastSegment)
let sEmoticon=SubString (sEmoticon, 1, iEnd)
SetJcfOption(opt_indicate_selected,iState)
Return sEmoticon
EndFunction

void Function SayTreeViewLevel ()
If GlobalWindowClass == cwc_DirectUiHwnd Then
        Return
EndIf
SayTreeViewLevel()
EndFunction

Script UpALevel ()
if UserBufferIsActive() then
        UserBufferDeactivate()
        Return
EndIf
If !IsInConversationWindow() Then
        StopAnyTypingTicks()
EndIf
PerformScript UpALevel()
EndScript

Void Function ActiveItemChangedEvent (handle curHwnd, int curObjectId, int 
curChildId,  handle prevHwnd, int prevObjectId, int prevChildId)
var
        string sObjName,
        int iObjType
If GlobalWindowClass  == cwc_DirectUIHWND Then
        let iObjType=GetObjectSubTypeCode()
        let sObjName=GetObjectName()
        If (StringContains(GlobalRealWindowName,wn_Winks)
        || StringContains(GlobalRealWindowName,wn_Backgrounds)) Then
                Return
        EndIf ; End of My Winks and My Backgrounds.
        If StringContains(GlobalRealWindowName,wn_Emoticons) Then
                Return
        EndIf ; End of My emoticons
        If iObjType == wt_TreeViewItem Then
                If StringContains(sObjName,scLessThan) Then
                        let sObjName=SubString (sObjName, 1, 
StringContains(sObjName,scEmailStartPoint))
                EndIf
                If !giShowContactListOnlineStatus Then
                        let 
sObjName=StringReplaceSubStrings(sObjName,scOnline,cscNull)
                EndIf
                If StringContains(sObjName,scMobile) Then
                        Say(GetLine()+cscSpace+scMobile,ot_screen_message)
                        Return
                EndIf
                Say(sObjName,OT_SCREEN_MESSAGE)
                Return
        EndIf ; End of tree view
EndIf
If StringContains(GlobalRealWindowName,wn_Emoticons)
&& !InHJDialog () Then
        Return
EndIf
ActiveItemChangedEvent 
(curHwnd,curObjectId,curChildId,prevHwnd,prevObjectId,prevChildId)
EndFunction

Void function DialogPageChangedEvent(HANDLE hwndNewPage,HANDLE hwndOldPage)
If GetWindowSubTypeCode(GetFocus()) == wt_ListView
&& StringContains(GlobalRealWindowName,wn_Options) Then
        Return
EndIf
DialogPageChangedEvent (hwndNewPage,hwndOldPage)
EndFunction

Void Function SayHighlightedText (handle hwnd, string buffer)
var
        int iObjSubType
let iObjSubType=GetObjectSubTypeCode()
If iObjSubType == wt_ListBoxItem  Then
        Return
EndIf
If iObjSubType == wt_EditCombo Then
        Return
EndIf
SayHighlightedText(hwnd,buffer)
EndFunction

Script JAWSHome()
PerformScript JAWSHome()
If giIsInContactList Then
        let giUseObjectInfo=TRUE
EndIf
EndScript

Script JAWSEnd()
PerformScript JAWSEnd()
If giIsInContactList Then
        let giUseObjectInfo=TRUE
EndIf
EndScript

String Function RetrieveDialogStaticText (handle hDialog, string 
sSegmentSeparator, int iIndex)
var
        string sDialogText
let sDialogText=GetWindowTextEx(hDialog,FALSE,TRUE)
; If the buttons need to be stripped from the dialog text...
If StringLength(sSegmentSeparator) Then
        let sDialogText=StringSegment   (sDialogText,sSegmentSeparator,iIndex)
EndIf
Return sDialogText
EndFunction

Int Function BrailleAddObjectQuickSearchEditField (int nSubTypeCode)
If gbInQuickSearchField
|| gsBrlQuickSearchFieldText != cscNull Then
; In QS field and field is not empty...
        BrailleAddString 
(gsBrlQuickSearchResults,GetCursorCol(),GetCursorRow(),attrib_highlight)
        Return TRUE
EndIf
Return FALSE
EndFunction

Int Function BrailleAddObjectName (int nSubTypeCode)
var
        handle hWnd,
        string sName
If gbInQuickSearchField Then
        Return TRUE
EndIf
if nSubTypeCode == wt_button then
        let sName = GetObjectName(true)
        if StringCompare(sName,objn_ChangeSound) == 0 then
                
BrailleAddString(GetObjectName(0,2)+cscSpace+sName,GetCursorCol(),GetCursorRow(),attrib_highlight)
                return true
        EndIf
elif nSubtypeCode == wt_RadioButton then
        let hWnd = GetFocus()
        if IsOptionsLayoutRadioButton(hWnd) then
                
BrailleAddString(GetOptionsLayoutRadioButtonMainGroupName(hWnd),0,0,0)
                
BrailleAddString(GetOptionsLayoutRadioButtonSubGroupName(hWnd),0,0,0)
                
BrailleAddString(GetOptionsLayoutRadioButtonName(hWnd),GetCursorCol(),GetCursorRow(),attrib_highlight)
                return true
        EndIf
EndIf
return BrailleAddObjectName (nSubTypeCode)
EndFunction

string function GetCustomTutorMessage()
if GetWindowClass(GlobalFocusWindow) == cwc_DirectUIHWND then
        if StringCompare(GetObjectName(true),objn_ChangeSound) == 0 then
                return msgButton
        EndIf
EndIf
return cscNull
EndFunction

void Function SayObjectTypeAndText (int nLevel)
var
        string sObjName,
        string sObjDescription,
        string sObjState,
        string sWinClass,
        int iObjSubType
If InHomeRowMode()
|| !IsPcCursor()
|| UserBufferIsActive() then
        SayObjectTypeAndText (nLevel)
        Return
EndIf
if IsOptionsChangeSoundButton() then
        
IndicateControlType(wt_button,GetObjectName(0,2)+cscSpace+GetObjectName(1),cscSpace)
        return
ElIf IsOptionsLayoutRadioButton(GetCurrentWindow()) then
        if SayOptionsLayoutRadioButton(true) then
                return
        EndIf
EndIf
let sWinClass=GetWindowClass(GlobalFocusWindow)
If sWinClass == cwc_DirectUIHWND Then
        let sObjName=GetObjectName(TRUE)
        If GlobalMenuMode == MENU_ACTIVE Then
                Say(sObjName,ot_screen_message)
                Return
        EndIf
        let sObjDescription=GetObjectDescription(TRUE)
        let iObjSubType=GetObjectSubTypeCode(TRUE)
        let sObjState=GetObjectState(TRUE)
        If iObjSubType == wt_Static then
                Say(sObjName+cscSpace+GetObjectValue(),ot_screen_message)
                Return
        ElIf iObjSubType == wt_ListBoxItem  Then
                Return
        ElIf iObjSubType == wt_TreeViewItem Then
                If !giShowContactListOnlineStatus Then
                        let 
sObjName=StringReplaceSubStrings(sObjName,scOnline,cscNull)
                EndIf
                If StringContains(sObjName,scMobile) Then
                        let sObjName=GetLine()+cscSpace+scMobile
                EndIf
                Say(sObjName,OT_SCREEN_MESSAGE)
                Return
        elif iObjSubType == wt_edit then
                if sObjName == scEmailButton then
                        MSAARefresh()
                        Delay(1)
                        SayObjectTypeAndText(nLevel)
                        if !GetObjectValue(1) then
                                Say(sObjDescription,OT_SMART_HELP)
                        EndIf
                        return
                EndIf
        EndIf
        If sObjName == scNudgeButton
        || sObjName == scSharingFoldersButton
        || sObjName == scMyOwnSpaceButton Then
                let iObjSubType=wt_Button
        ElIf sObjName == scActivitiesButton
        || sObjName == onMyStatusButton
        || sObjName == scGamesButton
        || sObjName == scColorSchemeButton
        || sObjName == scEmoticonsButton
        || sObjName == scWinksButton
        || sObjName == scPacksButton
        || StringContains(sObjName,scPersonalMessageOptionsButton)
        || StringContains(sObjName,scSearchVerticals)
        || sObjName == scBackGroundsButton
        || sObjName == scStatusButton
        || sObjName == scManageYourContactsButton Then
                let iObjSubType=wt_ButtonMenu
        EndIf
        If StringContains(sObjName,scColorSchemeButton)  Then
                let sObjName=scColorScheme
        ElIf StringContains(sObjName,scSearchVerticals) Then
                let sObjName=scSearchOptionsButton
        ElIf StringContains(sObjName,scSharedSearchButton) Then
                let sObjName=scSharedSearch
        ElIf StringContains(sObjName,scSendButton) Then
                let sObjName=scSend
        EndIf
        If StringContains(GlobalRealWindowName,wn_EditContact) Then
                let sObjName=StringReplaceSubstrings (sObjName, scTab, cscNull)
        EndIf
        If iObjSubType == wt_Menu Then
                Say(sObjName,ot_line)
                Return
        EndIf
        IndicateControlType(iObjSubType,sObjName,sObjState)
        If StringContains(GlobalRealWindowName,wn_EditContact)
        || sObjName == scStatusButton Then
                Say(GetObjectValue(),ot_screen_message)
        EndIf
        ; The search edit field tries to grad the description of the search 
button...
        If StringContains(sObjName,wn_MsnSearchText) Then
                Return
        EndIf
        ; If beginner-level verbosity, and the name isn't the same as the 
description...
        If giVerbosityLevel == BEGINNER
        && StringCompare(sObjName,sObjDescription) != 0 Then
                Say(sObjDescription,OT_SMART_HELP)
        EndIf
        Return
EndIf ; End of DirectUI window.
SayObjectTypeAndText(nLevel)
EndFunction

Script SayAll (optional int bIgnoreUseSAPI5DuringSayAllOption)
If !GlobalMenuMode
&& IsPcCursor()
&& !IsVirtualPcCursor()
&& GetWindowClass(GetFocus()) == cwc_DirectUIhWND
&& GetObjectSubtypeCode() == wt_Multiline_Edit then
        SayLine()
        return
EndIf
PerformScript SayAll (bIgnoreUseSAPI5DuringSayAllOption)
EndScript

Other related posts: