8 Replies Latest reply on Nov 10, 2016 7:50 AM by walt105

    Reading Text Crashes FM

    wjmartin

      I had this problem with FM12 and it continues on FM13. I have a script that reads (text to speech) a line of text just before it carries out a further action. I have found that occasionally this script stops just at the speech instruction and Filemaker crashes - spinning beach-ball of death, I have to force quit FM, relaunch and carry on.

       

      I use this 'speak and then act' approach on several different DBs using different scripts and this crashing behaviour seems to be associated with the text to speech.

       

      Does anyone have any thoughts on what might be causing it?

        • 1. Re: Reading Text Crashes FM
          PeterWindle

          I presume you're talking Fm 12 and 13 on Mac.

           

          I've tried a basic script that talks text then does something else and I can't replicate any problems.

           

          What are your HW/OS system specs?

          • 2. Re: Reading Text Crashes FM
            wjmartin

            The problem is occuring across a spread of Mac platforms. A mix of OS 10.8 and 10.9 and FM12 and FM13.

             

            The thing is it is very sporadic. I can process twenty records with no errors, and then bang, Filemaker falls over. I restart FM and it carries on again like nothing happened, until the next time...

            • 3. Re: Reading Text Crashes FM
              wjmartin

              I forgot to say - the DB is hosted by FMSA12

              • 4. Re: Reading Text Crashes FM
                PeterWindle

                Are you always processing lots of records ?

                 

                I'm no "expert" on this, but I'd be doing a flush cache to disk step after each "talk"

                • 5. Re: Reading Text Crashes FM
                  wjmartin

                  Thanks Peter, I will give that a try. It might take a while to see if it works.

                  • 6. Re: Reading Text Crashes FM
                    hschneider66

                    I have the same problem here. Flushing the cache does not cure it ....

                    • 7. Re: Reading Text Crashes FM
                      hschneider66

                      I made a workaround !

                       

                      Instead of using the builtin Talk(), I am using Applescript:

                       

                      Fehleraufzeichnung setzen [ Ein ]

                      Variable setzen [ $s; Wert:Austauschen(Hole(ScriptParameter); Char(34); "" ) ]

                      AppleScript ausführen [ Berechnetes AppleScript: "say \"" & $s & "\"" ]

                       

                      The Filemaker script is called with the text to speak as a parameter.

                       

                      Sorry for the listing in german. I am running the localized version here ...

                       

                       

                      -- Harald

                      • 8. Re: Reading Text Crashes FM
                        walt105

                        Hi Harald, I found your applescript workaround because I have the same problem. I am not a programmer, but would love to use your workaround in my script. Sadly I have not been able to get it working. Maybe you could help?

                         

                        What I am trying to do: I have used 'speak' in a looped script, but after a few loops it freezes. This is reported by Benjamin Fehr and others. See https://community.filemaker.com/thread/137910

                        This discussion also mentions a workaround using an AppleScript,.

                         

                        1. First problem is that I found 3 different versions of the workaround, with different spacing of "" and " ".

                         

                        Example workaround:

                        Set Error Capture [ On ]

                        Set Variable [ $speak ; Value: Substitute ( Get (ScriptParameter) ; Char (34) ; "" ) ]

                        Perform AppleScript [ "say \" " & $speak & " \"" ]

                         

                        2. I don't know if the workaround is meant to be instead of "Speak" or in addition of.

                         

                        3. Clearly I am not a programmer, but I hope to be able to use the workaround. Below is the script I have so far. I tried out various versions of the workaround but no luck yet.

                         

                         

                        -----------------------

                        # Animation of layout. Place script in Manage> Layout> Script triggers, OnLayoutEnter.

                        Adjust Window [ Maximize]

                        Show All Records

                        Sort Records

                        Go to Record [First]

                        Loop

                         

                            #If any ActiveModifierKey is hold down during the Loop the script will exit.

                            If [Get (ActiveModifierKeys)>= 4 ]

                                Show Custom Dialogue ["Exit Script"; ]

                                If [Get (LastMessageChoice) = 1 ]

                                    Exit Script

                                End If

                            End If

                         

                            #Each record is shown for x (duration) seconds by pausing the script.

                             Pause/Resume Script [Duration (seconds): 5.3 ]

                             Go to Record [Next ; Exit after last ]

                            

                             # Here I placed "Speak", which worked but after about 20-30 records causes FM to freeze.

                            speak [ fieldname ]

                         

                        End Loop.

                        ----------------------------

                         

                         

                        Many thanks in advance.