Notices

Tips and Tricks Share tips that can save others time and frustration here !

Reply
 
LinkBack Thread Tools
Old 05-21-07, 04:41 AM   #1 (permalink)
Aximsite Major League
 
Join Date: Dec 2004
Location: Paris, France
Posts: 488
Thanked 17 Times in 4 Posts
Some Mortscript Script Tricks

Here are some exemples of MortScript scripts that I am using they help me a lot in using my two axims devices x50v and x51v, they are both under WM5 aku 2.3.1.

I am sharing those scripts that I see more as tricks, you are very welcome to use them or optimize them as for sure they are not perfect.

Before using any of those scripts, I strongly suggest that you do a full backup of your device, some scripts are modifying registries values so I don't want in any case be responsible of any loss of datas from your devices.

You must ensure that you are using Mortscript V4, to run some of those script. If not you must upgrade


TT6 launching script with max sound volume
(Once TT6 closed the script restore the orignal sound volume, in this example TT6 is installed on Rom, path must be changed if Tomtom Navigator is installed elsewhere)


Quote:
############################################
# TT6 Launcher #
############################################

#Check if TT6 is already running
If not procExists "TomTom Navigator.exe"

#Initial sound volume backup
RegReadDWord HKCU,ControlPanel\Volume,Volume,volume

#set sound volume to max
SetVolume 255

#Launching TT6
RunWait "\Program Files\Navigator\TomTom Navigator.exe"

#Restoring initial sound volume
Switch %volume%
Case 0
SetVolume 0
Case 858993459
SetVolume 50
Case 1717986918
SetVolume 100
Case -1717986919
SetVolume 150
Case -858993460
SetVolume 200
Case -1
SetVolume 250
EndSwitch

Else

#Display TT6 if already running
Show TomTom Navigator

EndIf
(Download TTN6.mscr at the end of this post)


PIE Launching script with 4096 Mo RamDIsk on demand for PIE cache.
(It uses RamDisk, the script will check if Ramdisk is properly installed and won't run if not, the cache relocation is also done by the script and original value is restored when pie is closed, ramdisk is unmounted as well. The script can be run as is and doesn't need any registry modification prior launching it.)

Quote:
############################################
# iexplore Launcher #
############################################

#Backup initial Pie Cache value
PieCache = RegRead( "HKCU", "Software\Microsoft\Windows\CurrentVersion\Explore r\Shell Folders", "Cache")

#Check if Ramdisk is properly installed
if ((FileExists( "\Windows\ramdisk.exe" ) = 0) || (FileExists( "\Windows\ramdisk.dll" ) = 0))

Message( "RamDisk not properly installed", "Abort" )

Else

#Set Pie Cache to Ramdisk
RegWriteString( "HKCU", "Software\Microsoft\Windows\CurrentVersion\Explore r\Shell Folders",

"Cache","\Ramdisk" )

#Load RamDisk-4096
Run "\Windows\ramdisk.exe" ,4096

#Launching PIE
RunWait "\Windows\iexplore.exe"

RegWriteString( "HKCU", "Software\Microsoft\Windows\CurrentVersion\Explore r\Shell Folders", "Cache",PieCache

)

#RamDisk-unload
Run "\Windows\ramdisk.exe" ,/U

Endif
(Download PIE_Ramdisk.mscr at the end of this post)

Nota
This script is strongly suggested if you're having an x50v running on WM5.

Rotate Script with PocketBreeze Display optimization on Today screen.
(The script handles both trueVGA et standard VGA mode of a VGA device)

Starting from my today screen exemple:



If I rotate the screen here is what I get:



Using this script:

Quote:
RegReadDWord HKLM, Drivers\Display\GPE, LogicalPixelsX, pixelMode

if equals %pixelMode%,96

If ( Screen( "portrait" ) = 1 )

#put 230 pixels for PocketBreeze Limit Height for Landscape in trueVGA mode
#mettre 230 pixels pour la limite en hauteur de PocketBreeze en Paysage mode trueVGA
RegWriteDWord( "HKCU", "Software\SBSH\PocketBreeze", "dHeightLimit",230 )
RedrawToday
Rotate( 90 )
Else
#put 390 pixels for PocketBreeze Limit Height for Portrait in trueVGA mode
#mettre 390 pixels pour la limite en hauteur de PocketBreeze en Portrait mode trueVGA
RegWriteDWord( "HKCU", "Software\SBSH\PocketBreeze", "dHeightLimit",390 )
RedrawToday
Rotate( 0 )
Endif

Else

If ( Screen( "portrait" ) = 1 )

#put 200 pixels for PocketBreeze Limit Height for Landscape in native VGA mode
#mettre 200 pixels pour la limite en hauteur de PocketBreeze en Paysage mode VGA standard
RegWriteDWord( "HKCU", "Software\SBSH\PocketBreeze", "dHeightLimit",200 )
RedrawToday
Rotate( 90 )
Else
#put 360 pixels for PocketBreeze Limit Height for Portrait in native VGA mode
#mettre 360 pixels pour la limite en hauteur de PocketBreeze en Portrait mode VGA standard
RegWriteDWord( "HKCU", "Software\SBSH\PocketBreeze", "dHeightLimit",360 )
RedrawToday
Rotate( 0 )
Endif

EndIf
(Download rotateToday.mscr at the end of this post)

Here is what I get:



The screen display is optimized without any scrollbar at the right. :)


Nota: You must modify the script with your proper dHeightLimit values. (see comments in the script).


High Res Script for Landscape Browsing with PIE.
(The script forces PIE High Resolution for landscape browsing for a VGA device)

This is an exemple of what you would get while surfing imdb.com with PIE in native VGA resolution:



In full screen you would get:



If your vga device is running on a WM5 aku 3 or a WM6 OS, you have the possibility of using PIE with high res mode.

If not you can still browse with pie on high res mode by switching to TrueVGA mode.
I myself using my device on trueVGA mode 80% of the time. However if it happens that I am using my device in native vga mode, I am using this script to surf in high res mode if I am in a hurry to surf and if I don't want to wait for doing a soft reset on my device. Using this script will switch PIE in high res mode without soft-resetting the device.

This is what I would get using this script:

Quote:
RegReadDWord HKLM, Drivers\Display\GPE, LogicalPixelsX, pixelMode

#Check that device is running in Native VGA Mode
#On vérifie que l'appareil est en mode VGA Natif
if equals %pixelMode%,192

#Check that display is on Portrait Mode
#On verifie que l'affichage est en mode portrait
If ( Screen( "portrait" ) = 1 )

#some PIE settings backup
#sauvegarde des parametres d'affichage de PIE
ViewMode = RegRead( "HKCU", "Software\Microsoft\Internet Explorer\Main", "MakeFit")
ZoomMode = RegRead( "HKCU", "Software\Microsoft\Internet Explorer\Main", "ZoomSetting")


#Modifying system settings for High Res display
#Changement des parametres systeme pour affichage High Res
RegWriteDWord( "HKLM", "Drivers\Display\GPE", "LogicalPixelsX",96 )
RegWriteDWord( "HKLM", "Drivers\Display\GPE", "LogicalPixelsY",96 )
#Forcing PIE Display to Desktop mode and Zoom for Largest Font
#On force l'affichage de Pie en Mode Desktop et Font les plus grandes
RegWriteDWord( "HKCU", "Software\Microsoft\Internet Explorer\Main", "MakeFit",0 )
RegWriteDWord( "HKCU", "Software\Microsoft\Internet Explorer\Main", "ZoomSetting",4 )

#Rotate to Landscape and loading High Res change in system
#Rotation mode Paysage et prise en compte des paramètres High Res par le systeme
Rotate( 90 )

# Launching PIE
# on lance pie
RunWait "\Windows\iexplore.exe"

#After closing PIE, we reverse to original PIE settings and restore native VGA mode to system
#A la fermeture de PIE, on retabli les paramètres d'origine de PIE et on rétablie les valeurs VGA native au systeme
RegWriteDWord( "HKCU", "Software\Microsoft\Internet Explorer\Main", "MakeFit",ViewMode )
RegWriteDWord( "HKCU", "Software\Microsoft\Internet Explorer\Main", "ZoomSetting",ZoomMode )
RegWriteDWord( "HKLM", "Drivers\Display\GPE", "LogicalPixelsX",192 )
RegWriteDWord( "HKLM", "Drivers\Display\GPE", "LogicalPixelsY",192 )

#We check if the display is on portrait for double rotation to be sure the proper VGA system settings are loaded in system
#On verifie si on est en mode portrait pour une double ratation afin d'etre sur que les paramètres VGA sont coherents dans le systeme

If ( Screen( "portrait" ) = 1 )

Rotate( 90 )
Rotate( 0 )

Else

Rotate( 0 )

Endif

Else

Message( "This script will only run from Portrait mode", "Warning" )


EndIf

Else

Message( "You are already in High Res mode !!!", "" )


EndIf
(Download PIEhighRES.mscr at the end of this post, or you can also use PIEhighRES_Ramdisk.mscr if you have Ramdisk)




and in full screen:



The result is 100% working in full screen mode. You'll see that the bottom of the screen is not having a perfect display in regular mode in the softkey area. However it's still fonctional, it works perfect using calligrapher in keyboard float mode for using input in PIE. If you are using the native keyboard it sometimes not properly displayed, you only need to recall it from the sip menu selection to have it properly displayed.

Warning
I strongly suggest that you install the trueVGA dll, in your device you can find it here. The script is modifying the LogicalPixels of the device, so if for any reason you are doing a soft reset before closing pie, you will recover in trueVGA mode, it would be better than to have the proper file to take control of the device and switch to native mode via ozVGA.
To avoid any slide effect, you should close pie after using this script, so the LogicalPixels of the device will be properly restored (Don't invoke/or switch to any other application before closing PIE).
USE THIS SCRIPT WITH CAUTION AND WITH YOUR OWN RESPONSABILITY)
Also I suggest you read Menneisyys thread : VGA Demystified
Attached Files:
File Type: zip TTN6.zip (447 Bytes, 34 views)
File Type: zip PIE_Ramdisk.zip (481 Bytes, 59 views)
File Type: zip rotateToday.zip (508 Bytes, 25 views)
File Type: zip PIEhighRES.zip (1.0 KB, 26 views)
File Type: zip PIEhighRES_Ramdisk.zip (1.3 KB, 30 views)

Last edited by makuu; 05-25-07 at 02:37 AM.
makuu is offline   Reply With Quote
Sponsor Ads
Old 05-21-07, 04:26 PM   #2 (permalink)
Aximsite All Star
 
Mokubai's Avatar
Elite Member
 
Join Date: Dec 2005
Location: UK
Posts: 833
Device: HTC Touch Dual
Carrier: T-Mobile UK
Thanked 0 Times in 0 Posts
Wow! Much thanks for all all of these useful scripts. Especially the PIEHires scripts... I've been trying to find a way to make PIE a little less stupid with the pixel doubling and it looks like the only way is with your script or TrueVGA dlls....

Great work, thanks!
__________________
pencil and paper: n.An archaic information storage and transmission device that works by depositing smears of graphite on bleached wood pulp. More recent developments in paper-based technology include improved ‘write-once’ update devices which use tiny rolling heads similar to mouse balls to deposit colored pigment.
Mokubai is offline   Reply With Quote
Old 05-22-07, 02:21 AM   #3 (permalink)
Aximsite Major League
 
Join Date: Dec 2004
Location: Paris, France
Posts: 488
Thanked 17 Times in 4 Posts
You are welcome Mokubai, let's hope that either Dell or someone else will deliver a rom with aku 3 or even WM6, so we will have the "use High Resolution" feature embedded with PIE.
I'll try to have a look on that if I can find time this summer.
makuu is offline   Reply With Quote
Old 05-22-07, 04:23 AM   #4 (permalink)
Noiro
Guest
 
Posts: n/a
Awesome makuu, nice scripts.

I wish I could write them. thanks for sharing these, much credit due. :approve:
  Reply With Quote
Old 05-24-07, 11:53 PM   #5 (permalink)
Aximsite Minor League
 
Join Date: Jul 2006
Location: Hong Kong
Posts: 211
Thanked 0 Times in 0 Posts

Awards Showcase
Aximsite Contest Winner 
Total Awards: 1

Just to note that these scripts requires mortscript 4.0. My v3.1 can't run the PIEhighRes script.
zhaoyun is offline   Reply With Quote
Old 05-25-07, 02:39 AM   #6 (permalink)
Aximsite Major League
 
Join Date: Dec 2004
Location: Paris, France
Posts: 488
Thanked 17 Times in 4 Posts
Originally Posted by zhaoyun View Post
Just to note that these scripts requires mortscript 4.0. My v3.1 can't run the PIEhighRes script.
Thanks zhaoyun, I have updated the first post accordingly. :)
makuu is offline   Reply With Quote
Old 05-25-07, 06:52 AM   #7 (permalink)
Aximsite Major League
 
Join Date: Dec 2004
Location: Paris, France
Posts: 488
Thanked 17 Times in 4 Posts
Opera 8.65 Launching script with RamDisk on demand for Opera cache.
(It uses RamDisk, the script will check if Ramdisk is properly installed and won't run if not, the cache relocation must be done by yourself by editing the \Application Data\Opera\opera.ini adding this line:
Cache Directory4=\Ramdisk (in [User Prefs])
The script will try to mount a Ramdisk from 8192 Mo, 6144 Mo or 4096 Mo, if you don't have enought Ram free, to mount a Ramdisk, it will abort with warning.


Quote:
############################################
# Opera Launcher using Ramdisk Cache #
############################################


#Check if Ramdisk is properly installed
if ((FileExists( "\Windows\ramdisk.exe" ) = 0) || (FileExists( "\Windows\ramdisk.dll" ) = 0))

Message( "RamDisk not properly installed", "Abort" )

Else

#Try to load RamDisk-8192
RunWait "\Windows\ramdisk.exe" ,8192

#Test if successfully loaded 8192 Mo Ramdisk
if ( DirExists("\Ramdisk") = 0 )
#If not try a smaller 6144 Mo Ramdisk
RunWait "\Windows\ramdisk.exe" ,6144
Endif

#Test if successfully loaded 6144 Mo Ramdisk
if ( DirExists("\Ramdisk") = 0 )
#If not try a smaller 4096 Mo Ramdisk
RunWait "\Windows\ramdisk.exe" ,4096
Endif

#Test if successfully loaded 4096 Mo Ramdisk
if ( DirExists("\Ramdisk") = 0 )
#If not end with warning
Message( "Could not create Ramdisk, you need to free some Ram and Re-Run!!!", "Abort" )

Else

#Read Opera Path
OperaPath = RegRead( "HKLM", "Security\AppInstall\Opera Software Opera", "InstallDir")

#Launching Opera

RunWait ( OperaPath & "\OperaWM.exe" )

#RamDisk-unload
Run "\Windows\ramdisk.exe" ,/U

Endif

Endif
(Download Opera_Ramdisk.mscr at the end of this post)

Warning
Don't forget to add the line Cache Directory4=\Ramdisk in opera.ini file (in [User Prefs]) or the scrip is useless. I only tested the script with the 8.65 béta, the script is checking where you installed opera so if you have moved the opera exe file after installation it won't work.


Nota
This script is strongly suggested if you're having an x50v running on WM5.
You can also modify the line (in opera.ini):
Download Directory=\My Documents
to
Download Directory=\Ramdisk
In case you want to download file from Opera, but remember that you have a size limitation in the Ramdisk
Attached Files:
File Type: zip Opera_Ramdisk.zip (607 Bytes, 44 views)
makuu is offline   Reply With Quote
Old 05-25-07, 12:10 PM   #8 (permalink)
Aximsite All Star
 
Mokubai's Avatar
Elite Member
 
Join Date: Dec 2005
Location: UK
Posts: 833
Device: HTC Touch Dual
Carrier: T-Mobile UK
Thanked 0 Times in 0 Posts
Once again Makuu, you are the fountain of great Mortscript utilities. I like the "probing" to see what size 'disk you can get away with, very nice.

:approve:

Many thanks!
__________________
pencil and paper: n.An archaic information storage and transmission device that works by depositing smears of graphite on bleached wood pulp. More recent developments in paper-based technology include improved ‘write-once’ update devices which use tiny rolling heads similar to mouse balls to deposit colored pigment.
Mokubai is offline   Reply With Quote
Old 05-25-07, 12:45 PM   #9 (permalink)
Aximsite Legend
 
psionandy's Avatar
Addicted Member
 
Join Date: Mar 2005
Posts: 21,422
Thanked 0 Times in 0 Posts
Wow.. nice work :approve:

Mortscript seems to be very interesting... and learning from examples is great
psionandy is offline   Reply With Quote
Old 05-27-07, 11:04 PM   #10 (permalink)
Aximsite Minor League
 
Join Date: Jul 2006
Location: Hong Kong
Posts: 211
Thanked 0 Times in 0 Posts

Awards Showcase
Aximsite Contest Winner 
Total Awards: 1

One question BTW, I used the PIEhighRES script but the positioning of the soft keyboard were at the centre of the screen, covering most of the viewable area, and makes inputting of, say URL, very difficult. Any fix for that?
zhaoyun is offline   Reply With Quote
Old 05-28-07, 02:31 AM   #11 (permalink)
Aximsite Major League
 
Join Date: Dec 2004
Location: Paris, France
Posts: 488
Thanked 17 Times in 4 Posts
Originally Posted by zhaoyun View Post
One question BTW, I used the PIEhighRES script but the positioning of the soft keyboard were at the centre of the screen, covering most of the viewable area, and makes inputting of, say URL, very difficult. Any fix for that?
I don't have a fix, just a workaround: from the small arrow next to the keyboard icon, invoke the sip menu like if you wanted to change the input mode (like to use transcriber for exemple), then re-invoke the keyboard. It will positione it the right way.
makuu is offline   Reply With Quote
Old 05-29-07, 06:05 PM   #12 (permalink)
Aximsite All Star
 
Mokubai's Avatar
Elite Member
 
Join Date: Dec 2005
Location: UK
Posts: 833
Device: HTC Touch Dual
Carrier: T-Mobile UK
Thanked 0 Times in 0 Posts
This is basically a plaigarised version of your TomTom script makuu, sorry...

Coreplayer is rather a large and slow to load executable, and takes a long time to bring the window to the front when you run it if it is already running and you just minimise apps like I do. This script just brings the window to the foreground if it is running, otherwise it runs it from scratch.

It also puts the volume to maximum (a la your script) as I use the volume control in Coreplayer for finer adjustment...

Quote:
############################################
# Coreplayer Launcher #
############################################

#Check if Coreplayer is already running
If not procExists "player.exe"

#Initial sound volume backup
RegReadDWord HKCU,ControlPanel\Volume,Volume,volume

#set sound volume to max
SetVolume 255

#Launching Coreplayer
RunWait "\Program Files\Coreplayer\player.exe"

#Restoring initial sound volume
Switch %volume%
Case 0
SetVolume 0
Case 858993459
SetVolume 50
Case 1717986918
SetVolume 100
Case -1717986919
SetVolume 150
Case -858993460
SetVolume 200
Case -1
SetVolume 250
EndSwitch

Else

#Display Coreplayer if already running
Show CorePlayer

EndIf

#fin
Thanks for the scripts makuu. You've shown me the wonders of mortscript.
Attached Files:
File Type: zip CoreplayerMS.zip (459 Bytes, 13 views)

Last edited by Mokubai; 05-30-07 at 03:39 AM.
Mokubai is offline   Reply With Quote
Reply

Tags
mortscript, script, tricks

Sponsor Ads

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mortscript Problem JohnK324 X50 / X51 Forums 6 05-16-07 09:14 PM
Need Script Writing Advice - Mortscript VtJay22 Applications and Utilities 2 04-06-07 05:28 PM
MortButtons 2.41 and MortScript 4.0 released sto-helit.de Applications and Utilities 1 03-12-07 09:51 AM
Mortscript help please Wylo Shocker X50 / X51 Forums 4 10-17-06 01:27 PM
Mortscript help needed - invoke apps at scheduled time daily zhaoyun Water Fountain 1 08-11-06 10:45 AM


All times are GMT -5. The time now is 11:25 PM.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Copyright © 2003-09 LeckMedia, LLC