Warning: Illegal string offset 'flags' in /home/project-web/kmeleon/htdocs/erfurt-1.02b/ewiki.php on line 2556

Warning: strpos() expects parameter 1 to be string, array given in /home/project-web/kmeleon/htdocs/erfurt-1.02b/ewiki.php on line 2486

Warning: Illegal string offset 'flags' in /home/project-web/kmeleon/htdocs/erfurt-1.02b/ewiki.php on line 2556

Warning: strpos() expects parameter 1 to be string, array given in /home/project-web/kmeleon/htdocs/erfurt-1.02b/ewiki.php on line 2486

Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /home/project-web/kmeleon/htdocs/erfurt-1.02b/ewiki.php on line 1756
K-Meleon - view;KmmPageTimer

K-Meleon

KMeleonWiki > Resources > MacroLibrary > KmmPageTimer

Submitted by: JamesD



Notes:

Allows the user to set a timer for a page. Timers can be set on multiple tabs concurrently. The macro anticipates that the page/tab will not change title.




Open your User Macro Folder (Edit > Configuration > User-Defined Macros) or your Macro Folder (Edit > Configuration > Macros) and create the following text file(s):

PageTimer.kmm

#  K-Meleon Macros (http://kmeleon.sourceforge.net/wiki/index.php?id=MacroLanguage)
#
# ---------- PageTimer.kmm
# ---------- K-Meleon Macro Language Page timer/reminder ---------------
# ---------- set a number of minutes to wait for a reminder
# ---------- anticipates that the page/tab will not change title
#
# Dependencies        : main.kmm, Windows Scripting Host
# Resources           : -
# Preferences         : -
# Version             :  1.0   2008-10-28
# --------------------------------------------------------------------------------
#

PageTimer_RunCode{
        $_PageTimer_CurrentPage = $TITLE ;
        $_PageTimer_Minutes = prompt( "Enter number of minutes", "Set timer value" );
        $_PageTimer_Milliseconds = $_PageTimer_Minutes * ( 60 * 1000 ) ;
        exec("wscript.exe \"".$_PageTimer_Path."\" \"".$_PageTimer_CurrentPage."\" \"".$_PageTimer_Milliseconds."\"") ;
        }

_PageTimer_BuildMenu{
        # add another option to Tools menu 
        setmenu("&Tools",macro,"PageTimer",PageTimer_RunCode,misc);
        }

_PageTimer_SetAccels{
setaccel("ALT p", "macros(PageTimer_RunCode)");
        }

_PageTimer_GetPath{
        ### PageTimer.js is supposed to be located in the same folder as PageTimer.kmm (this file).
        ### If it isn't, Windows Script Host will notify the user.
        ### Double underscore makes variable local only.
        $__Data=readfile(getfolder(MacroFolder)."\\PageTimer.kmm");
        $_PageTimer_Path=getfolder($__Data==""?UserMacroFolder:MacroFolder)."\\PageTimer.js";
        }

$OnStartup=$OnStartup."_PageTimer_GetPath;";
$OnInit=$OnInit."_PageTimer_SetAccels;";
$OnInit=$OnInit."_PageTimer_BuildMenu;";
$macroModules=$macroModules."PageTimer;";


PageTimer.js

/* PageTimer.js by JamesD, version  1.0  2008-10-28

   This script is a helper application for the K-Meleon Macro Module PageTimer.kmm that
   enables you to set a timer/reminder for a page.

   Windows Script Host 1.0 (or better) required!

   WSH is part of Microsoft Internet Explorer 5.0 and newer. Latest version of WSH is
   available at http://msdn.microsoft.com/scripting/
*/


if (WScript.Arguments.count()==2) {
        var PageTimer_CurrentPage  = WScript.Arguments(0);
        var PageTimer_Milliseconds  = WScript.Arguments(1);
        WScript.Sleep( PageTimer_Milliseconds) ;
        var d = new Date();
        WScript.Echo("Timer expired on page \n\n " + PageTimer_CurrentPage + "\n\n " + d) ;
}
else
{
objArgs = WScript.Arguments ;
WScript.Echo(WScript.Arguments.Count());
for (i=0; i<objArgs.length; i++)
        {
            WScript.Echo(objArgs(i))
        }
}        


Comments & Questions

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.