I've have this 2 scripts which actually do the same but the other one is with a timer.
function 1:
code:
function OnEvent_Signout(Email){
new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
}
function 2:
code:
function OnEvent_Signout(Email)
{
MsgPlus.AddTimer("countdown", 10000)
}
function OnEvent_Timer(TimerId)
{ new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
}
I would like to have these two functions in one script but beeing able to chose between those 2 and turning it off completely.
exp: Plus! Menu> -Function 1
-Delayed function 2
-Off
So if function 1 or 2 is selected it may only be activated on signout.
if anyone would like to have a look at it.
thanks
EDIT:
I gave it another try, now i get the menu and no errors
but it does not work
code:
function OnGetScriptMenu(nLocation) {
if (nLocation == 1){
return '<ScriptMenu>'
+ '<MenuEntry Id=\"fnormal\">normal</MenuEntry>'
+ '<MenuEntry Id=\"fdelay\">delay</MenuEntry>'
+ '<MenuEntry Id=\"foff\">off</MenuEntry>'
+ '</ScriptMenu>';
}else{
return '';
}
}
function OnEvent_MenuClicked(sMenuId){
if(sMenuId=="fnormal"){
MsgPlus.DisplayToast("Menu Click", "Menu Item #1 was clicked!");
function OnEvent_Signout(Email){
new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
}
}
if(sMenuId=="fdelay"){
MsgPlus.DisplayToast("Menu Click", "Menu Item #2 was clicked!");
function OnEvent_Signout(Email)
{
MsgPlus.AddTimer("countdown", 10000)
}
function OnEvent_Timer(TimerId)
{ new ActiveXObject('WScript.Shell').Run("\"C:\\Task.exe\"");
}
if(sMenuId=="foff"){
MsgPlus.DisplayToast("Menu Click", "Menu Item #3 was clicked!");
}
}
}