2 Replies Latest reply on Jun 8, 2010 11:57 AM by TSGal

    Error message  is illegal as a formal parameter. unknown error -2716

    theresab

      Summary

      Error message  is illegal as a formal parameter. unknown error -2716

      Description of the issue

      FileMaker Product(s) involved:FileMaker Pro Advanced 11.0.1, FileMaker Pro Advanced 10.0.3Operating System(s) involved:Mac 10.6.3 Detailed description of the issue:The error message  is illegal as a formal parameter. unknown error -2716 is encountered when running the apple script from inside filemaker pro.Exact steps to reproduce the issue:1. In an existing or new database, create a new table like "AppleScripts" with a text field. 2. Add the script below as a new record in this table. Edit the below script as needed, but keep the parameter find in the function replaceText set FilePath to my replaceText(":", "/", theFilePath) on replaceText(Find, ReplaceWithThis, ThisSubject)--some codes hereset text item delimiters of AppleScript to Find--some codes herereturn ThisSubjectend replaceText 3. Create  new FMP script and insert a perform apple script command to run the created script above.4. The described error message will be encountered.5. Run the exactly the sample apple script in Apple Script Editor. 6. It should run as expected (without errors) 7. From the understanding that "FIND" is a reserved FMP word, replace the script parameter to something like on replaceText(theFindString, ReplaceWithThis, ThisSubject), update the script as needed.8. Run the fmp script that performs the apple script and run the same in Apple Script Editor. There will be no error. Expected Result:If exactly the same apple script is run regardless of whether in FMP or Apple Script Editor, it should produce the same. Actual Result:As above. Exact text of any error message(s) that appeared:As above. Any workarounds that you have found:do not use the word/string  FIND (and probably other FMP reserved word) as a parameter in apple script, although it may run correctly in Apple Script Editor, an illegal parameter error will be encountered in FMP that perform the apple script.

        • 1. Re: Error message  is illegal as a formal parameter. unknown error -2716
          TSGal

          theresab:

           

          Thank you for your post.

           

          I have forwarded the information to our Development and Software Quality Assurance (Testing) departments for review and confirmation.  Assuming this is a reserved word issue, I have asked for a list of reserved words so it can be documented.

           

          TSGal

          FileMaker, Inc.

          • 2. Re: Error message  is illegal as a formal parameter. unknown error -2716
            TSGal

            theresab:

             

            Here is some information I received from Testing...

             

            "This is likely reproducible in previous versions, too.  You should not use any object/command/property name that is defined in the Apple Script Dictionary for the Application (which you can view via Script Editor).  You cannot expect a script to be evaluate the same, because they are evaluated against different contexts.  That is, in Apple Scriipt Editor, the implied application context is Script Editor.  When compiling a script in FileMaker Pro, the context is always FileMaker.  When you are not explicit, there will be differences."

             

            No reserved list of words.  Just be aware of this issue when writing future AppleScripts.

             

            TSGal

            FileMaker, Inc.