2 Replies Latest reply on Nov 3, 2009 3:28 PM by DanielWenger

    AppleScript from FM6 does not work in FM10

    peeter

      Summary

      AppleScript from FM6 does not work in FM10

      Description of the issue

      I am just testing FM10 and tried a script, that I have used for years without problem on sound, pictures and movies. It reads the file reference of a "Picture_A" cell (container field) and pasts it in the text field  "Sales". I have of course adjusted the name of the database from "Taxes_2009.fp5" to "Taxes_2009.fp7". So far, I have only found solution for FM-Versions prior to FM7 ... and those are in line with my approach.  The result is ERROR -1728 ... object not found.       tell application "FileMaker Pro"     set pictureFileRef to cell "Picture_A" of current record of layout "Sales" of database "Taxes_2009.fp5"     set cell "Path" of current record of layout "Sales" of database "Taxes_2009.fp5" to pictureFileRef as text     end tell  In case you wonder, why I am not using the entry-function for the path during the actual import of the picture. When I move pictures later on to other folders, the above script allows me to update the correct path and to open those pictures with Photoshop via button in FM6.  

        • 1. Re: AppleScript from FM6 does not work in FM10
          DanielWenger
            

          I too have an AppleScript problem in migrating to FMP 10. A Script that works well under FMP8 now no longer works.

           

          copy "CWData" to DBName

          tell application "FileMaker Pro"

          go to database DBName -- ERROR ON THIS LINE

           

          The error is "FileMaker Pro got an error: Object not found."

          CWData has been converted from FMP 8 to FMP 10. I have already tried using the name CWData.fp10 without success.

           

          • 2. Re: AppleScript from FM6 does not work in FM10
            DanielWenger
               I found the answer to this problem. When a FMP database file is converted go FMP 10, a hidden extension is added to the file name. In my case I had the file CWData.fp7 as the name of the original file. No hidden extension. After converting to FMP 10 the file became CWData.fp10. My AppleScripts did not work on the new file. After doing a Get Info on the file I saw that the true name of the file was CWData.fp10.fp7. The .fp7 was a hidden extension. After changing my AppleScript to include the hidden extension my scripts worked.