In the last part of the review of GTD Timer we'll focus on the very powerful feature which makes this software unique - actions.
Actions allow GTD Timer to execute any command after a time period. Commands can be any executable application, command-line tool or script written in JScript or VBScript. While executing command GTD Timer also may pass parameters to it.
5. Using actions to run automated tasks
Each preset allows to set command line to execute after countdown finishes (configuring presets described in previous part of the review).
In the picture below show action configuration window accessible via Settings -> Presets -> Setup Preset.
To enable the action just click "Command line" radio button and two edit boxes will become available.
Example actions for this window:
- Force to shutdown system:
Command: shutdown
Parameters: -s -f -t 00 - Open "D:\Documents" folder:
Command: D:\Documents
Parameters: <Leave empty> - Open e-mail client with address user@example.com:
Command: mailto:user@example.com
Parameters: <Leave empty> - Navigate to URL http://productivity-science.com
Command: http://productivity-science.com
Parameters: <Leave empty> - Run script:
Command: c:\ScriptName.js
Parameters: <Leave empty>
So creating preset for some specific task like turning off PC after some period of time is very easy with GTD Timer.
6. Example script to continuously restart GTD Timer
As example script we provide here is intended to automatically restart GTD Timer each time when countdown finishes.
Here are steps to create the script and add it to GTD Timer:
1. Create Folder on your computer with path "C:\SCRIPTS".
2. Download zip archive: http://productivityscientific.com/downloads/refreshtray.zip. And extract program refreshtray.exe from that archive to folder "C:\SCRIPTS"
3. Copy next text to a text file with name "Restart.vbs" to that folder
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = 'gtdtimer.exe'") For Each objProcess in colProcessList
objProcess.Terminate()
Next
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "C:\Scripts\RefreshTray.exe"
command = """C:\Program Files\Productivity Scientific GTD Timer\Bin\GTDTimer.exe"" /T=10:00 /M=Message /P=4"
WshShell.Run command
4. Create new preset in GTD Timer, give it some name (Ex. "Continuous restart"), at the "Action" tab enter command line: "C:\Scripts\Restart.vbs".