[AHK][UDT] "Time Estimate" as "Due Time" in Week Planner

A place to post your ideas and solutions for how best to make use of the software

Moderators: abstr, Niko

Post Reply
Niko
Posts: 239
Joined: Wed Sep 18, 2019 6:48 am

[AHK][UDT] "Time Estimate" as "Due Time" in Week Planner

Post by Niko » Fri Nov 08, 2019 7:01 pm

TimeEstimate.gif
TimeEstimate.gif (1.02 MiB) Viewed 2840 times
The script allows you to pass the values from the field "Time Estimate" to "Due Time" in the week planner tab. It's helpful when you schedule tasks in advance and set the estimated time for the tasks (Which usually are the Full Day tasks). So when you drag and drop the tasks in the Day view tab you don't need to modify the duration of these tasks.
Limitations
Doesn't work correctly with small intervalls (less than 30 minutes)
Manual
1. Follow steps 1 - 4 from this tut viewtopic.php?f=12&t=242 taking into account that time estimate is the Edit Field, and StartTime is the Combobox
2. If you want, you could adopt it to the following script viewtopic.php?f=12&t=262
3. Run the script.

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.


Numpad2::
ControlGetText, StartTime, ComboBox40,  ahk_exe Todolist.exe
ControlGetText, EstimatedTime, Edit25,  ahk_exe Todolist.exe

Regexmatch(StartTime, "(\d+):(\d+)", m) ; HOURS AND MINUTES GET

zolo =.

EstimateTime2 = %EstimatedTime%
EstimateTime2 := Format("{:.2f}", EstimateTime2)






if Regexmatch(EstimatedTime, "(\d).(\d+)", s) and InStr(EstimatedTime, zolo) is true
{
	bk = 0.%s2%
	bk *= 60
	bk := Format("{:d}", bk)
	;LESS than 1 hour
	if (EstimateTime2 < 1)
	{
		if (bk = 0)
		{
			bk = 00
		}
		Run C:\THEPATH\ToDoList.exe /$(seltid) -st 13:00 -dt 14:00 
		Sleep 800
		Run C:\THEPATH\ToDoList.exe /$(seltid) -dt %m1%:%bk%
	}
	else
	{

		OutPutVar1 := m1 + s1 ;hours from start time + time estimate
		OutPutVar2 = %s2%
		
		Run C:\THEPATH\ToDoList.exe /$(seltid) -st 13:00 -dt 14:00 
		Sleep 800
		Run C:\THEPATH\ToDoList.exe /$(seltid) -dt %OutPutVar1%:%bk%
	}
	
}

else
;HOURS ONLY
{
	Regexmatch(EstimatedTime, "(\d)", b)
	OutPutVar3 := m1+b1
	Run C:\THEPATH\ToDoList.exe /$(seltid) -dt %OutPutVar3%:00
}

	



Post Reply