![]() | ![]() | |
A script is like an application you can run. As an example, let's open the Partytime script:
| Series 60: | Navigate to Partytime and press the confirm button. |
| UIQ: | Select Partytime with the pen. |
This will show the script's empty console. To start the script:
| Series 60: | Press the confirm button again. |
| UIQ: | Press the button. |
![]() | ![]() | |
The script runs and prints Waiting... on the console. Now have a friend send you an SMS with the text "party". After a few seconds she should automatically receive a reply from you, sent from the Partytime script. In fact, the script acts as a very simple automatic SMS service.
Stop the script by selecting Process→Stop. You have just successfully used your first m script!
You can look at the script by selecting Process→Edit Source.
![]() | ![]() | |
If you want to change the reply message, or the text triggering the reply, simply edit the script. File→Save & Go will start the script again, with your changes. See section * () for details.
For your convenience, the complete script is printed here, with comments added:
|
/* A very simple m SMS service: anybody sending the keyword "party" will get a standard reply. */ use sms // we need it r="The party starts at 8pm!"; // our standard reply while true do // loop forever print "Waiting..."; // let the user know n=sms.receive(); m=sms.get(n); // get the next msg t=lower(trim(m["text"])); // isolate the word if t="party" then // if it's party, sms.send(m["sender"], r); // send the reply print "Replied to",m["sender"] // and log it end end |