Turning BT off/on w/ mortscript - Mogul, XV6800 General

I am trying to create a script that checks the BT state and then turn on/keeps on the BT then start a program (landscaper-->google maps) and then when the program terminates it returns the BT state that it was before starting the script...
the programs are
Program Files\BlindLemon\BTToggle.exe
Program Files\Landscaper.exe or \Windows\Start Menu\Programs\Landscaper.exe
Program Files\Googlemaps\googlemaps.exe
I have part of the script but I need the BT part. Here is what I have
Rotate(90)
Run( "\Window\Start Menu\Programs\Landscaper.exe" )
WaitForActive( "Landscaper", 05 )
SendDown ( "Landscaper" )
Runwait( "\Program Files\GoogleMaps\GoogleMaps.exe" )
Close( "Landscaper" )
Rotate(0)
And This portion Works fine.. just looking for the BT component
If anyone has experience with this or has a similar script let me know
Thanks..
__________________
You couldn't fool your mother on the foolingest day of your life even if you had an electrified fooling machine!
I saw him once. Sure I'm blind in one eye, and my other eye was infected that day from picking at it, and I was tired, and I'd been swimming in a pool with too much chlorine, and that was the hour my glasses were at Lenscrafters but I seen that fish!

bluetooth toggle
i just found this little app that toggles BT state when called. i mapped it to an icon in my program launcher/today screen to toggle BT on and off with the push of a button. I believe I found it on the forums here, but can't remember - it was late. Hope this helps.

Thanks, but I already have a BT Toggler app, (BlindLemon\BTToggle.exe) What I need to know is how to read the BT status, and then either turn the BT on or execute the program.
I need to know how to have Mortscript read the BT status also I cannot figure out the if/then part

Figured It out...
This script is for
1. Check the BT state and turn on if off (using a simple BT toggler program located HERE....and turn off when program is exited
2. Rotating the screen to 90º (So Keyboard will be Functional)
3. Keeping the screen rotated at 90º even if switched to portrait (this is achived with the program called Landscaper)
4. Running Google Maps
5. Returning everything (BT Status/Rotation) to state prior to executing the script
Of course you can change any of the programs to suite your needs..
Here is the Script I used
B = RegRead ("HKLM", "Software\oem\bluetooth\" , "BTcomstatus" )
If ( B = 0 )
Run( "\Program Files\BlindLemon\BTToggle.exe" )
Rotate(90)
Run( "\windows\Start Menu\programs\Landscaper.exe" )
WaitForActive( "Landscaper", 05 )
SendDown ( "Landscaper" )
Runwait( "\Program Files\GoogleMaps\GoogleMaps.exe" )
Close( "Landscaper" )
Run( "\Program Files\BlindLemon\BTToggle.exe" )
Rotate(0)
Else
If ( B = 1 )
Rotate(90)
Run( "\windows\Start Menu\programs\Landscaper.exe" )
WaitForActive( "Landscaper", 05 )
SendDown ( "Landscaper" )
Runwait( "\Program Files\GoogleMaps\GoogleMaps.exe" )
Close( "Landscaper" )
Rotate(0)

Here is the BT monitoring part
0 is BT off
1 is BT on
B = RegRead ("HKLM", "Software\oem\bluetooth\" , "BTcomstatus" )
If ( B = 0 )
run( "Prorgam path for BT toggler such as BlindLemon's BTTolgger" )
runwait( "Insert your program path here" )
run( "Prorgam path for BT toggler such as BlindLemon's BTTolgger" )
Else
If ( B = 1 )
run( "Insert your program path here" )

Related

QiD: ActiveSync Toggle, and Bluetooth + profile Toggle

Quick and dirty;
i hated starting ActSync, -> tools -> Options -> Options -> uncheck 'When craddled' Eneble PC sync '...'
Everytime i had to change is, or Tomtom would not work, and i would see a Qtec trying to sync with my car !
So i made a quick, and not so dirty mortscript/mortrunner batch :
This is for the MDA 2/XDA2/Qtec 2020
Cut here
---8<-------------------------------------------------
Code:
Errorlevel Syntax
If regKeyEqualsDWord HKCU, ControlPanel\Comm, AutoCnct, 5
if question AutoActiveSync is On. Switch Off ?, ActiveSync when cradled
RegWriteDWord HKCU, ControlPanel\Comm, AutoCnct, 0
Else
Exit
Endif
Else
if question AutoActiveSync is Off. Switch On ?, ActiveSync when cradled
RegWriteDWord HKCU, ControlPanel\Comm, AutoCnct, 1
Else
Exit
Endif
---8<-------------------------------------------------
Save as toggleASync.mortrun or toggleASync.mscr and sitck it somewhere on the qtec and create a shortcut to it, install Mortrunner/Mortscript and assign a HW button to the shortcut, or add it to a Today launcher
Did the same for switching BT + profile on off..
Please test, since it don't work on my Qtec, i have BTTools installed
---8<-------------------------------------------------
Code:
Errorlevel Syntax
If regKeyExists HKCU, Software\PBT, PreferredAudioDevice
Message "BTTools is installed, Use it's TodayPlugin instead!", ToggleBT
Exit
Endif
If regKeyEqualsDWord HKCU, Software\Microsoft\Bluetooth\Settings, ScanMode, 1
if question Bluetooth is On. Switch Off ?, ToggleBT
RegWriteDWord HKCU, Software\Microsoft\Bluetooth\Settings, ScanMode, 0
RegWriteDWord HKCU, Software\HTC\BTProfile, On, 0
Else
Exit
Endif
Else
if question Bluetooth is Off. Switch On ?, ToggleBT
RegWriteDWord HKCU, Software\Microsoft\Bluetooth\Settings, ScanMode, 5
RegWriteDWord HKCU, Software\HTC\BTProfile, On, 1
Else
Exit
Endif
exit
---8<-------------------------------------------------
Save as ToggleBT.mscr or .mortrunner etc....

Howto create shortcuts pointing to the applications located in settings?

Hi,
I was just wondering if it's possible to create shortcuts to the different applications/services located in the settings section of the Tytn?? I'm trying to add some shortcuts to cLauncher, but the only applications I'm able to locate are those residing in the program section of the phone. Am I doing something wrong, or does this have be done programtically?
Thanks in advance!!
Mogg
You must connect your PDA to the PC with Activesync and then:
- in the desktop of the PC open a New Text Object
- write in the document one of the following string
- save the file as shortcut.lnk (where shortcut is the nome you want give to shortcut)
- copy the file on your PDA (for example in windows\start menu)
and you have the shortcut.
This are the strings (they are for wm2003 but many works also in wm2005)
Settings>Personal>Password>Password = 20#ctlpnl cplmain.cpl,1
Settings>Personal>Password>Hint = 22#ctlpnl cplmain.cpl,1,1
Settings>Personal>Owner Information>Identification = 20#ctlpnl cplmain.cpl,2
Settings>Personal>Owner Information>Notes = 22#ctlpnl cplmain.cpl,2,1
Settings>Personal>Owner Information>Options = 22#ctlpnl cplmain.cpl,2,2
Settings>System>Power>Main = 20#ctlpnl cplmain.cpl,3
Settings>System>Memory>Main = 20#ctlpnl cplmain.cpl,4
Settings>System>Memory>Storage Card = 22#ctlpnl cplmain.cpl,4,1
Settings>System>Memory>Running Programs = 22#ctlpnl cplmain.cpl,4,2 (usato come esempio più sopra)
Settings>System>About>Version = 20#ctlpnl cplmain.cpl,5
Settings>System>About>Device ID = 22#ctlpnl cplmain.cpl,5,1
Settings>System>About>Copyrights = 22#ctlpnl cplmain.cpl,5,2
Settings>System>Screen>General = 20#ctlpnl cplmain.cpl,7
Settings>System>Screen>Clear Type = 22#ctlpnl cplmain.cpl,7,1
Settings>System>Screen>Text Size = 22#ctlpnl cplmain.cpl,7,2
Settings>Personal>Input>Input Method = 20#ctlpnl cplmain.cpl,8
Settings>Personal>Input>Word Completion = 22#ctlpnl cplmain.cpl,8,1
Settings>Personal>Input>Options = 22#ctlpnl cplmain.cpl,8,2
Settings>Personal>Sounds & Notifications>Sounds = 20#ctlpnl cplmain.cpl,9
Settings>Personal>Sounds & Notifications>Notifications = 22#ctlpnl cplmain.cpl,9,1
Settings>System>Remove Programs = 21#ctlpnl cplmain.cpl,10
Settings>Personal>Menus>Start Menu = 21#ctlpnl cplmain.cpl,11
Settings>Personal>Menus>New Menu = 23#ctlpnl cplmain.cpl,11,1
Settings>Personal>Buttons>Program Buttons = 21#ctlpnl cplmain.cpl,12
Settings>Personal>Buttons>Up/Down Controls = 23#ctlpnl cplmain.cpl,12,1
Settings>Personal>Today>Appearance = 21#ctlpnl cplmain.cpl,13
Settings>Personal>Today>Items = 23#ctlpnl cplmain.cpl,13,1
Settings>Connections>Beam = 21#ctlpnl cplmain.cpl,15
Settings>System>Clock & Alarms>Time = 21#ctlpnl cplmain.cpl,16
Settings>System>Clock & Alarms>Alarms = 23#ctlpnl cplmain.cpl,16,2
Settings>Connections>Network Cards = 21#ctlpnl cplmain.cpl,17
Settings>System>Regional Settings>Region = 21#ctlpnl cplmain.cpl,18
Settings>System>Regional Settings>Number = 23#ctlpnl cplmain.cpl,18,1
Settings>System>Regional Settings>Currency = 23#ctlpnl cplmain.cpl,18,2
Settings>System>Regional Settings>Time = 23#ctlpnl cplmain.cpl,18,3
Settings>System>Regional Settings>Date = 23#ctlpnl cplmain.cpl,18,4
Settings>Connections>Connections>Task = 21#ctlpnl cplmain.cpl,19
Settings>Connections>Connection>Advanced = 23#ctlpnl cplmain.cpl,19,1
Settings>Personal>Phone>Phone = 21#ctlpnl cplmain.cpl,20
Settings>Personal>Phone>Services = 23#ctlpnl cplmain.cpl,20,1
Settings>Personal>Phone>Network = 23#ctlpnl cplmain.cpl,20,2
Settings>Personal>Phone>More = 23#ctlpnl cplmain.cpl,20,3
Settings>System>Certificates>Personal = 21#ctlpnl cplmain.cpl,22
Settings>System>Certificates>Root = 23#ctlpnl cplmain.cpl,22,1
Settings>Connections>Bluetooth>Mode = 21#ctlpnl cplmain.cpl,23
Settings>Connections>Bluetooth>Devices = 23#ctlpnl cplmain.cpl,23,1
If you have Total Commander in your PPC.
Duplicate any LNK file (eg copy 1 from folder A to folder B). Rename the extension from LNK to TXT. Open it (the Word software should open it) edit is as massi959 mentioned in the post before. Save. Rename it back to LNK. Done.
Thanks guys the *.lnk files did the trick
Mogg
Hi again,
I have a follow up question:
How can I extract the icons for the control panel applets? Now all my links are working fine in cLaunch, but I'm not able to locate the icons (default icons for the settings I've created shortcuts for)?
Thanks!
Mogg
If you want also to associate an icon to the created connection must download a set of icone, like this
http://www.gpcarreon.com/?p=14
Download the file, unzip and copy it into a folder named "icons" (for example) and then copy the folder in \Memory card\My documents (so you will have \Memory card\My Ducoments\icons)
Now you must add at the created command as mentioned above the following string "?\Memory Card\My Ducuments\icons\gpc.icons.exe,-9" (where -9 is the number of the icon you have chosen).
For example, a complete command will be therefore
22#ctlpnl cplmain.cpl,4,2?\Memory Card\My Documents\icons\gpc.icons.exe,-9
massi959 said:
If you want also to associate an icon to the created connection must download a set of icone, like this
http://www.gpcarreon.com/?p=14
Download the file, unzip and copy it into a folder named "icons" (for example) and then copy the folder in \Memory card\My documents (so you will have \Memory card\My Ducoments\icons)
Now you must add at the created command as mentioned above the following string "?\Memory Card\My Ducuments\icons\gpc.icons.exe,-9" (where -9 is the number of the icon you have chosen).
For example, a complete command will be therefore
22#ctlpnl cplmain.cpl,4,2?\Memory Card\My Documents\icons\gpc.icons.exe,-9
Click to expand...
Click to collapse
Thanks for this information!!! But what I really wanted to know is if it's possible to use the information (resources/icons) which I guess is already in the cplmain.cpl file, is this possible, or is my only option to use a set of icons which isn't already located on the device? (or just use the icons I can see while browsing the files on the device?)
Thanks agian
Mogg
massi959 said:
If you want also to associate an icon to the created connection must download a set of icone, like this
http://www.gpcarreon.com/?p=14
Download the file, unzip and copy it into a folder named "icons" (for example) and then copy the folder in \Memory card\My documents (so you will have \Memory card\My Ducoments\icons)
Now you must add at the created command as mentioned above the following string "?\Memory Card\My Ducuments\icons\gpc.icons.exe,-9" (where -9 is the number of the icon you have chosen).
For example, a complete command will be therefore
22#ctlpnl cplmain.cpl,4,2?\Memory Card\My Documents\icons\gpc.icons.exe,-9
Click to expand...
Click to collapse
Finally, Thanks!
mogg said:
Thanks for this information!!! But what I really wanted to know is if it's possible to use the information (resources/icons) which I guess is already in the cplmain.cpl file, is this possible, or is my only option to use a set of icons which isn't already located on the device? (or just use the icons I can see while browsing the files on the device?)
Thanks agian
Mogg
Click to expand...
Click to collapse
I know only these pointers for the icons in .cpl, but they do not work on TyTN (I suppose they are for wm2003 and wm2005 are different).
?\Windows\cplmain.cpl,-5001 (Warning)
?\Windows\cplmain.cpl,-5012 (HPC to desktop serial)
?\Windows\cplmain.cpl,-5013 (PPC to phone)
?\Windows\cplmain.cpl,-5014 (PPC to desktop)
?\Windows\cplmain.cpl,-5015 (PPC to cloud)
?\Windows\cplmain.cpl,-5020 Clock
?\Windows\cplmain.cpl,-5040 Owner Information
?\Windows\cplmain.cpl,-5050 Power
?\Windows\cplmain.cpl,-5060 (Windows logo over PPC)
?\Windows\cplmain.cpl,-5065 About
?\Windows\cplmain.cpl,-5067 Memory
?\Windows\cplmain.cpl,-5068 Regional Settings
?\Windows\cplmain.cpl,-5070 Backlight
?\Windows\cplmain.cpl,-5075 Contrast
?\Windows\cplmain.cpl,-5080 Screen
?\Windows\cplmain.cpl,-5095 Beam
?\Windows\cplmain.cpl,-5110 Sounds & Notifications
?\Windows\cplmain.cpl,-5131 (Generic Application window)
?\Windows\cplmain.cpl,-5132 (Blank)
?\Windows\cplmain.cpl,-5140 Input
?\Windows\cplmain.cpl,-5150 Menus
?\Windows\cplmain.cpl,-6000 Password
?\Windows\cplmain.cpl,-6100 Remove Programs
?\Windows\cplmain.cpl,-6200 Buttons
?\Windows\cplmain.cpl,-6300 Today
?\Windows\cplmain.cpl,-6400 (Phone handset)
?\Windows\cplmain.cpl,-6500 (Password again)
?\Windows\cplmain.cpl,-7024 (PPC to phone again)
?\Windows\cplmain.cpl,-7025 (PPC to cloud again)
?\Windows\cplmain.cpl,-7026 (PPC disconnected from cloud, with red zig-zag)
?\Windows\cplmain.cpl,-7030 (PPC connected to sqaure suzzle piece)
?\Windows\cplmain.cpl,-7071 (PPC connected to world)
?\Windows\cplmain.cpl,-7140 Connections
Hi,
These are great shortcuts. Is is possible to write a command line string that will link to the main control panel 'personal' tab? I don't want to open a specific applet, but just want to browse the control panel.
Thanks
Jake
Shortcut for password function
Hi massi959,
Is there a way to make a shortcut for the password function (as opposed to password settings)? I just want the password screen to come up when I tap on the link. Using the password settings link does lock the screen on demand but it also brings up the settings window each time the screen is unlocked (some people may actually find this functionality useful). I just want to activate the password lock on demand.
Thanks!
Hey anybody know how i can create shortcut to open start menu.
can somebody tell how to make a shortcut in system tray?
massi959 said:
Settings>Personal>Sounds & Notifications>Notifications = 22#ctlpnl cplmain.cpl,9,1
Click to expand...
Click to collapse
How can I achieve that AND also focus on a specific notification, like "New IM" or "Phone ring" or whatever?
anyone know how to create internet connection shortcut?
Hello
anyone know how to turn on bluetooth stereo shortcut?
thankx
Thanks a lot, very helpful posting!
So long, -ULISSES-
I Phone Theme for Windows mobile 5
I have followed the steps given in pdf document http://www.mediafire.com/?etah1xinxpy
but i am not getting ook and feel of I phd i mean i am not getting the interface what is shown please help
Rayan

MortScript command for WaitFor"In"active? (for hiding & showing today bars)

MortScript command for WaitFor"In"active? (for hiding & showing today bars)
So vjtottletodayIIalpha can hide the task bar, but since we use the task bar quite often so this is my idea:
A mort script that can execute the vjtoggle program when today shows up, and kill the program when the screen is occupied by other programs.
Can this be done? Any help? Please~~~?
Sorry for my bad english, I'll try to make it clearer:
Ok, so this probably doesn't sound very interesting for most people, but last night I did some digging and finally figured something out and it feels good.
But I STILL NEED HELP!
Anyone can tell me if there's a command that can achieve something like WaitForActive("AnyProgramButDesktop",-1) ?
I would really appreciate it!!!!!
The below script is what I have so far:
RegWriteDWord ( "HKLM", "Software\VJTodayToggle\", "SoftKeySize",26 )
RegWriteDWord ( "HKLM", "Software\VJTodayToggle\", "StartSize",26 )
Run ( "\Program Files\vjtoggletodayiialpha.exe" )
Sleep( 2000 )
If ( wndActive( "Desktop" ) )
RegWriteDWord ( "HKLM", "Software\VJTodayToggle\", "SoftKeySize",0 )
RegWriteDWord ( "HKLM", "Software\VJTodayToggle\", "StartSize",0 )
Run ( "\Program Files\vjtoggletodayiialpha.exe" )
Else
WaitForActive("Desktop",-1)
RegWriteDWord ( "HKLM", "Software\VJTodayToggle\", "SoftKeySize",0 )
RegWriteDWord ( "HKLM", "Software\VJTodayToggle\", "StartSize",0 )
Run ( "\Program Files\vjtoggletodayiialpha.exe" )
EndIf
Click to expand...
Click to collapse
Im actually lost about what your trying to achieve?
vijays toggletodayIIalpha just hides your soft button taskbar on the today screen. It comes back up in any other screen/program you launch.
Actually the program hides top & buttom bars, but when in other program only the buttom bar comes back, not the top bar. So what I wanna do is to make a script that detects whether the screen in occupied(active) by desktop/other apps, and hide/show the bars. Is it more obvious now? Sorry for my bad English

"Play All Songs" in WMP ?

Hi,
I'm making a script to launch WMP when my A2DP headphones are connecting to my phone, but I'd like to play all my songs too. In Titanium, there's the Music panel with the "Play all songs" button, and I'd like to know if it is possible to create a shortcut making the same thing.
Thanks
u could maybe make a playlist (.asx) with Mortscript and launch it...
nop, it's not what I'd like, and this for a good reason : launching WMP with a huge playlist (more than 500 songs) and you'll have to kill it... But launch WMP with the "Play All songs" button, and it works fine everytime
That's why I insist on the "play all songs" thing
ah.
well u could use mortscript to detect that the player is idle and then queue up the next track...
howdykeith said:
ah.
well u could use mortscript to detect that the player is idle and then queue up the next track...
Click to expand...
Click to collapse
Well, yeah... But it is just 1000x longer than just finding the good parameter for WMP or the right way to launch it playing all the songs ^^
But if I don't find a thing, maybe I'll make this like you said
Code:
#If Nitrogen running
If ( ProcExists( "Nitrogen.exe" ) )
#WHAT's PlayStatus??
#Paused
If ( PlayStatus <2 )
TickerDatum = "Nitrogen is Paused"
Else
#Playing song
SongTitle = RegRead( HKLM,"\System\State\Nitrogen\","SongTitle" )
SongArtist = RegRead( HKLM,"\System\State\Nitrogen\","SongArtist" )
TickerDatum = ( SongTitle eq "(none)") ? "Nitrogen is Playing" : SongTitle & " by " & SongArtist
#vol
EndIf
SongVol = RegRead( HKLM,"\System\State\Nitrogen\WM_NTG_GETVOLUME","WM_USER+3005" )
TickerDatum = (SongVol) ? "Nitrogen is Mute" : " Nitrogen Volume is at " & SongVol & "%"
#TimeElapsed - secs
#TimeTotal - secs
SongElaS = RegRead( HKLM,"\System\State\Nitrogen\","TimeElapsed" )
SongTotS = RegRead( HKLM,"\System\State\Nitrogen\","TimeTotal" )
TickerDatum = "At: " & (SongElaS / SongTotS) & "% of the Track... " & SongElaS & " Seconds" & " of " & SongTotS & " Seconds"
Call("PostStatus", TickerDatum, Delay, Icon)
Else
#wmp
If (RegKeyExists( HKCU,"System\State\MediaPlayer" ))
Icon = "CD1"
SongTitle = RegRead( HKCU,"System\State\MediaPlayer\","Title" )
SongArtist = RegRead( HKCU,"System\State\MediaPlayer\","WM/OriginalArtist" )
SongTrack = RegRead( HKCU,"System\State\MediaPlayer\","WM/TrackNumber" )
SongElapsed = "T" & RegRead( HKCU,"System\State\MediaPlayer\","Elapsed" )
sleep(Tick)
If (not SongElapsed eq ("T" & RegRead( HKCU,"System\State\MediaPlayer\","Elapsed")) )
TickerDatum = SongTitle & " by " & SongArtist
EndIf
EndIf
EndIf
Here is some code that doesn't look like i ever tested (PlayStatus?)...
Back to my script project, and can't find the simple code to just launch WMP and play all the files in the library...

[Q] How to start connection setup via MortScript

Hello,
I have a dualsim dapter and I want to configure my Phone for each SIM with a mort script because I hate to wait for the automatic detection of Connection Setup and then I have to press additionally 2 buttons ...
Can someone tell me how to force ConnectionSetup.exe to switch immediately to O2 settings or T-Mobile settings?
Thanks
I had a script doing the commands for "network wizard" a long time ago.
Code:
If( FileExists( "\windows\NetworkWizard.exe" ))
Sleep( 10000 )
Run( "\windows\NetworkWizard.exe" )
WaitForActive( "Network Wizard", 30 )
Sleep( 1000 )
SendCR
Sleep( 1000 )
SendKeys( "UN" )
Sleep( 1000 )
SendCR
Sleep( 1000 )
SendDown
Sleep( 1000 )
SendCR
Sleep( 1000 )
SendKeys( "A" )
Sleep( 1000 )
SendCR
Sleep( 1000 )
SendLeftSoft
Sleep( 1000 )
SendLeftSoft
Sleep( 1000 )
SendLeftSoft
EndIf
@RoryB
Thansk for the script, I will try to adapt it and at least I have an igea how it could work.
Great !
I cannot get it working.
The reason is if I open the ConnestionSetup.exe I have to choose from 2 drop down menus. I did not find a solution to choose the right value.
Homer-S said:
I cannot get it working.
The reason is if I open the ConnestionSetup.exe I have to choose from 2 drop down menus. I did not find a solution to choose the right value.
Click to expand...
Click to collapse
You could use MouseClick(x,y) where x,y are the coordinates of the drop down menu you want to select, then use SendKeys("??") where ?? is the first few letters of the item in the list under the drop down menu you want to select.
See the wiki for how to get the x,y coordinates.

Categories

Resources