4 Replies Latest reply on Oct 8, 2009 12:44 PM by titanium76_1

    Filemaker and Applescripts under Snow Leopard

    chuckg@winternet.com

      Title

      Filemaker and Applescripts under Snow Leopard

      Post

      I should have known this would happen. Every time Apple comes out with a new OS my script for loading pictures into Filemaker breaks. Every time, and now Snow Leopard keeps up this dubious tradition.

      If this happened in Windoze, the whole world would be screaming about how incompetent they are. 

       

      So, after my script stops working following an install of Snow Leopard, I start monkeying with the script to make it work but now Applescript is saving scripts into ".app" directories and guess what? Filemaker won't execute them because it doesn't save the file name in the FileMaker script. Then when you run the script, it says "The file '<unknown>' could not be found..." Filemaker will still run the older script that was not recompiled but then the script doesn't work.

       

      Nice. 

       

        • 1. Re: Filemaker and Applescripts under Snow Leopard
          jbarnum
             I usually write my scripts in Script Editor but then paste them into the 'perform applescript' script step for exactly this reason - you don't have to keep track of external files. Especially helpful in multiuser environments; way better than going around to every user's desktop when there is a script change.
          • 2. Re: Filemaker and Applescripts under Snow Leopard
            chuckg@winternet.com
              

            Well I thought I knew almost everything about FileMaker and now I *am* just a little closer to everything.

            I'm sure I saw the 'perform applescript' command but I must just never have absorbed it.

             

            I copied the script (that worked under OS 10.5 and didn't work under 10.6) into the script step and and it worked under FileMaker. Bizarre, plus it was a screamer. I've never seen an Applescript work that fast on FileMaker altho it might be because I upgraded to FileMaker 10 to see if that would help.

             

            Thanks a bunch.

             

            Count so far:

            10.6 causes 5 things to break. (not just in FileMaker)

            3 down and 2 to go. 

            • 3. Re: Filemaker and Applescripts under Snow Leopard
              jbarnum
                

              Hi Chuck, the reason it's so much faster is because it doesn't have to actually launch another application (the AppleScript application) - it runs inside the FileMaker application, so there's no startup delay.

               

              I'm glad that worked for you! 

              • 4. Re: Filemaker and Applescripts under Snow Leopard
                titanium76_1
                  

                Here's one that's got me going mad. I have a calculated applescript to get the name of the local computer and paste it into a FileMaker field:

                 

                "tell application " & Quote("FileMaker Pro")  & ¶ & 

                "set theDoc to item 1 of (documents whose name starts with " & Quote(Get ( FileName )) & ")"  & ¶ & 

                "set cell "& Quote("OfficeLocation") & " of current record of layout " & Quote("devOrders") & " of theDoc to do shell script " & Quote("networksetup -getcomputername") & ¶ & 

                "end tell" 

                 

                this errors every time I run it, yet if I put it in as a native script, without the option for variables like:

                 

                tell application "FileMaker Pro Advanced"

                set theDoc to item 1 of (documents whose name starts with "ION")

                set cell "OfficeLocation" of current record of layout "devOrders" of theDoc to do shell script "networksetup -getcomputername"

                end tell 

                 

                ...it works perfectly fine.  This MUST be a Snow Leopard issue. When will it be fixed? Is there a workaround? I need to be able to use the variables for differing local computers. Ugh!!