Page 1 of 1

Using mobileComposeTextMessage

Posted: Sat Nov 16, 2013 12:14 pm
by DRJ-UK
Colleagues

We have been experimenting with this function and discovered there was a neat little trick that might be useful for others to be aware of. In most cases, a recipient's telephone number is not known when SMS is called from within the App. Therefore, on iOS 7 using

Code: Select all

mobileComposeTextMessage "","Message..."

opens the SMS pane but automatically includes "Buddy Name," as the first recipient (see snapshot). Not very friendly|
SMSrecipient.png
Screen shot from iPhone 5 running iOS 7
SMSrecipient.png (11.9 KiB) Viewed 2649 times
However, using

Code: Select all

mobileComposeTextMessage "?","Message..." 

ensures recipient list is empty with the text insertion point when SMS is called. This also has the advantage of forcing the text insertion point into the recipient field instead of after the body text on a device running iOS 6. You can then type a recipient name as usual. We have tested this with a few other non-alphanumeric characters with the same effect.

Please note this can only be tested on a device, not in the simulator. As yet this is not documented in the dictionary.

Dave

Re: Using mobileComposeTextMessage

Posted: Sat Nov 16, 2013 11:32 pm
by jacque
Interesting find. Could you add a user note to the dictionary? That way everyone will see it.

Re: Using mobileComposeTextMessage

Posted: Mon Nov 18, 2013 8:58 pm
by DRJ-UK
The issue has been posted as a bug report, which has been confirmed.

Will provide updates here in due course.

Dave