<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sarel, a Pragmatic Programmer &#187; Work</title>
	<atom:link href="http://blog.botha.us/sarel/category/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.botha.us/sarel</link>
	<description></description>
	<lastBuildDate>Thu, 14 Jan 2021 12:46:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.2.38</generator>
	<item>
		<title>Completing Your Timesheet Completely</title>
		<link>http://blog.botha.us/sarel/completing-your-timesheet-completely/</link>
		<comments>http://blog.botha.us/sarel/completing-your-timesheet-completely/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 06:56:10 +0000</pubDate>
		<dc:creator><![CDATA[sarel]]></dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[timesheet]]></category>
		<category><![CDATA[vbs]]></category>

		<guid isPermaLink="false">http://blog.botha.us/sarel/?p=36</guid>
		<description><![CDATA[I recently saw mention of a time-keeping application that takes screen shots of your desktop every 5 minutes or so. At the end of the week you can then play back your week to see what you did and figure out who to bill for what. This sounded like a great tool to me because [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I recently saw mention of a time-keeping application that takes screen shots of your desktop every 5 minutes or so. At the end of the week you can then play back your week to see what you did and figure out who to bill for what. This sounded like a great tool to me because I often forget what I was doing on a given day when reviewing my timesheet so I end up looking at my sent email for that time slot to try and jog my memory.</p>
<p>I figured what this program was doing is actually really simple and I could do it myself so I took a stab at it and cobbled the following script together. Unfortunately it has a couple dependencies: Imagemagick and Boxcutter. Look at the comments below for more info.</p>
<p>[vb]&#8217; VB Script to take time-stamped screenshot and convert to JPEG<br />
&#8216; Setup to run from Scheduled Tasks every 5 minutes to have a record of what<br />
&#8216; you did this week<br />
&#8216;<br />
&#8216; NOTES<br />
&#8216; It doesn&#8217;t clean up after itself<br />
&#8216; On my machine with 1280&#215;800 display if it runs every 5 minutes with quality<br />
&#8216; set to 40 it uses around 30MB every day for image storage. After 30 days<br />
&#8216; that&#8217;s 900 MB!<br />
&#8216; You can adjust the quality to increase or decrease file size.<br />
&#8216; Imagemagick is required. It is used to convert the BMP to JPEG.<br />
&#8216; The convert command from Imagemagick must be on the path<br />
&#8216; The Boxcutter program is required. You can download it from here:<br />
&#8216; http://rasm.ods.org/boxcutter/<br />
&#8216; Place this VBS in the same directory that you extract boxcutter.</p>
<p>Public Const OUTPUTPATH = &#8220;d:\screenshots&#8221;<br />
Public Const TEMPFILE = &#8220;c:\newss.bmp&#8221;<br />
Public const JPEG_QUALITY = 40</p>
<p>Function PadDigits(n, totalDigits)<br />
PadDigits = Right(String(totalDigits,&#8221;0&#8243;) &amp; n, totalDigits)<br />
End Function</p>
<p>Sub DoIt()</p>
<p>Dim WSHShell<br />
Set WSHShell = WScript.CreateObject(&#8220;WScript.Shell&#8221;)</p>
<p>Dim oFSO<br />
Set oFSO = WScript.CreateObject(&#8220;Scripting.FileSystemObject&#8221;)</p>
<p>dim fileName, folderName, folderPath<br />
folderName = &#8220;&#8221; &amp; Year(Now) &amp; PadDigits(Month(Now), 2) &amp; PadDigits(Day(Now), 2)<br />
fileName = folderName &amp; &#8220;_&#8221; &amp; PadDigits(Hour(Now), 2) &amp; PadDigits(Minute(Now), 2) &amp; PadDigits(Second(Now), 2) &amp; &#8220;.jpg&#8221;</p>
<p>folderPath = OUTPUTPATH &amp; &#8220;\&#8221; &amp; folderName</p>
<p>&#8216; Take screen shot<br />
&#8216; 7 means new window is minimized<br />
call WSHShell.Run (&#8220;boxcutter.exe -f &#8221; &amp; TEMPFILE, 7)<br />
WScript.Sleep 3000</p>
<p>If Not oFSO.FolderExists(OUTPUTPATH) Then<br />
&#8216; Create folder if it doesn&#8217;t exist<br />
Call oFSO.Createfolder(OUTPUTPATH)<br />
End If</p>
<p>If Not oFSO.FolderExists(folderPath) Then<br />
&#8216; Create folder if it doesn&#8217;t exist<br />
Call oFSO.CreateFolder(folderPath)<br />
End If</p>
<p>&#8216; Convert to JPEG<br />
&#8216; 7 means new window is minimized<br />
call WSHShell.Run (&#8220;convert -quality &#8221; &amp; JPEG_QUALITY &amp; &#8221; &#8221; &amp; TEMPFILE &amp; &#8221; &#8221; &amp; folderPath &amp; &#8220;\&#8221; &amp; fileName, 7)<br />
WScript.Sleep 3000</p>
<p>If oFSO.FileExists(TEMPFILE) Then<br />
&#8216; Delete bmp file<br />
Call oFSO.DeleteFile (TEMPFILE)<br />
end If</p>
<p>End Sub</p>
<p>&#8216; actually run our Sub above<br />
DoIt<br />
[/vb]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.botha.us/sarel/completing-your-timesheet-completely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
