Forum Archive

Text message app thanks to ccc

reefboy1

This is an app that I modded a bit. Original code was written by @ccc
This is my modded version

import clipboard, webbrowser
msg = 'I am texting you through pythonista!'
tel = raw_input('number ')  # can be a phone number or Apple ID
clipboard.set(msg)       # once iMessage opens, do a Paste into the message body
webbrowser.open('sms:' + tel)
pacco

Nice. Here's some UI-goodness wrapped around. (Caveat: Suffers from known bug that doesn't focus the alert input fields and I agree -- still not as nice as Editorial's builtin message-sender).

import clipboard, webbrowser,console,sys
msg = 'I am texting you through pythonista!'
tel='' 
try:
    tel=console.input_alert('Text Sender','Enter Tel #/AppleID',tel)
    msg=console.input_alert('Text Sender','Enter Msg text',msg).strip()
#   if len(msg) > 128:
#       console.hud_alert('Warning: SMS messages may be truncated)','error',2.00)
except Exception as e:
    sys.exit()
clipboard.set(msg)       # once iMessage opens, do a Paste into the message body
webbrowser.open('sms:' + tel)