3 Replies Latest reply on May 14, 2010 12:16 AM by BatMan

    Show layout during execution of script

    BatMan

      Title

      Show layout during execution of script

      Post

      Hello everybody. I'm executing a native AppleScript from within FM Pro 11 Advanced. That script is supposed to change the view to a certain layout, do some field manipulations there, and then switch back to the initial layout. The default behaviour seems to be that the intermediate layout is not actually drawn, i.e. the view gets refreshed only after the full script is finished. While this is the desired behaviour in most cases, it isn't in my particular case here. I would like to actually SEE the intermediate layout where the (quite time-consuming) data manipulation is done, to have some progress feedback. How can that be done in a native script? Is there a specific AppleScript / FM script command that forces FM to actually render the layout it is currently working in? Neither "show layout" nor "go to layout" seem to do that...

       

      Thank you for your help!

       

        • 1. Re: Show layout during execution of script
          aammondd

          You may be able to achieve the effect by putting short pause timers in your scripts

          I put a .01 second pause in my data manipulation script to test  this and it seems to work

           

          I created a Layout switch script (Now I didnt do this is Applescript but should work same way)

          a Pause Script with duration .01

          and a data  manipulation script that changes a field value in a loop 5000 times.

          I called the pause script in my layout switch and in my data manipulation script loop.

           

          The layouts are shown.

          • 2. Re: Show layout during execution of script
            aammondd

            Without the pause in the loop though you wont see the data manipulation more than likely.

            and even setting the value to .001 didnt seem to effect the speed .01 seems to result in the fastest I was going to get.

            Took about 3 minutes for a 5000 count loop and I wasnt doing anything more than setting a field value to "Testing"&$loopcounter

            But the pause after the layout switch and possibly at the end of the data manipulation will let observe the layout.

            Slows down the process considerably though.

            Without pause in the loop i did not see the data manipulation at all.

             

            • 3. Re: Show layout during execution of script
              BatMan

              Thank you for your response! I tried what you suggested, but it doesn't work in my case. The point is that I need to achieve this in a native AppleScript. To pause, a "do script" call to a FM script that does the pause is required. But it seems that FM first wants to finish its native AppleScript before executing the called FM script. This leads to the behaviour that the pauses are executed AFTER the data manipulation has finished, which renders them useless.

               

              I guess the FM script command "Refresh Window" should do what I want, but then again I need to call a FM script do do that, which is again postponed to the end of the whole AS...