6 Replies Latest reply on Mar 29, 2014 2:09 PM by trm1945

    Written record of running scripts.

    trm1945

      Is there a plug in or some other software that would provide a written record of script execution? I'd like to see what just happened in a long series of scripts calling scripts because something isn't working right. A written record that is easy to follow would really help in debugging.

        • 1. Re: Written record of running scripts.
          Malcolm

          There is a script debugger and and variable console built into FileMaker Pro Advanced.

           

          Malcolm

          • 2. Re: Written record of running scripts.
            Mike_Mitchell

            This is really two questions:

             

            1) Can I keep a log of script execution?

             

            2) Can I see what a script or series of scripts is doing as they're executing?

             

            #2 Malcom has already answered for you. #1 can be implemented using a script logging table. Basic concept is to record when a script is entered, when it is exited, any parameters, any error codes, and / or any script results in a log table. Ray Cologon has an example on his web site (www.nightwing.com.au), which I can't connect to at the moment, or I'd give you a specific link. Should be easy enough to find. though.

             

            HTH

             

            Mike

            • 3. Re: Written record of running scripts.
              trm1945

              I went to the site: www.nightwing.com.au but didn't find anything. I think you see what I need in statement #1:

               

              1) Can I keep a log of script execution?

               

              That's all I want and so far, can't do because I don't know how.

               

                 I got myself into a series of script calls that end up running some scripts twice and it would be easy to fix if I could see the script execution without resorting to longhand notes.

                 I've used Script Debugger and it helps but I end up as the manual step logger and triggers are a nuisance during the process for me at least.

              • 4. Re: Written record of running scripts.
                erolst

                A long series of scripts calling other scripts and you losing track may be a sign that you should rewrite/restructure/rethink your scripts and/or your data structure, if it makes these convolutions necessary in the first place. Just a suggestion to look at the possible causes before trying to live with the symptoms …

                trm1945 wrote:

                I've used Script Debugger and it helps but I end up as the manual step logger and triggers are a nuisance during the process for me at least.

                 

                Don't forget that in the Debugger you can …

                 

                • set breakpoints (unconditional only …)

                 

                • have the script halt on error

                 

                • set conditional breakpoints near problem spots by adding something like

                If [ someExpressionIsTrue ]

                Comment [ "add a breakpoint to this step" ]

                End If

                 

                A bit convoluted, since you can't do it in the debugger, but rather need to edit the script, but it gets the job done.

                 

                And of course, use the Debugger in tandem with the Data Viewer, where you can see the currently used fields/variables and their values, and add arbitrary custom expressions.

                • 5. Re: Written record of running scripts.
                  Order_from_Chaos

                  I second the use of a log table to record this information. Create a table with entries for what is important to you - I usually record the script name, time it was called, parameters passed and the name of the calling script if there is one. I create a script that pulls this information and call it at the beginning of each script where it logs the info and timestamps execution. The script is called again when each script is exited where it logs any errors and exit timestamp. I also have it check a flag ($$GlobalVariable) so I can turn script logging on and off. Very helpful in reviewing problems like you mention.

                   

                  Brett

                  • 6. Re: Written record of running scripts.
                    trm1945

                    The Speak step is usefull and I have put that into scripts so that the script name is spoken as the script is called. I do have one script that is called twice during a return to the source point but removing one of these calls screws up another area of the program due to shared scripts. There is more than one of these script call duplications but the process of figuring out what to delete is tedious and so far, has implications in other parts of the program. That's why I'd like the simple solution of a program generated "This is what I just did" series of steps printed on a sheet of paper. Can I do this?