Published Feb 2, 2025
Welcome to the guide on automating your time tracking in NotePlan using timeblocks. This process will help you monitor the time spent on various tasks, projects, and goals efficiently.
![]() |
Daily Shortcut |
Weekly Shortcut | |
Keyboard Maestro TimeBlock Macro | |
Daily Template with Links | |
Weekly Note Template |
By leveraging NotePlan's timeblocking feature, combined with Apple Shortcuts and optional tools like Keyboard Maestro, you can automate the summarization and reporting of your daily and weekly activities. This method enhances productivity by providing clear insights into how your time is allocated.
Create specific tags to categorize your tasks. These tags help in identifying and summarizing the time spent on different activities.
#Work
, #Study
, #Exercise
, #ProjectX
Note: Including a hashtag (#
) allows for easy searching within NotePlan.
You can add timeblocks in two ways:
AppleScript Example:
on run
-- Ask the user for the start time
set startTime to text returned of (display dialog "Enter the start time (e.g., 2:45 PM):" default answer "")
-- Validate the start time format
if startTime does not contain ":" or (startTime does not contain "AM" and startTime does not contain "PM") then
display dialog "Invalid time format. Please use a format like '2:45 PM'." buttons {"OK"} default button "OK"
return ""
end if
-- Ask the user for the duration in minutes
set durationText to text returned of (display dialog "Enter the duration in minutes:" default answer "30")
-- Validate that the duration is a number
try
set duration to durationText as integer
if duration ≤ 0 then error
on error
display dialog "Invalid duration. Please enter a positive number." buttons {"OK"} default button "OK"
return ""
end try
-- Parse the input time
set parsedTime to parseTime(startTime)
if parsedTime is missing value then
display dialog "Failed to parse the time. Please try again." buttons {"OK"} default button "OK"
return ""
end if
-- Add the specified duration to the parsed time
set endTime to parsedTime + (duration * 60) -- Convert minutes to seconds
-- Format the output times
set originalTime to formatTime(parsedTime)
set newTime to formatTime(endTime)
-- Combine the result string with the clock emoji
set result to "⏰ " & originalTime & " - " & newTime
-- Return the result to Keyboard Maestro
return result
end run
-- Function to parse time text into seconds from midnight
on parseTime(timeText)
try
set AppleScript's text item delimiters to {" "}
set parts to text items of timeText
set theTime to first item of parts
set ampm to second item of parts
set AppleScript's text item delimiters to {":"}
set timeParts to text items of theTime
set hours to (first item of timeParts) as integer
set minutes to (second item of timeParts) as integer
if ampm is "PM" and hours ≠ 12 then
set hours to hours + 12
else if ampm is "AM" and hours = 12 then
set hours to 0
end if
return (hours * 3600) + (minutes * 60) -- Return time in seconds from midnight
on error
return missing value
end try
end parseTime
-- Function to format seconds into a time string (e.g., 2:45 PM)
on formatTime(totalSeconds)
set hours to totalSeconds div 3600
set minutes to (totalSeconds mod 3600) div 60
if hours ≥ 12 then
set ampm to "PM"
if hours > 12 then set hours to hours - 12
else
set ampm to "AM"
if hours = 0 then set hours to 12
end if
if minutes < 10 then
set minutes to "0" & minutes
end if
return (hours as text) & ":" & (minutes as text) & " " & ampm
end formatTime
Note: This script can be triggered using Keyboard Maestro or directly through the Shortcuts app.
To track multiple categories for the same time period, include multiple tags in your task description.
Example:
09:00 AM - 10:00 AM Project Meeting #Work #ProjectX
When processed, the time will be attributed to both #Work
and #ProjectX
.
Use these Apple Shortcut to process your daily notes and generate summaries.
Update the calendar you are using for timeblocking in the shortcut Update the lists you will be using/tracking
Steps:
Tip: Add a link at the top of your daily template to launch this shortcut for convenience.