ObsidianSimpleTimeTracker
ObsidianSimpleTimeTracker copied to clipboard
[Suggestion] Possible to add a left sidebar view that see all the tacker?
RT, or a way to find which one is still running to prevent from forgetting
This would be AWESOME!!!!
You can use this global search in Obsidian to find which timers are still running:
/(?<!"startTime":null,)"endTime":null/
I also wrote this AHK script (Windows only) which shows a modal when closing Obsidian if any timer is unstopped:
#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.
Main:
SetTitleMatchMode RegEx
WinWait,- Obsidian v[0-9. ]+$
WinWaitClose,- Obsidian v[0-9. ]+$
ObsisdianCheckUnclosedTimers()
Goto, Main
ObsisdianCheckUnclosedTimers(){
VaultPath := "C:\Path\To\Vault"
if !FileExist(VaultPath)
return
SearchPattern := VaultPath . "*.md"
Loop, Files, %SearchPattern%, R
{
FileRead, FileContents, %A_LoopFileFullPath%
If (ErrorLevel) {
MsgBox Error : %A_LastError%
return
}
FoundPos := RegExMatch(FileContents, "(?<!""startTime"":null,)""endTime"":null")
If (FoundPos)
{
MsgBox, 4,, Timers are still running. Run Obsidian?
IfMsgBox Yes
Run, obsidian://search?vault=Notes&query=/(?<!.startTime.:null`,).endTime.:null/
return
}
}
return
}