Index: src/orca/script.py
===================================================================
--- src/orca/script.py	(revision 1986)
+++ src/orca/script.py	(working copy)
@@ -88,6 +88,16 @@
 
         self.findCommandRun = False
 
+        # Assists with dealing with CORBA COMM_FAILURES.  A failure doesn't
+        # always mean an object disappeared - there just might be a network
+        # glitch.  So, on COMM_FAILURES, we might retry a few times before
+        # giving up on an object.  This might need to be overridden by the
+        # script.  See bug #397787.
+        #
+        self.commFailureWaitTime = 0.1
+        print "script: __init__: setting limit to 5."
+        self.commFailureAttemptLimit = 5
+
         debug.println(debug.LEVEL_FINE, "NEW SCRIPT: %s" % self.name)
 
     def getListeners(self):
Index: src/orca/settings.py
===================================================================
--- src/orca/settings.py	(revision 1986)
+++ src/orca/settings.py	(working copy)
@@ -445,14 +445,6 @@
 timeoutTime             = 10   # a value of 0 means don't do hang checking
 timeoutCallback         = None # Set by orca.py:init to orca.timeout
 
-# Assists with dealing with CORBA COMM_FAILURES.  A failure doesn't
-# always mean an object disappeared - there just might be a network
-# glitch.  So, on COMM_FAILURES, we might retry a few times before
-# giving up on an object.
-#
-commFailureWaitTime     = 0.1
-commFailureAttemptLimit = 5
-
 # Keyboard double-click period. If the same key is pressed within
 # this time period, it's considered to be a double-click and might
 # provide different functionality (for example, Numpad 5 double-click
Index: src/orca/focus_tracking_presenter.py
===================================================================
--- src/orca/focus_tracking_presenter.py	(revision 1986)
+++ src/orca/focus_tracking_presenter.py	(working copy)
@@ -453,7 +453,7 @@
         #
         retryCount = 0
         oldLocusOfFocus = orca_state.locusOfFocus
-        while retryCount <= settings.commFailureAttemptLimit:
+        while retryCount <= orca_state.activeScript.commFailureAttemptLimit:
             try:
                 if not event.source.state.count( \
                                       atspi.Accessibility.STATE_ICONIFIED):
@@ -508,7 +508,7 @@
                               "COMM_FAILURE above while processing: " \
                               + event.type)
                 retryCount += 1
-                if retryCount <= settings.commFailureAttemptLimit:
+                if retryCount <= orca_state.activeScript.commFailureAttemptLimit:
                     # We want the old locus of focus to be reset so
                     # the proper stuff will be spoken if the locus
                     # of focus changed during our last attempt at
@@ -517,7 +517,7 @@
                     orca_state.locusOfFocus = oldLocusOfFocus
                     debug.println(debug.LEVEL_WARNING,
                                   "  TRYING AGAIN (%d)" % retryCount)
-                    time.sleep(settings.commFailureWaitTime)
+                    time.sleep(orca_state.activeScript.commFailureWaitTime)
                 else:
                     debug.println(debug.LEVEL_WARNING,
                                   "  GIVING UP AFTER %d TRIES" \
Index: src/orca/scripts/StarOffice.py
===================================================================
--- src/orca/scripts/StarOffice.py	(revision 1986)
+++ src/orca/scripts/StarOffice.py	(working copy)
@@ -620,6 +620,13 @@
         #
         self.currentParagraph = None
 
+        # Set the number of retries after a COMM_FAILURE to 1. The default
+        # of 5 was not allowing Orca to be responsive in the event of OOo
+        # going into crash recovery mode (see bug #397787).
+        #
+        print "StarOffice: __init__: setting limit to 1."
+        self.commFailureAttemptLimit = 1
+
         # The default set of text attributes to speak to the user. The
         # only difference over the default set in settings.py is to add
         # in "left-margin:" and "right-margin:".
