4 Replies Latest reply on Apr 9, 2014 2:11 PM by DavidMoore

    Hmmm.....Script issue

    DavidMoore

      So, for some years now I've used Task Till Dawn ( http://www.oliver-matuschin.de/en/projects/detail/task-till-dawn ) to run a couple of Automator scripts/apps on a shedule. Works seamlessly in FileMaker 11 (and worked with Filemaker10, and Filemaker9). However, on Filemaker 13, it's a no-go.

       

      This particular Automator "app" calls for the following:

       

      on run {input, parameters}

       

      tell application "FileMaker Pro Advanced"

      do script "ServerForJames"

      end tell

       

      return input

      end run

       

       

      Again, in Filemaker 11 the thing runs seamlessly. Not so much (not at all, actually) in Filemaker 13.

       

       

      Anyone out there smarter than I want to chime in?

      Thanks as always...DM

        • 1. Re: Hmmm.....Script issue
          GAmstutz

          I tested your AppleScript code "as is" (created a script called "ServerForJames" that returned something generic), ran it under Mavericks and FMA 13, and it worked just fine.


          Did you recompile your Automator app after installing FMA 13?  AppleScript retains signatures of apps inside the compiled app to identify it, so when you upgraded from FMA 11 to 13, the FM app may have changed enough where it doesn't recognize the new version.  Recomiling your Automator app might fix it (keep FMA 13 open while recompiling just in case you have both versions of FMA on your Mac).

           

          Also -- probably an obvious question, but worth asking -- did you migrate your FM 11 database to FM 13 and do the converison?  If not, you should do that as well (FMA 13 -- if it's trying to open the not-yet-upgraded FM11 database, will probably fail when called from an Applescript module such as this).

           

          If all else fails, check to see if you have more than one database open.  If so, you might want to bring the database that contains your script frontmost before calling the rest of your script (it wouldn't hurt to have this extra line of code in there, just to make it more robust).  Do something like

           

          tell application "FileMaker Pro Advanced"

            show database "QT"

            do script "ServerForJames"

          end tell

           

          but substitute QT with your real database name.  This will make sure the 'proper' database is active before calling the script that it contains.

           

          Finally, are you getting an error message?  If so, can you post that so we can help you resolve the problem for you if these suggestions don't help?

           

          - Gary Amstutz

          • 2. Re: Hmmm.....Script issue
            sporobolus

            on 2014-04-09 14:17 DavidMoore wrote

            on run {input, parameters}

             

            tell application "FileMaker Pro Advanced"

            do script "ServerForJames"

            end tell

             

            return input

            end run

             

            >

            Again, in Filemaker 11 the thing runs seamlessly. Not so much (not at all, actually) in Filemaker 13.

             

            my hunch is that FileMaker 11 was lenient and looked for the ServerForJames

            script in the frontmost open database file, and FM13 is being more strict; i'd

            try being explicit about the context, something like this:

             

            tell app "FileMaker Pro Advanced"
               tell front database
                 do script "ServerForJames"
               end tell
            end tell
            

             

            • 3. Re: Hmmm.....Script issue
              DavidMoore

              Gary, thanks. Yes this entire solution has been converted to 13 from 11.

               

              Looks like you extra line of code ( show database) did the trick. Interesting in no prior versions of Filemaker (9-11) was that step necessary. Wonder what changed...

               

              Be that as it may, I thank you profusely for the quick response to a niggling "today's issue."

               

              Be well.

              • 4. Re: Hmmm.....Script issue
                DavidMoore

                Steve - that's the answer!

                 

                Thanks for chiming in.

                 

                DM