Home | Stories | Reviews | Treo™ Store | Accessories | Software | Discussion | Mobile | About | Search

 
 
Cruiser Bluetooth Car Kit Speakerphone Jabra Cruiser Bluetooth Car Kit Speakerphone
Just $89.95
Cradle w/ Spare Battery Slot Mobi Products Cradle w/ Spare Battery Slot for Treo Pro
Just $24.95
Media Cable for iPod RedFly Media Cable for iPod for Treo Pro, Treo 800w, Treo 750, Treo 700wx, Treo 700w
Just $29.95
Stylus (2 Pack) Palm Stylus (2 Pack) for Treo Pro
Just $14.95
 
Old 12/27/2006, 02:29 AM   #1 (permalink)
Member
 
Join Date: Jan 2006
Location: Northern Virginia
Posts: 4,362
Thanks: 11
Thanked 88 Times in 33 Posts
Default Fun with MortScript

I'm surprised that more people don't use MortScript. It is a very useful scripting language for mobile devices. It is freeware and can handle some pretty complex tasks with a few lines of code.

Case in point. I was able to write a simple script to monitor notifications and turn on the led blink when any are active.

MortScript can read and write to the registry, execute programs and subroutines and functions, send keystrokes and mouseclicks to applications, perform file manipulation and a lot more.

There is a new version 4.0 available here.
http://www.sto-helit.de/index.php?mo...st&category=17

Documentations is here.
http://www.sto-helit.de/downloads/po...4.0-Manual.pdf


Example:
Code:
#
# NLED.mscr - Monitors notifications and turns on and off the notification LED accordingly.
#

# check dependencies
If ( NOT FileExists( "\Windows\LEDUp.exe" ) )
   Message ( "Installation of LEDUp.exe is required! Exiting...", "NLED script" )
   Exit
EndIf

# initialize variables
LedOn = FALSE
Notify = FALSE

# start notification check loop
While ( 1 )

# check the registry for any notifications
   Notify = RegValueExists( "HKLM", "System\State\Shell\Notifications\Active", "CLSID" )

# turn on the led if any notifications are pending. Keep turning on each iteration since
# the OS turns it off whenever there is a new notification.
   If ( Notify )
      RunWait( "\Windows\LEDUp.exe", "0 1" )
      LedOn = TRUE
   EndIf

# turn off the led if no notifications are pending
   If ( LedOn && NOT Notify )
      RunWait( "\Windows\LEDUp.exe", "0 0" )
      LedOn = FALSE
   EndIf

# wait 5 seconds
   Sleep( 5000 )

EndWhile

People should post useful scripts they write to this thread for others to use. Attached is the above code zipped up. It requires installation of LEDUp.exe also attached. Install MortScript, LEDUp and copy the script to your device. Paste a shortcut of the script to \Windows\Startup to have it start at boot if it works for you.

Edit: Changed sleep to 5 seconds to activate the led before the keyguard puts the device to sleep when locked.
Attached Files
File Type: zip LEDUp.zip (4.4 KB, 1035 views)
File Type: zip NLED.zip (595 Bytes, 800 views)

Last edited by hannip; 03/15/2007 at 02:17 AM. Reason: point to released MortScript 4.0
hannip is offline   Reply With Quote
Old 12/27/2006, 01:05 PM   #2 (permalink)
Member
 
Join Date: Jan 2006
Location: Northern Virginia
Posts: 4,362
Thanks: 11
Thanked 88 Times in 33 Posts
Default RunAIM.mscr

Do you use AIM UK but are tired of having to manually make a data connection before you can sign in? Try this script to load AIM.

Code:
# RunAIM.mscr - start the default data connection and load AIM

connActive = Connected()

If ( NOT connActive )
   Connect( "The Internet" )
EndIf

Run ( "\Windows\Start Menu\Programs\AIM.lnk" )
Attached Files
File Type: zip RunAIM.zip (270 Bytes, 546 views)
hannip is offline   Reply With Quote
Old 12/27/2006, 04:30 PM   #3 (permalink)
Member
 
Join Date: Dec 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hannip, a problem I have with autoupdating on weatherpanel is that it won't disconnect my EVDO after it pulls down information ... is it possible to write a script that can detect such an event and then autodisconnect it?
isurus is offline   Reply With Quote
Old 12/27/2006, 04:59 PM   #4 (permalink)
Member
 
Join Date: Jan 2006
Location: Northern Virginia
Posts: 4,362
Thanks: 11
Thanked 88 Times in 33 Posts
Default

Sure, but I'm curious why you want to disconnect? EVDO in a dormant state shouldn't eat up the battery.
hannip is offline   Reply With Quote
Old 12/27/2006, 05:05 PM   #5 (permalink)
Member
 
Join Date: Jan 2006
Location: Northern Virginia
Posts: 4,362
Thanks: 11
Thanked 88 Times in 33 Posts
Default Poutlook folder switching

Here is a simple script that you can assign to a button. I tried it assigned to the side button on my treo 700wx and it works great. If you have AE Button Plus you can assign it to any button.

What this script does is open the mail folders for selection. If tmail isn't active it will launch it first. Before this you had to whip out your stylus to switch folders unless you have WM5 AKU3.0 or later.

Code:
# FolderSwitch.mscr - launches or makes tmail active and sends a
#   screen tap to open mail folders.

callTmail = True
current = ActiveProcess()

If ( current eq "tmail.exe" )
     callTmail = False
EndIf

If ( callTmail )
   Run( "\Windows\tmail.exe" )
   Sleep( 5000 )
EndIf

activeWin = ActiveWindow()
MouseClick( activeWin, 10, 10 )
Attached Files
File Type: zip FolderSwitch.zip (349 Bytes, 463 views)
hannip is offline   Reply With Quote
Old 12/27/2006, 05:17 PM   #6 (permalink)
Member
 
slingbox's Avatar
 
Join Date: Oct 2006
Posts: 2,101
Thanks: 17
Thanked 3 Times in 3 Posts
Default

hmmm will this find make the BT hack possible for that pretty sound of VC and media player in the moto HS850 headset
slingbox is offline   Reply With Quote
Old 12/27/2006, 05:25 PM   #7 (permalink)
Member
 
Join Date: Jan 2006
Location: Northern Virginia
Posts: 4,362
Thanks: 11
Thanked 88 Times in 33 Posts
Default

Quote:
Originally Posted by slingbox View Post
hmmm will this find make the BT hack possible for that pretty sound of VC and media player in the moto HS850 headset

No, but Bad Sector over at ppcgeeks is working on this solution.

http://www.ppcgeeks.com/transfer-cal...set-t1559.html
hannip is offline   Reply With Quote
Old 12/27/2006, 05:29 PM   #8 (permalink)
Member
 
slingbox's Avatar
 
Join Date: Oct 2006
Posts: 2,101
Thanks: 17
Thanked 3 Times in 3 Posts
Default

cool.Get ready to be over run with request hannip.I posted a link in ppcgeeks.This thread is going to be pretty long
slingbox is offline   Reply With Quote
Old 12/27/2006, 05:53 PM   #9 (permalink)
Member
 
Join Date: Dec 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by hannip View Post
Sure, but I'm curious why you want to disconnect? EVDO in a dormant state shouldn't eat up the battery.
I don't want to chance something else running in the background throwing the EVDO active and eating up battery Does that make sense?
isurus is offline   Reply With Quote
Old 12/27/2006, 05:58 PM   #10 (permalink)
Member
 
Malatesta's Avatar
 
Join Date: Jan 2006
Location: Long Island, NY
Posts: 6,045
Thanks: 43
Thanked 107 Times in 78 Posts
Default

Quote:
Originally Posted by isurus View Post
I don't want to chance something else running in the background throwing the EVDO active and eating up battery Does that make sense?
you'll probably waste more battery/cpu usage having to reconnect/sign in than forcing disconnect. leaving data in dormant uses no battery.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

WMExperts:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
&
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
+
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Malatesta is offline   Reply With Quote
Old 12/27/2006, 07:56 PM   #11 (permalink)
Member
 
slingbox's Avatar
 
Join Date: Oct 2006
Posts: 2,101
Thanks: 17
Thanked 3 Times in 3 Posts
Default

hannip ive noticed the led actavates 50% of the time using keygaurd.
Call comes in then missed.missed call icon apperars keygaurd turns off screen with no led flash.I wait about 2 min wake up screen then led missed call flash starts.
Is there a setting to delay keygaurd from starting giving time for led to start or change in code to speed up led before keylock

UPDATE-It would of helped if I put the MSCR file in the right place
Works perfect

Last edited by slingbox; 12/27/2006 at 08:46 PM.
slingbox is offline   Reply With Quote
Old 12/27/2006, 08:44 PM   #12 (permalink)
Member
 
Join Date: Jan 2006
Location: Northern Virginia
Posts: 4,362
Thanks: 11
Thanked 88 Times in 33 Posts
Default

Try lowering the sleep from 15000 to 10000 to see if that works better.
hannip is offline   Reply With Quote
Old 12/27/2006, 09:00 PM   #13 (permalink)
Member
 
slingbox's Avatar
 
Join Date: Oct 2006
Posts: 2,101
Thanks: 17
Thanked 3 Times in 3 Posts
Default

Quote:
Originally Posted by hannip View Post
Try lowering the sleep from 15000 to 10000 to see if that works better.
after reinstalling file it did the same thing.I will lower the sleep and see what happens
slingbox is offline   Reply With Quote
Old 12/27/2006, 09:20 PM   #14 (permalink)
Member
 
Join Date: Jan 2006
Location: Northern Virginia
Posts: 4,362
Thanks: 11
Thanked 88 Times in 33 Posts
Default

5000 seems to work well with keyguard on.
hannip is offline   Reply With Quote
Old 12/27/2006, 10:10 PM   #15 (permalink)
Member
 
slingbox's Avatar
 
Join Date: Oct 2006
Posts: 2,101
Thanks: 17
Thanked 3 Times in 3 Posts
Default

still hit and miss.It may be my treo considering ive been working it to death for the last 5 hours
update 5 sec at 5000 seems to be the keeper Palm always makes it so hard haha

Last edited by slingbox; 12/27/2006 at 10:28 PM.
slingbox is offline   Reply With Quote
Old 12/27/2006, 10:28 PM   #16 (permalink)
Member
 
Join Date: Jan 2006
Location: Northern Virginia
Posts: 4,362
Thanks: 11
Thanked 88 Times in 33 Posts
Default

probably need to break up the script. The guts of the while loop needs to be separated out to its own script. That script then would be called in two ways. From a parent script that runs the loop and from the notification queue right before power off. That should catch all cases.

That is your homework assignment. I'll check back in 10 minutes and grade your results.
hannip is offline   Reply With Quote
Old 12/27/2006, 10:50 PM   #17 (permalink)
Member
 
slingbox's Avatar
 
Join Date: Oct 2006
Posts: 2,101
Thanks: 17
Thanked 3 Times in 3 Posts
Default

We have led function in 7 out of 10 test calls.As stated above(needs to be seperated into it,s own loop) will be the answer.PA led comes one 3-5sec after call is missed with screen still on then keygaurd lockdown.Were that comes into play with your build--I dont know What I do know is that my wx is much faster without pa
Update-Question..would it do any good changing to sec 1

Last edited by slingbox; 12/27/2006 at 11:11 PM. Reason: question
slingbox is offline   Reply With Quote
Old 12/27/2006, 11:53 PM   #18 (permalink)
Member
 
Join Date: Jan 2006
Location: Northern Virginia
Posts: 4,362
Thanks: 11
Thanked 88 Times in 33 Posts
Default

You can try 1 second. It won't hurt anything, tho I'd like to find a better solution. I tried breaking up the scripts, but I'm having trouble setting up the notification queue to run the script before power off. Need to do some research. I'll update once I have it all working.
hannip is offline   Reply With Quote
Old 12/28/2006, 12:15 AM   #19 (permalink)
Member
 
slingbox's Avatar
 
Join Date: Oct 2006
Posts: 2,101
Thanks: 17
Thanked 3 Times in 3 Posts
Default

1 sec made no diffrence
Must Have Sleep
Great work hannip Catch you tommrow

Last edited by slingbox; 12/28/2006 at 12:47 AM.
slingbox is offline   Reply With Quote
Old 12/28/2006, 09:22 AM   #20 (permalink)
Member
 
codyppc's Avatar
 
Join Date: May 2006
Location: Kansas City, Missouri
Posts: 2,806
Thanks: 6
Thanked 46 Times in 14 Posts
Default

i'm sorry to be such any idiot, but I don't quite understand this script thing. can someone post a link like " scripts for dummies" or something. I would like to better understand it before I start using it.

thanks, cody
codyppc is offline   Reply With Quote
Reply


Thread Tools
Display Modes

~


All times are GMT -4. The time now is 12:51 AM.

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
 
 

Copyright ©1999- TreoCentral. All rights reserved : Terms of Use : Privacy Policy

TREO and TreoCentral are trademarks or registered trademarks of palm, Inc. in the United States and other countries;
the TreoCentral mark and domain name are used under license from palm, Inc.
The views expressed on this website are solely those of the proprietor, or
contributors to the site, and do not necessarily reflect the views of palm, Inc.

Explore More: Crackberry | WMExperts | the iPhone Blog | Android Central | Smartphone Experts Combined Forums