4 Replies Latest reply on Jun 23, 2010 11:17 AM by TSGal

    Applescript compiles in FM10 but not in FM11

    accolude

      Summary

      Applescript compiles in FM10 but not in FM11

      Description of the issue

      Objective: Transfer text from a FileMaker text field into QuarkXpress text box.Software: Mac OS 10.5.8, FileMaker Pro Advanced 11.0v1, QuarkXpress 6.5Computer: MacBook Pro 2.4Ghz IntelExperience: I've been developing database solutions for 12 years. Problem: The applescript created in Mac's Applescript Editor compiles and executes successfully. The same applescript text is added to FileMaker's Perform Applescript function and it will not compile. Troubleshooting: Commenting out the first line of error results in another error a few lines down.Created new database and new script in FileMaker Pro Advanced 10.0v3 and it works fine.Created new database and new script in FileMaker Pro Advanced 11.0v1 and it doesn't work. Note: For testing purposes the code was simplified to import only the word "test" instead of the contents of a text field. ----- BEGIN APPLESCRIPT CODE -----tell application "QuarkXPress"        -- This section will ensure that a document is open, before proceeding    if not (exists document 1) then        activate        beep        beep        display dialog "No document is open." buttons {"OK"} default button 1 with icon stop        return    end if        -- This section will ensure that a single text box is selected    if not (exists current box) or box type of current box is not «constant ETBTTXTx» then        beep        beep        activate        display dialog "A single text box must be selected." buttons {"OK"} default button 1 with icon stop        return    end if        -- Note: When import styles is true text will be imported as XPress Tags format    --activate    set import styles to true        set thepage to the name of the front document    tell document thepage        --set info to the properties of the current box        set box1 to the current box        if (count of paragraphs of box1) > 1 then            set last paragraph of box1 to "test"        else            set story 1 of box1 to "test"        end if    end tell        beepend tell----- END APPLESCRIPT CODE ----- Any assistance in finding a solution would be greatly appreciated.Thanks.       

        • 1. Re: Applescript compiles in FM10 but not in FM11
          TSGal

          accolude:

           

          Thank you for your post.

           

          Where does your sample script fail when executed from FileMaker Pro 11?  That is, what line in the code is generating the error message?  What is the exact error message?

           

          TSGal

          FileMaker, Inc.

          • 2. Re: Applescript compiles in FM10 but not in FM11
            accolude

            Line:     if not (exists current box) or box type of current box is not «constant ETBTTXTx» then

            Error:    Expected “,” but found identifier.

            (the underlined word is where the error is)

             

            If I "comment out" that whole "tell block" the next error is:


            Line:     set import styles to true

            Error:    A identifier can’t go after this identifier.

             

            if I comment out the previous error the next one is:

            Line:      set box1 to the current box

            Error:    Expected end of line, etc. but found identifier.

             

             

             

             

             

             

             

            • 3. Re: Applescript compiles in FM10 but not in FM11
              TSGal

              accolude:

               

              Thank you for the additional information.  I have forwarded this entire thread to our Development and Software Quality Assurance (Testing) departments for review.  When more information becomes available, I will let you know.

               

              TSGal

              FileMaker, Inc.

              • 4. Re: Applescript compiles in FM10 but not in FM11
                TSGal

                accolude:

                 

                Here is some additional information forwarded to me.

                 

                "In Apple Script editor, the implied application context is Script Editor.  When compiling the script in FileMaker, the context is always FileMaker.  When you are not explicit, there will be differences.  Any keywords you see bolded when looking at the FileMaker dictionary in Apple Script Editor are reserved words when FileMaker is the context.  Box is not reserved, but it follows 'current".  I don't recognize the ETBT TXTx signature.  Ask the user if he/she has a scripting addition installed that reserves box or current and being used to evaluate the words into objects."

                 

                TSGal

                FileMaker, Inc.