applescript unicode error

hi,
Ive found a website that allows me to send sms messages using a URL. So ive been writing a small script to take advantage of this, however when i go to run the app it throws up a unicode error and so doesnt want to play ball.
Can anyone identify where i have gone wrong? :


(*
Opens and compiles an sms text message to be sent over the web.
*)
property reciever : "number"
property text_to_be_sent : "Look i sent a text from my computer!"
property start_URL : "https://myaccount.voipcheap.com/clx/sendsms.php?username=username&password=password&from=number&to="
set reciever to display dialog "Who do you want to recieve the text" default answer reciever buttons {"Cancel", "Continue"} default button 2
property text_node : "&text="
set text_to_be_sent to display dialog "What do you want the text to say?" default answer text_to_be_sent buttons {"Cancel", "Continue"} default button 2

set target_URL to start_URL & reciever & text_node & text_to_be_sent
open location target_URL


Thanks

Hi,

display dialog returns a record {text returned:“”, button returned:“”},
you have to specify the text returned part


(*
Opens and compiles an sms text message to be sent over the web.
*)
property reciever : "number"
property text_to_be_sent : "Look i sent a text from my computer!"
property start_URL : "https://myaccount.voipcheap.com/clx/sendsms.php?username=username&password=password&from=number&to="
set reciever to text returned of (display dialog "Who do you want to recieve the text" default answer reciever buttons {"Cancel", "Continue"} default button 2)
property text_node : "&text="
set text_to_be_sent to text returned of (display dialog "What do you want the text to say?" default answer text_to_be_sent buttons {"Cancel", "Continue"} default button 2)

set target_URL to start_URL & reciever & text_node & text_to_be_sent
open location target_URL


Fantastic, thank you :slight_smile:
Would their be a way to run this from Terminal? So type sms_online.script followed by number followed by the message? or is that wishful thinking?

If not, would their be a way to close the opened window after the http request has been sent?

Thanks
Mathew

Yes you can run compiled scripts from Terminal.app with the osascript command. It allows also to pass parameters

I tried to run it but the error it threw back was:

Take a look at this thread

actually different thought, would it be possible to specify inside the script which web browser to open for the url?

tell application "myFavoriteWebBrowser" to open location "http://."