The Problems
Although it's not used much in our environment, it is possible to send a text message (or SMS) from Skype and this hadn't been accounted for. Sending an SMS from a PC is relatively straight forward, but there's an added kink when using an iPhone: if you have the Skype app on your phone, how do you get it to use the texting functionality instead of going through the Skype app? The same goes for making phone calls: why use the Skype app when the iPhone is perfectly capable of making a phone call with its phone functionality? We had no choice but to fix it.
Again, we couldn't find any documented techniques to implement this, so it was a case of trial and error to figure out what URL calls would initiate the SMS on the various platforms. The same was true of how to direct a phone call to launch the phone app on an iPhone; some Googling implied it couldn't be done as Apple prevented cross app code calls. And finally, we needed to ensure that if an iPad was being used that it followed the same kind of path that the Mac or PC used as it didn't have phone or full SMS abilities (we're assuming here that iMessage is not full SMS capable.)
The Solution
The logic and steps we took to solve the problem are featured below, and a demo file and PDF document of the script are available for download showcasing the technique and laying out the script steps in detail. The basis for the scripts is the same as our original post so there's still a little intentional duplication in the scripts that could be condensed. And of course it's always possible to create different buttons for each function using just that section of the script to avoid the custom dialog boxes.
While in the grand scheme of things this is a very simple script, it's a bit more complex than the previous post due to the conditional arguments introduced to test for the phone field being a mobile/cell field and the iPhone/iPad differentiation. This script has been tested and is working with:
- Windows 8, FMP 12 and Skype 6.6.60.106
- Mac OS 10.7.5, FMP 12 and Skype 6.7.0.373
- iOS 6.1.4, FM Go 12.0.7 and Skype 4.10.332
It has not been tested on an iPad at this time. If anyone is able to do so, please let us know the outcome in the comments section below.
PC and Mac:
Because we're always using Skype on these platforms, the logic is the same but the URL calls differ as needed.
- Test for the platform the user is on
- Put the number to be dialed into a variable (including country code)
- Test the variable to ensure it is not empty and exit the script if so
- Test if the field is a mobile/cell phone field:
- If yes, then ask the user if they wish to send a SMS or make a call and act accordingly
- If no, then proceed directly to making a call to the number
Again, there are a few different elements to get right depending on which platform the script is being executed on:
- Windows Skype Out Calls: uses the Set Web Viewer script step with the URL being called starting with callto://+ (Note that Windows can also use Open URL and callto://+)
- Mac Skype Out Calls: uses the Set Web Viewer script step with the URL being called starting with skype:+
- Windows and Mac Skype SMS: uses the Set Web Viewer script step with the URL being called starting with skype:+ followed by the number and ending with ?sms
iOS - iPhone and iPad:
As per our previous post, this platform uses different URL calls and we have to test for iPad or iPhone and either use Skype or the built in iPhone apps accordingly.
- Test for the platform the user is on
- Put the number to be dialed into a variable (including country code)
- Test the variable to ensure it is not empty and exit the script if so
- Test if the field is a mobile/cell phone field:
- If yes then ask the user if they wish to send a SMS or make a call. Then test for iPad or iPhone and use the correct URL call
- If no then proceed directly to making a call to the number. Test for iPad or iPhone and use the correct URL call
Again, it's essential to get the URL calls and suffixes spot on or nothing will happen:
- iOS Skype Out Calls: uses the Open URL script step with the URL being called starting with skype:+
- iOS Skype SMS: uses the Open URL script step with the URL being called starting with skype:+ followed by the number and ending with ?sms
- iOS iPhone Calls: uses the Open URL script step with the URL being called starting with tel:
- iOS iPhone SMS: uses the Open URL script step with the URL being called starting with sms:+ followed by the number
As per our last post on this subject, we hope this and the demo and PDF document available for download help you integrate some Skype functionality into your database. If you have any tips to further improve the implementation, please leave a comment below or contact us. And if you need help with this or any other Filemaker issue, don't hesitate to get in touch and we'll be happy to give you a quote.
Download a demo file or PDF of the script below:
Filemaker-Skype integration demo file
Dial a phone number or send a SMS script PDF