CheckbookScript


Outdated!!!

This information is for TaskPaper 2 which is old and outdated. TaskPaper 3 is the current version of TaskPaper. For TaskPaper 3 support please visit the support forums.


After trying out a bunch of checkbook apps that were both pricy and had too many features compared to what I needed, I decided that I could do it in TaskPaper.

To use this. Just make tasks with the format "Entry name: Amount" (like "Groceries: -30.80"). Then select the tasks you want to total and run this script:

on splitText(delimiter, someText)
    set prevTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to delimiter
    set output to text items of someText
    set AppleScript's text item delimiters to prevTIDs
    return output
end splitText

tell application "TaskPaper"
    set selected_entries to get selected entries
    set total to 0
    repeat with each_task in selected_entries
        tell each_task
            if entry type of each_task is task type then
                set theContent to text content of each_task
                set thelist to my splitText(":", theContent)
                set amount to item 2 of thelist
                set total to total + amount
            end if
        end tell
    end repeat
end tell
display dialog total

The script adds up all of the amounts that you have highlighted (it ignores project and note lines) and displays a box with the total.