Simple MortScript Programming for Windows Mobile Smartphones

As a proud owner of Sprint's new Palm Treo 800w, I regularly subscribe to the treo|central forum for my phone. Now, there is a common sentiment expressed in PDA/Smartphone forums - not just the one I read. "Is there a one-[touch/button/tap/click] approach I can do to [some function]?" This potential function could be toggling the GPS, killing the current application, terminating all open programs, toggling PowerVision/EVDO/GPRS/EDGE/UMTS/HSDPA, soft resetting, etc. If you're lucky, someone knows of a for-pay program that contains the requested function hidden in an obscure menu. But usually, the bulletin board thread ends with … silence (crickets chirping).

But don't concede yet! Once in a blue moon, if there is a high enough demand, somebody benevolently writes a program and releases it to the forum community. But why wait for that person? "Ask not what the hacker community can do for you. Ask what you can do for the hacker community!" Why not be that benevolent person? If there is not a way, make a way. Program it yourself!


The Keyword is Easy

Now before a reader hits the "X" button in defeat and intimidation, hear (or read) me out. The coding I am referring to is easy! It's even simpler than any variation of BASIC! Plus, when you learn this skill, you'll be able to do so much more with your phone. You'll be able to program for all other phones using Windows Mobile and even computers with nearly every modern version of Windows!


Okay, I lied just a little. The language I'm referring to is technically not a programming language. It's more like a glorified batch script. For the web programmers out there, think of it as a hybrid between PHP and a DOS-based batch file. Similar to PHP and DOS, you don’t even compile the code. This code is called "MortScript."

Basically, you download the MortScript interpreter and associate the *.mort and *.mortrun extensions. This is usually done automatically. Write a MortScript with the appropriate file extension and double click – or just plain tap for SmartPhones – the file.

Learning, Observing, and Applying the Skill

"Now how do I learn to code this allegedly simple script?" Like PHP, you read the manual. And – again like PHP – you'll find the manual is so easy to understand with many functions. Also, read the official treo|central Standards/Best Practices for MortScriptMortScript.

If you need inspiration or guidance, I've included a bunch of MortScripts that I personally wrote and use. Use them and assign them to a hardware button so you'll have a one-button access to that script.




  1. Connect("The Internet")



  1. # NOTE: This requires WrlsMgr.exe and may only work with Palm phones.
  2. Run( "\Windows\WrlsMgr.exe")
  3. SleepMessage(1,"Waiting to Wireless Manager to Open")
  4. SendRightSoft
  5. SendCR
  6. Close(ActiveWindow())

Open the Alarm Program:


  1. Run("\Windows\ctlpnl.exe","cplmain.cpl,16,2")

Close the Program on Top:


  1. Close(ActiveWindow())

Soft Reset the Phone:


  1. # NOTE: This is definitely convenient when the only way to reset is to pull the battery!
  2. Reset

Toggle the GPS (Location) On/Off:


  1. # NOTE: This may only work with the Palm Treo 800w.
  2. Run("\Windows\ctlpnl.exe","cplmain.cpl,20")
  3. SleepMessage(2,"Wating on Phone Settings to Open")
  4. SendUp
  5. SendRight
  6. SendDown
  7. SendDown
  8. SendDown
  9. SendCR
  10. SendDown
  11. SendCR
  12. SleepMessage(2,"Wating on Disclaimer to Display")
  13. SendLeftSoft
  14. SleepMessage(2,"Wating on Disclaimer to Close")
  15. SendOK
  16. SleepMessage(1,"Wating on Location to Close")
  17. SendOK

I'd love to know if any readers know of a better way to do the functions my scripts do. I know most of them utilize a Rube-Golberg-type approach. Also, if you have any questions, remarks, or if you just want to share your MortScript creations, please leave a comment below!

If you enjoyed this post, make sure you subscribe to hacker not cracker via RSS feed or email update!

Additional Reading

Comment View Comments from Other Readers

Popular Posts

Featured Posts

Related Posts

Recent Posts

What's Your Reaction?

Subscribe to this Blog:

Reader Reactions Elsewhere


Comments are closed.

© 2006 and web design of Allan Ray Barizo from [art] [⁄app].
This site is best viewed with FF and at least 1024x768 resolution.