PPCGeeks

PPCGeeks (http://forum.ppcgeeks.com/index.php)
-   HTC Touch Pro (http://forum.ppcgeeks.com/forumdisplay.php?f=63)
-   -   email notification changes (http://forum.ppcgeeks.com/showthread.php?t=65663)

codearn 04-20-2009 03:59 PM

email notification changes
 
hopefully this is an easy question... i am looking for a way to automate turning sound & vibrate notifications for email on and off. does anyone know if there is a way to script that to make it easy? i don't mind a couple button presses, but having to dig into the settings every night is driving me nuts.

Kris xK 04-20-2009 04:39 PM

Re: email notification changes
 
Supposedly SPB Phone Suite can do that, but I have never tried it.

rainfreak 04-20-2009 05:28 PM

Re: email notification changes
 
spb Phone Suite will do it, but it is not free. You could also look into mortscript, which is free, though it will require you to do more work to get it to do what you want.

codearn 04-21-2009 11:08 AM

Re: email notification changes
 
mortscript seems to be exactly what's needed. thanks a lot. any idea what registry key controls notifications?

haus 04-21-2009 11:13 AM

Re: email notification changes
 
If nobody knows / replies to you, the way I look for reg changes is to set the notifications to one state, export the registry using Resco Registry, then switch the notifications and export again (to a different filename). Then I transfer the .reg files to the desktop and do a comparison with pspad. You only need to export HKCU and HKLM (saves a lot of time), generally speaking.

Here's a sample mortscript I tried building to switch from normal to silent mode:

Code:

Choice( "Profile","Select Profile","Normal","Silent")
Case(1)
        # NORMAL MODE
    RegWriteString ("HKCU", "ControlPanel\Profiles\","ActiveProfile", "Normal")
    RegWriteString ("HKCU", "ControlPanel\Sounds\RingTone0\","Sound", "\Windows\Rings\Ring-Generic1.wma")
    RegWriteDword ("HKCU", "ControlPanel\SoundCategories\Ring\","InitVol", 2)
    RegWriteDword ("HKCU", "ControlPanel\Volume\","Ringer", 1717986918)
    RegWriteDword ("HKCU", "ControlPanel\Volume\","Volume", 2290649224)
    RegWriteDword ("HKCU", "ControlPanel\Notifications\ShellOverrides\","Mode", 0)

    exit
Case(2)
        # SILENT MODE
    RegWriteString ("HKCU", "ControlPanel\Profiles\","ActiveProfile", "Silent")
    RegWriteString ("HKCU", "ControlPanel\Sounds\RingTone0\","Sound", "*none*")
    RegWriteDword ("HKCU", "ControlPanel\SoundCategories\Ring\","InitVol", 0)
    RegWriteDword ("HKCU", "ControlPanel\Volume\","Ringer", 0)
    RegWriteDword ("HKCU", "ControlPanel\Volume\","Volume", 0)
    RegWriteDword ("HKCU", "ControlPanel\Notifications\ShellOverrides\","Mode", 2)

    exit
Case(0)
    exit
EndChoice
exit

Unfortunately it doesn't work because something about the TP volume applet undoes some of the changes moments after they are made. But it's a start. Once you figure out the registry changes, plug them in the script in place of mine and the mortscript should do what you want.

codearn 04-21-2009 11:23 AM

Re: email notification changes
 
try looking here: http://forum.ppcgeeks.com/showpost.p...43&postcount=4

its a big help

haus 04-21-2009 01:22 PM

Re: email notification changes
 
Thanks Codearn, but I was actually trying to help *you* by posting a sample mortscript that offers a choice and then makes reg edits based on that choice. I figured you could modify it to meet your needs once you figured out the values you needed to change based on your original post. :)

codearn 04-21-2009 01:41 PM

Re: email notification changes
 
actually i did start from it. havent finished yet but i dont see a reason why it shouldnt work. thanks again.

apinkel 04-21-2009 06:56 PM

Re: email notification changes
 
If you are interested I've got a mortscript scheduler that you can use to run mortscripts on a schedule you specify.

codearn 04-21-2009 10:46 PM

Re: email notification changes
 
Quote:

Originally Posted by apinkel (Post 866397)
If you are interested I've got a mortscript scheduler that you can use to run mortscripts on a schedule you specify.

that would be great. i have a script that runs great. scheduling it would be perfect.

apinkel 04-22-2009 01:15 PM

Re: email notification changes
 
I'll post it tonight when I get home.

apinkel 04-22-2009 10:41 PM

Re: email notification changes
 
Here's the scheduler script. It must be put in the \Windows\Startup folder. It uses the windows mobile notification queue so it does not impact battery life outside of the small amount of processing power to run this script when the event is scheduled to run. Change the events listed in the events array so it runs your script on the schedule you desire.

## Scheduled Events array:
## -The eventID (quoted in brackets []) format is d,hh,mm where...
## d is day of week (0=Sunday, 6=Saturday)
## hh is hour of day (00 to 23)
## mm is minute of hour (00-59)
## -The action (quoted to the right of the equal sign) is "full_path_of_script,parameter", parameters are option
schedule["1,08:00"] = "\program files\mortscript\scripts\setvolume.mscr,03"
schedule["1,17:00"] = "\program files\mortscript\scripts\setvolume.mscr,12"
schedule["2,08:00"] = "\program files\mortscript\scripts\setvolume.mscr,03"
schedule["2,17:00"] = "\program files\mortscript\scripts\setvolume.mscr,12"
schedule["3,08:00"] = "\program files\mortscript\scripts\setvolume.mscr,03"
schedule["3,17:00"] = "\program files\mortscript\scripts\setvolume.mscr,12"
schedule["4,08:00"] = "\program files\mortscript\scripts\setvolume.mscr,03"
schedule["4,17:00"] = "\program files\mortscript\scripts\setvolume.mscr,12"
schedule["5,08:00"] = "\program files\mortscript\scripts\setvolume.mscr,03"
schedule["5,17:00"] = "\program files\mortscript\scripts\setvolume.mscr,12"

##
## Initialize Variables and delete the logfile if it's greater than 10KB
currTimestamp = Timestamp()
currDayOfWeek = FormatTime("w", currTimestamp)
currHour = FormatTime("H", currTimestamp)
currMinute = FormatTime("i", currTimestamp)
currSeconds = FormatTime("s", currTimestamp)
startOfWeek = currTimestamp - (currDayOfWeek * 86400) - (currHour * 3600) - (currMinute * 60) - currSeconds
script = SystemPath("ScriptPath") & "\" & SystemPath("ScriptName") & SystemPath("ScriptExt")
logfile = SystemPath("ScriptExe") & "\scripts\schedulerLog.txt"
If (FileSize(logfile) > 10240)
Delete(logfile)
EndIf
WriteFile(logfile, "^NL^currTimestamp=" & currTimestamp & ",Day=" & currDayOfWeek & ",Time=" & currHour & ":" & currMinute & ":" & currSeconds & "^NL^", 1)

##
## Loop thru the scheduled events looking for the action to perform and the next event to schedule
currEvent = null
firstEventInSchedule = TRUE
haventFoundNextEvent = TRUE
ForEach event, action in array schedule
eventDayOfWeek = Substr(event,1,1)
eventHour = Substr(event,3,2)
eventMinute = Substr(event,6,2)
eventTimestamp = startOfWeek + (eventDayOfWeek * 86400) + (eventHour * 3600) + (eventMinute * 60)
If (firstEventInSchedule)
## Initialize the "next event to be scheduled" to next weeks first event
nextEvent = event
nextEventTimestamp = eventTimestamp + 604800
firstEventInSchedule = FALSE
EndIf
If (haventFoundNextEvent)
If (currTimestamp < eventTimestamp)
## We found the next event so save the event offset so it can be used to schedule the next event
nextEvent = event
nextEventTimestamp = eventTimestamp
haventFoundNextEvent = FALSE
WriteFile(logfile, "**Found Next event-->", 1)
Else
currEvent = event
currEventTimeStamp = eventTimestamp
EndIf
EndIf
WriteFile(logfile, "**Loop-event=" & event & ",eventTimestamp=" & eventTimestamp & ",Action= " & action & "^NL^", 1)
EndForEach
## At end of loop If a current event wasn't found it means the "current event" is the last event from the prior week
If (currEvent eq null)
currEvent = event
currEventTimeStamp = eventTimestamp - 604800
EndIf
WriteFile(logfile, "Curr Event--ID=" & currEvent & ",Timestamp=" & currEventTimestamp & ",action=" & schedule[currEvent] & "^NL^", 1)
WriteFile(logfile, "Next Event--ID=" & nextEvent & ",Timestamp=" & nextEventTimestamp & ",action=" & schedule[nextEvent] & "^NL^", 1)

##
## Remove notification queue entry that kicked off this run of the script then add an event to run this script for the next event
RemoveNotifications (script)
RunAt(nextEventTimestamp, script)

##
## Perform current scheduled action passing the timestamp of the current event as the last parameter
scriptToRun = part( schedule[currEvent],",",1 )
scriptParm = part( schedule[currEvent],",",2 )
callscript( scriptToRun , currEventTimeStamp , scriptParm)


All times are GMT -4. The time now is 09:18 AM.

Powered by vBulletin® ©2000 - 2026, Jelsoft Enterprises Ltd.
©2012 - PPCGeeks.com


Content Relevant URLs by vBSEO 3.6.0