RSS

 
WinEdt Macro Library  | WinEdt  next macro

worklog

This version, which is no longer maintained, has some workarounds for oddities in WinEdt's macro language prior to v. 5.2. It is tested on WinEdt 5.1, but may also work on previous versions. It's just not tested.

If you run WinEdt 5.2, get the new version of worklog.

Description

The purpose of this package of macros is to keep track of your working hours and minutes with WinEdt.

It gets the time when you open WinEdt and when you close it, and asks you on what you've been working.
This information is written into a table (the worklog): One file for every month, and another one containing the summary.
(Also, it calculates the average per day and week.)

The package consists of the following files:

00worklog.README this file in text format
main macros:
worklog_open.edt gets the current time and writes the table; invoked at WinEdt's Startup.
worklog_close.edt gets closing time and completes the table; invoked when you exit WinEdt
additional macros:
wl_chart.edt generates a tex-file that uses schedule.sty and produces a nice looking chart.
wl_status.edt can be used to include the actual Open Time
in the Status Line's Custom Info.
wl_month.edt use this to get the total Open Time and average till now.
wl_open.edt gets the worklog with one shortcut.
wl_read.edt lets you choose which month to read.
data files: (some are provided to avoid 'File Not Found'-Errors)
$month$.worklog the generated worklog for the respective month
total.worklog containing the monthly summaries
month.worklog keeping the total hours for the month
day.worklog keeping the hours for the day
wl_$week$.tex generated tex-file containing the chart for the week (only if wanted)
wl_$week$.data the raw data, will be created by worklog
wl_chart.data the base file for the LaTeX chart

Installation Instructions

If you are using WinEdt v5.2, you can get this package in two ways. Check out here.

To use this package, you will want to follow these steps:

  1. Unzip the files into a newly created directory %B\Macros\worklog.
    (%B stands for WinEdt's directory (e.g. C:\Programs\WinEdt).)
  2. Tell WinEdt to execute worklog_open.edt on Startup and worklog_close.edt on Exit.
    To do this,
    1. include the following line:
      Exe('%B\Macros\worklog\worklog_open.edt');
      
      in your Startup Macro (probably %B\config\Startup.edt; if not see Options | Preferences | Events), and
    2. include the line
      Exe('%B\Macros\worklog\worklog_close.edt');
      
      in %B\config\Exit.edt.
      (If you cannot find this file, look in your Startup Macro for the line beginning with SetOnExit(). The name in the brackets denotes the file you're looking for.
      If you cannot find this line either, put this:
      SetOnExit(!"[Exe('%B\Macros\worklog\worklog_close.edt')]");
      
      in your Startup Macro.)
  3. That's (probably) it.
  4. Some customization might be needed:
    • If you use the Global Register %1 you need to replace all instances of this in worklog_open.edt and worklog_close.edt with some other, unused Global Register
      (if you are using all Global Registers for yourself then you can either think of a different solution or you can't use the worklog-macros).
    • If you want a chart to be automatically generated AND your computer's language is not english, you have to translate the names of the days (Monday, Tuesday, etc.) in wl_chart.edt to your language (NB: it depends on Windows' language, not WinEdt's).
  5. Some customization might be wanted:
    • By default, the new day starts at midnight. If you don't want this (if you work at nights, for example), uncomment some lines and delete some others in 'worklog_open.edt'. You will find them.

Additional Macros:

You might find these extras useful:

  • The simplest first: If you want to have a quick look at your worklog without searching for the file all the time, assign a menu entry and / or a shortcut to the macro wl_open.edt
    (read WinEdt's Online Help to learn how to assign shortcuts to macros).
  • An enhanced version of this is wl_read.edt, that lets you choose the month of which you want to see the table or processes the chart and opens it in yap.
  • If you want to know the total hours and the daily and weekly average you've been working this month so far, you can invoke the macro wl_month.edt.
  • If you want to always see your Daily Up Time, include the line
    Exe('%B\Macros\worklog\wl_status.edt');
    
    in your Startup Macro (see above) and enable 'Show Custom Info' in Options | Apperance | Status Line.
    It shows two times: the Uptime for today + the actual time for this session (in minutes). It won't be updated automatically, only when you click on it.
  • When worklog had evolved to its final state, I discovered schedule.sty on CTAN. So I wrote another macro wl_chart.edt that converts the output of worklog to a schedule.sty readable tex.file.
    So with these two packages you can automatically produce nice-looking charts of your weekly working-hours. Without (almost) doing anything.

Download

/worklog51.zip (for WinEdt 5.1)

schedule.sty (from CTAN)

Macro contributed by Robert <w.m.lgmx.net>

WinEdt Macro Library  | WinEdt  next macro