since I realized MortScript finally got to some use here, too, and I'm currently building an updated site, I wanted to gather some scripts which I could offer as examples on my page. Of course with a link to any origin you want - that way the author gets the credits, and I don't need to keep up with the latest update all the time...
Since I lost track of all the threads and scripts, I'd be nice if you could send me the interesting topics (a reply might be useful for others, too, but PM or contact formular or forum on mort.sto-helit.de is fine, too...).
if question "Please set the Camera app to photo mode before executing this script. Additionally, please remember to disable <<Reviev After Capture>> option in Camera before running this script! Run the script?","Important note"
setbacklight 1,1
Input limit, 1, "Total images to capture","MultiCapture"
if equals "",%limit%
set limit,10
endif
set total,0
Input delayer, 1, "Capture interval (seconds)","MultiCapture"
set delayer,%delayer%*1000
if equals %delayer%,0
set delayer,1000
endif
%czas%=%delayer%*%limit%/1000
%czas_m%=%czas%/60
%czas%="Total capture time: "&%czas%&" seconds, this is "&%czas_m%&" minutes."
message %czas%,"MultiCapture"
if question "Lock the touchscreen?","Touchscreen lock"
run tpdisable.exe
endif
run camera.exe
WaitForActive "Camera",10
setbacklight 0,0
while wndActive "Camera"
SendCR "Camera"
sleep %delayer%
%total%=%total%+1
if equals %total%,%limit%
Close "Camera"
endif
endwhile
run tpenable.exe
%total%="Images captured: " & %total%
message %total%,"Done"
endif
It does some pictures at regular interval, locking screen (using TPEnable/TPDisable).
The other script:
Code:
if wndActive "Camera"
regReadDword HKCU,"Software","tplock",lok
if equals %lok%,1
run "\windows\tpenable.exe"
regWriteDword HKCU,"Software","tplock",0
message "Screen unlocked.","Device lock"
else
run "\windows\tpdisable.exe"
regWriteDword HKCU,"Software","tplock",1
endif
else
run "\windows\alttab.exe"
endif
I have it bound to 'Record' button on my BA. If the camera is active, it locks the touchscreen (TPEnable/Disable again). If not - it executes SPBPocketPlus's AltTab.
MortScript rulez
[ANDROID] Remap HC/ICS external keyboard: here
[WM] LEDUp, simple LED control program: here
[WM] FloatMe, a stupid but maybe useful 'tool': here
[WM] More HW buttons for i780: here
[WM] i780/Omnia unlocking: here
[WM] Program Finder: here
I have one more, but a buggy one - it updates the Camera image capture dir to dd_mm_yyy. Will post it later on today...
Code:
if not regKeyExists HKCU,"Software\IA Style\IA CameraWizard(Pocket PC)\2.21\Strings","xImage folder"
regReadString HKCU,"Software\IA Style\IA CameraWizard(Pocket PC)\2.21\Strings","Image folder",pth
%msg%="This is the first time you use this script. The current image store path is: "&%pth%
message %msg%
if question "Run the Camera to change this value?"
runwait "camera.exe"
endif
regReadString HKCU,"Software\IA Style\IA CameraWizard(Pocket PC)\2.21\Strings","Image folder",pth
RegWriteString HKCU,"Software\IA Style\IA CameraWizard(Pocket PC)\2.21\Strings","xImage folder",%pth%
if question "Update the capture dir now?"
regReadString HKCU,"Software\IA Style\IA CameraWizard(Pocket PC)\2.21\Strings","Image folder",pth
else
exit
endif
endif
GetTime dat, "Y_m_d"
regReadString HKCU,"Software\IA Style\IA CameraWizard(Pocket PC)\2.21\Strings","xImage folder",pth
%dat%=%pth%&"\"&%dat%
MkDir %dat%
RegWriteString HKCU,"Software\IA Style\IA CameraWizard(Pocket PC)\2.21\Strings","Image folder",%dat%
%dat%="Image capture folder updated to "&%dat%
SleepMessage 5,%dat%,"Capture folder updated",1
[ANDROID] Remap HC/ICS external keyboard: here
[WM] LEDUp, simple LED control program: here
[WM] FloatMe, a stupid but maybe useful 'tool': here
[WM] More HW buttons for i780: here
[WM] i780/Omnia unlocking: here
[WM] Program Finder: here
Here is a short & sweet script I wrote that asks you if you'd like to rotate your screen before running TomTom then rotates it back when TomTom exits. This is useful because when driving, TomTom looks better in landscape mode, but there are times when just walking around and stuff it's better in portrait mode.
No credit needed really because of it's simplicity.
Edit: Sorry, I deleted the file off my server a while back when I was doing some spring cleaning... I don't have a copy of it any where.
Really it was just a couple mortscript commands. Anyone who spends 5 minutes and reads the mortscript documentation can figure it out.
BTW, I LOVE mortscript. It's very handy and I see it becoming more useful as the needs arise.
I couldn't live without it. The following script connects Bluetooth through ActiveSync and Syncs. The connection will remain active until the script is started again, or the connection is closed manually.
Code:
If NOT wndExists "Connected to MEDIACENTER"
RegReadDWord HKLM, System\State\Hardware, Bluetooth, Bluetooth
If Expression %Bluetooth% <= 8
Set BluetoothWas, "Off"
Run "\Windows\ToggleBTH.exe"
Sleep 3000
EndIf
Run "\Windows\rnaapp.exe", -n -m -e"MEDIACENTER"
WaitFor "Connected to MEDIACENTER", 15
Run "\Windows\udp2tcp.exe"
Run "\Windows\rapiclnt.exe", -dppp_peer
Run "\Windows\repllog.exe", /remote /sched /h
Sleep 1000
RegWriteDWord HKLM, System\State\Hardware, Cradled, 1
While wndExists "Connected to MEDIACENTER"
Sleep 1000
EndWhile
Run "\Program Files\MortScript\TKill.exe", UDP to TCP proxy
Run "\Program Files\MortScript\TKill.exe", Remote API Client
Run "\Program Files\MortScript\TKill.exe", ActiveSync
If equals %BluetoothWas%, "Off"
Run "\Windows\ToggleBTH.exe"
EndIf
Else
Run "\Program Files\MortScript\TKill.exe", Connected to MEDIACENTER
EndIf
Needless to say you need to replace MEDIACENTER with the name of your own BT Connection.
ToggleBTH turns on the BlueTooth radio if it wasn't already on, and turns it off again is the connection is dropped.
TKill really kills the various processes when done; killing them with MortScript's internal commands didn't seem stable.
# Witch operator are we on?
RegReadString HKLM, System\State\Phone, Current Operator Name, Operator
If Equals %Operator%, "Orange"
Set Orange, "On"
EndIf
# Orange Active? Switch to T-Mobile.
If Equals %Operator%, "Orange"
Run "\Windows\STK.exe"
SendUp STK Service
SendUp STK Service
SendDown STK Service
SendCR STK Service
Sleep 500
Minimize STK Service
EndIf
# Is T-Mobile Active?
RegReadString HKLM, System\State\Phone, Current Operator Name, Operator
While Not Equals %Operator%, "T-Mobile NL"
Sleep 1000
RegReadString HKLM, System\State\Phone, Current Operator Name, Operator
EndWhile
# GPRS Notificatie opslaan en daar uitzetten
RegReadDWord HKCU, ControlPanel\Notifications\{8ddf46e7-56ed-4750-9e58-afc6ce486d03}, Options, GPRSConnectNotification
RegWriteDWord HKCU, ControlPanel\Notifications\{8ddf46e7-56ed-4750-9e58-afc6ce486d03}, Options, 0
#Activesync
If wndExists "ActivSync"
Set ActiveSync, "On"
EndIf
Run "\Windows\repllog.exe", /h /sched /remote
Sleep 500
MouseClick ActiveSync 20, 310
Sleep 500
Minimize ActiveSync
RegReadDWord HKCU, Software\Microsoft\ActiveSync\Partners\{4FF3ACFA-3E07-42E1-83D9-4F04714CDC0B}, LastSyncSuccess, LastSyncSuccess
RegReadDWord HKCU, Software\Microsoft\ActiveSync\Partners\{4FF3ACFA-3E07-42E1-83D9-4F04714CDC0B}, LastSyncSuccess, NewSyncSuccess
While Equals %NewSyncSuccess%, %LastSyncSuccess%
Sleep 1000
RegReadDWord HKCU, Software\Microsoft\ActiveSync\Partners\{4FF3ACFA-3E07-42E1-83D9-4F04714CDC0B}, LastSyncSuccess, NewSyncSuccess
EndWhile
RegWriteDWord HKCU, ControlPanel\Notifications\{8ddf46e7-56ed-4750-9e58-afc6ce486d03}, Options, %GPRSConnectNotification%
If not Equals %ActiveSync%, "On"
Run "\Program Files\MortScript\TKill.exe", ActiveSync
EndIf
If Equals %Orange%, "On"
Run "\Windows\STK.exe"
SendUp STK Service
SendUp STK Service
SendCR STK Service
Sleep 1000
Minimize STK Service
Minimize STK Service
EndIf
This script ActiveSyncs over GPRS. I use a Dual SIM, (Orange & T-Mobile) and only the T-Mobile subscription have GPRS. So the script first determines if T-Mobile is active. If not is switches SIM. After that it just starts ActiveSync and syncs the {4FF3ACFA-3E07-42E1-83D9-4F04714CDC0B} partnership. After it finishes is swichtes SIMs again; I'm mainly on the Orange SIM.
I use the same methode before starting TomTom so my traffic information can be downloaded while driving.
If someone is interested I also have a script that (allong with some other little proggies) starts TomTom automaticly when I connect the power connector, but only if my carkit is connected.
RegWriteString HKLM,Drivers\active\73,Name,COM6:
if question "Enable BT/GPS before running OziExplorer?","OziExplorer"
run "\program files\vijay555\vjvolubilis\vjvolubilis.exe", -blueon
runwait "\storage card2\oziexplorer\oziexplorerce.exe"
run "\program files\vijay555\vjvolubilis\vjvolubilis.exe", -blueoff
else
if question "Run OziExplorer anyway?","OziExplorer"
run "\storage card2\oziexplorer\oziexplorerce.exe"
endif
endif
Yay, does anyone use OziExplorerCE? I sometimes do
The script above utilizes vijay's VJVolubilis (great app, imho) to enable Bluetooth. It also adds 'fake' COM port in order to allow proper OziExplorerCE GPS configuration.
[ANDROID] Remap HC/ICS external keyboard: here
[WM] LEDUp, simple LED control program: here
[WM] FloatMe, a stupid but maybe useful 'tool': here
[WM] More HW buttons for i780: here
[WM] i780/Omnia unlocking: here
[WM] Program Finder: here
SpeakerPhone Auto ON - Automatically turn on your speakerphone OS Profiler - Volume Profile Scheduler. DontSleep Wifi - will automatically turn on your wifi while preventing your device from going into sleep mode. OS Logger - Log your SMS on your Calendar i780 Flashing Guide CNitrogen - Titanium Plugin for Nitrogen Music Player SMSer - send multiple sms to multiple contacts
This script removes the list of recently used programs in the Start Menu.
Code:
if question ("Do you want to cleanup the Recent Programs from your Start Menu?","oldSAP's Cleanup")
x=0
While NOT (x = 12)
RegWriteString ("HKCU","Software\Microsoft\Shell\TaskSwitch",%x%,"")
x=x+1
EndWhile
if question ("You need to restart your device to see the effect. Restart Now?","oldSAP's Cleenup")
Reset
EndIf
EndIf
SpeakerPhone Auto ON - Automatically turn on your speakerphone OS Profiler - Volume Profile Scheduler. DontSleep Wifi - will automatically turn on your wifi while preventing your device from going into sleep mode. OS Logger - Log your SMS on your Calendar i780 Flashing Guide CNitrogen - Titanium Plugin for Nitrogen Music Player SMSer - send multiple sms to multiple contacts
num=Input ( "1=Copy All 2=Copy Word(s) 3=Copy Line 4=Paste ", "oldSAP Copy/Paste",1 )
if equals %num%, "1"
SendCtrlKey A
SendCtrlKey C
Else
if equals %num%, "2"
x=Input("How many words do you want to copy?","no. of words",1)
Repeat %x%
SendRight( "", 1, 1 )
EndRepeat
SendCtrlKey C
Else
if equals %num%, "3"
SendEnd( "", 0, 1 )
SendCtrlKey C
Else
if equals %num%, "4"
SendCtrlKey V
Else
EndIf
SpeakerPhone Auto ON - Automatically turn on your speakerphone OS Profiler - Volume Profile Scheduler. DontSleep Wifi - will automatically turn on your wifi while preventing your device from going into sleep mode. OS Logger - Log your SMS on your Calendar i780 Flashing Guide CNitrogen - Titanium Plugin for Nitrogen Music Player SMSer - send multiple sms to multiple contacts
Would you like to know one of the things that really annoys me on a daily basis? Tough, … more
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?