6 Replies Latest reply on Dec 26, 2013 5:35 AM by HubertWagner

    Calculated AppleScript to Dial out in Skype

    HubertWagner

      Title

      Calculated AppleScript to Dial out in Skype

      Post

           Hello :

           The following script in FMP9 aims to pass the contents of a "phone number" field to Skype and have it dialed.

           "set pN to " &  ( HDMW DB::Phone ) & ¶ &

            

           "tell application \"Skype\"¶" &

           "send command \"CALL \"  &  pN & \" script name \"Dial Skype\"¶" &

           "end tell"

            

           This produces the error :

            

           A number can’t go after this number

           -2740

            

           I expect I'm not escaping correctly. 

           Anyone see the error?

            

           Regards : HDMW

        • 1. Re: Calculated AppleScript to Dial out in Skype
          Jade

               Try changing the first and second lines to:

               "tell application \"Skype\"" & ¶ &

               "send command \"Call \"" & pN & " script name \"Dial Skype\"" & ¶ &

                

          • 2. Re: Calculated AppleScript to Dial out in Skype
            HubertWagner

                 Hello Jade :

                 Thank you for your suggestion.

                 I get the error : specified table pN cannot be found.

                 This may mean I've not defined the source of the variable correctly. I have :

                  

                 "set pN to " &  ( HDMW DB::Phone ) & ¶ &

                  

                 Regards : HDMW

            • 3. Re: Calculated AppleScript to Dial out in Skype
              Jade

                   Then try:

                   "send command \"Call  \"" & HDMW DB::Phone & " script name \"Dial Skype\"" ¶ &
                    

              • 4. Re: Calculated AppleScript to Dial out in Skype
                HubertWagner

                     Hello Jade :

                     Same problem :

                      

                     A number can’t go after this number

                     -2740

                      

                     Assuming we have the escapes correct, the problem appears to be passing a variable to Applescript. I wonder if FMP9 is capable of allowing that?

                      

                     (It would help if FMP alerts were a little less obtuse).

                      

                     Regards : HDMW

                • 5. Re: Calculated AppleScript to Dial out in Skype
                  Jade

                       Yes, this is somewhat of a black art especially since I do not know the correct syntax for the Call command for Skype ;-).   It is possibly more related to properly passing the variable, pN, in the "send command" than to the Applescript.   It can also be that the phone number is not in the expected format.   Have you run the Applescript from the AppleScript Editor outside of FMP to check the syntax?

                       At this point, I can only suggest trying:

                       "send command \"Call pN script name \"Dial Skype\"\"" &  ¶ &

                  • 6. Re: Calculated AppleScript to Dial out in Skype
                    HubertWagner

                         Hello Jade :

                         No go.

                         This time the error is :

                         An operator (e.g. +,-,*,…) is expected here.

                         I wonder how many thousands of man hours are wasted by folk trying to figure out what these arcane error messages refer to.

                         I've Googled the problem and find there are many others with similar difficulties.

                         I believe the next step is to eMail Filemaker and ask if the procedure is possible.

                         Thank you for your patience and assistance.

                         Regards : HDMW