App Programming‎ > ‎

Calling

Making Phone Calls on your Mobile Platform

We use the Launch Command to make a phone call. By specifying "tel:<phone number>" in the launch command, we can open up the dialer with the phone number.

e.g.
        Launch url "tel:8005551212"
        launch url "tel:800 555 1212"

as in:

on mouseUp
       launch url "sms:8005551212"
end mouseUp

or to be a bit more formal with variables (if you were getting the number from a text field or looking it up:

on mouseUp
       put "8005551212" into myNumber
       put "sms:" & myNumber into myUrl
       launch url myUrl
end mouseUp


Sending Text Messages

We use the Launch Command to send a text message. We have to first set up the sending information before launching the "SMS" application
ake a phone call. By specifying "sms:<phone number+message>" in the launch command, we can open up the SMS app to send the message.

e.g.
    
        launch url "sms:8005551212?body="This is my message"

on mouseUp
       put "This is a text message." into field "msg"
       put the htmlText of the field "msg" into myText
       launch url "sms:8005551212?body=" & myText
end mouseUp

or to be a bit more formal with variables (if you were getting the number from a text field or looking it up:

on mouseUp
       set the text of the templatefield to "This is a text message."
       put the htmlText of the templateField into myText
       put "8005551212" into myNumber
       put "sms:" & myNumber & "?body=" & myText into myUrl
       reset the templateField
       launch url myUrl
end mouseUp

Comments