Hi @wrothnie - @pete31 is right. I set & sort by creation date (because you can then sort chronologically in DTTG easily).
Here’s the script if you would like it (disclaimer: I’m not a scripter and most of what I have has been cobbled together from scripts which Christian, Jim, pete31 and others have been kind enough to share, but it works for me. Any suggested improvements would be gratefully received.
)
-- Creates note with date, event and link in inbox and sets creation date to date of source document
use AppleScript version "2.4"
use framework "AppKit"
use scripting additions
property theDelimiter : return & return -- or e.g. linefeed & linefeed
property theSeparator : "---" & return
tell application id "DNtp"
try
if not (exists think window 1) then
error "Please open a window"
else
set theWindow to think window 1
end if
set thisRecord to content record of theWindow
if thisRecord ≠missing value then
set theType to (type of thisRecord) as string
try
set theSelectedText to selected text of theWindow & "" as string
on error
display notification "No text selected"
set theSelectedText to ""
end try
if theType is in {"PDF document", "«constant ****pdf »"} then
set thePage to current page of theWindow
set theRefURL to reference URL of thisRecord & "?page=" & thePage
end if
end if
set theDatabase to current database
set defaultDate to creation date of thisRecord
-- get creation date of thisRecord
set theYear to the ((year in defaultDate) as integer) as string
if (month in defaultDate) as integer is less than 10 then
set theMonth to "0" & ((month in defaultDate) as integer) as string
else
set theMonth to ((month in defaultDate) as integer) as string
end if
if (day in defaultDate) as integer is less than 10 then
set theDay to "0" & the ((day in defaultDate) as integer) as string
else
set theDay to the ((day in defaultDate) as integer) as string
end if
if (hours in defaultDate) as integer is less than 10 then
set theHour to "0" & ((hours in defaultDate) as integer) as string
else
set theHour to ((hours in defaultDate) as integer) as string
end if
if (minutes in defaultDate) as integer is less than 10 then
set theMinutes to "0" & ((minutes in defaultDate) as integer) as string
else
set theMinutes to ((minutes in defaultDate) as integer) as string
end if
set displayDate to theDay & theMonth & theYear & " " & theHour & theMinutes as string
-- get doc link
set theInbox to (incoming group of the current database)
set theName to name of thisRecord
-- determines whether to include selected text or not
if theSelectedText is not "" then
set theContent to theDelimiter & theSelectedText & theDelimiter
else
set theContent to "" & theDelimiter
end if
-- prompt for date and event
set userDate to display name editor "Date (DDMMYYYY HHMM)" info "Enter date of the event (default is date of record)." default answer displayDate
set chronoCreationDate to creation date of thisRecord
set displayMinutes to "00"
try
set displayDay to (characters 1 thru 2 in userDate) as string
set displayMonth to (characters 3 thru 4 in userDate) as string
set displayYear to (characters 5 thru 8 in userDate) as string
end try
try
set displayHours to (characters 10 thru 11 in userDate) as string
set displayMinutes to (characters 12 thru 13 in userDate) as string
end try
if displayMinutes is not "00" then
set displayDate to displayDay & "." & displayMonth & "." & displayYear & " " & displayHours & ":" & displayMinutes
set year of chronoCreationDate to displayYear as integer
set month of chronoCreationDate to displayMonth as integer
set day of chronoCreationDate to displayDay as integer
set hours of chronoCreationDate to displayHours as integer
set minutes of chronoCreationDate to displayMinutes as integer
set seconds of chronoCreationDate to 0
else
set displayDate to displayDay & "." & displayMonth & "." & displayYear
set year of chronoCreationDate to displayYear as integer
set month of chronoCreationDate to displayMonth as integer
set day of chronoCreationDate to displayDay as integer
set hours of chronoCreationDate to 0
set minutes of chronoCreationDate to 0
set seconds of chronoCreationDate to 0
end if
set theEvent to display name editor "Event" info "Enter the event this record relates to."
if displayDay is "01" then
set altDate to display name editor "Do you want to assign a different display date?" info "Example display date, eg Sep YYYY?" default answer (displayDay & "." & displayMonth & "." & displayYear)
else
set altDate to displayDate
end if
set theLocation to display group selector "Destination" buttons {"Cancel", "OK"}
create record with {name:(altDate & " - " & theEvent), type:markdown, creation date:(chronoCreationDate), content:("# " & altDate & " - " & theEvent & theDelimiter & return & "[" & theName & "](" & theRefURL & ")") & theContent} in theLocation
on error error_message number error_number
hide progress indicator
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell
It’s quite quick to create as you go through documents in a new brief. The idea is you can copy key (ie highlighted) text about the event from the document you are looking at into the note (but you don’t have to copy anything) with a link back to the document. I go back and manually add links in individual notes to additional evidence later (eg another witness’ conflicting testimony about a key event).
This is what the process looks like (I’ve taken it from a random court case for the purposes of this example):
(1) Trigger script using whatever keystroke you assing:
(It’s showing a default date and time which is the creation date of the particular document I’m using here.)
(2) Type in the date of the event you want to capture:
I’ve tweaked to allow you to put in a “display date” such as a month or a year where you don’t have enough information to input a date in DDMMYYYY format or want to put in a date range (eg “Apr to June 2009”). An additional input box for the display date comes up whenever the date is “01”.
You can put in a time as well, but don’t have to.
(3) Type in a description of the event
(4) The script will pull up the sorter:
I use a subdirectory (“@ chronology”) in each project/ matter database (the reason for the “@” is so it appears near the top and stands out from other subdirectories).
(5) This is how it looks as you build it up: