Time Machine for a Daterange of the Document

Hi Community.
I came to an Idea of a “WayBack Machine” inside of devonthink.

You can get use out of it if you wanna see a Daterange from a specific Document.

Mostly i wanna review Ideas from specific Dates.
The idea behind is, if you go deep into a Thread, you will mostly import Files that a similar, but not always shown in the devonthink review Window.
If you select a File inside devonthink you can start to review the Daterange from that selected document.
e.g. 5 Days in the Future and 5 Days in the Past.

You can select between creation date, addition date and modification date .

Mostly you can fall with this into the details you imported or changed at that time.
That maybe helps you to Remind something.

Hopefully that pictures gets uploaded…

1
2
This Example shows only the additionDate from a previous selected E-Mail.

The AppleScript for that is here:

try
tell application “DEVONthink 3”

  choose from list {"creation date", "addition date", "modification date"} with title "Type Of shift" OK button name "Type" cancel button name "cancel" default items {"addition date"}
  set specifiedDateRange to item 1 of the result as string
  set specifiedStringSearch to ""
  
  choose from list {"0", "1", "2", "3", "4", "5"} with title "Days Shift" OK button name "Shift now" cancel button name "cancel" default items {"1"}
  set daysToCalc to item 1 of the result as integer
  activate
  set this_selection to the selection
  if this_selection is {} then error "Please select some contents."
  
  set theDate to 0
  if specifiedDateRange = "creation date" then
  	set theDate to (creation date of item 1 of this_selection)
  	set specifiedStringSearch to "creationDate"
  end if
  if specifiedDateRange = "addition date" then
  	set theDate to (addition date of item 1 of this_selection)
  	set specifiedStringSearch to "additionDate"
  	
  end if
  if specifiedDateRange is "modification date" then
  	set theDate to (modification date of item 1 of this_selection)
  	set specifiedStringSearch to "modificationDate"
  end if
  set myNewDateStart to theDate - (daysToCalc * days)
  set myNewDateEnd to theDate + (daysToCalc * days)
  
  set theMonthStart to ((month in myNewDateStart) as integer) as string
  set theDayStart to the day in myNewDateStart as string
  set theYearStart to the year in myNewDateStart as string
  
  set theMonthEnd to ((month in myNewDateEnd) as integer) as string
  set theDayEnd to the day in myNewDateEnd as string
  set theYearEnd to the year in myNewDateEnd as string
  
  
  
  --log theDate & theDayStart & theMonthStart & theYearStart
  
  set search query of viewer window 1 to (specifiedStringSearch & ">=" & theYearStart & "-" & theMonthStart & "-" & theDayStart & " 00:00:00 +0200 " & specifiedStringSearch & "<=" & theYearEnd & "-" & theMonthEnd & "-" & theDayEnd & " 23:59:59 +0200")

end tell
end try

Thanks for the tip and the script! You could also use the Info filter (see Tools > Filters) and select a date range. This will filter the current view accordingly. If you prefer a flat list of documents matching the date range, select the “History” smart group in the sidebar first.

Hi Mr. Grunenberg,
i quiet not understand what´s same here.
In the Date Picker i just can pick one Date from a Calendar, not a Range ? (did i miss that?)
Before i can pick the Date i must first watch the details from the File itself, to choose afterwards the corresponding date for only ONE day ?
That seems a lot of complicated Steps for only one Date from a File itself, manually picked ?

With the Script i can highlight a Document in devonthink, type my Shortcut and answer 2 Questions to

  1. What corresponding Date should be picked
  2. What Range of Days it should select

For now it looks for me completely different from what i do with the Script ?
Or do i miss the Range modifier picked from the File itself somewhere ?

Manually Picking a Date also works with the Search Window and the + Button, but also here you need an crazy amount of time to select that Date-range.

02
18

as always, i would use an easier way if i know it…

You can actually select a range by clicking on the start first and then shift-clicking on the end. But you’re right, this is only useful if you know the range and don’t have to look it up.

BTW:
Instead of…

tell application "System Events"
		
		tell application "System Events" to keystroke "f" using {command down, option down}
		delay 0.2
		
		keystroke specifiedStringSearch & ">=" & theYearStart & "-" & theMonthStart & "-" & theDayStart & " 00:00:00 +0200 " & specifiedStringSearch & "<=" & theYearEnd & "-" & theMonthEnd & "-" & theDayEnd & " 23:59:59 +0200"
		
		
		
	end tell

…you could use…

	set search query of viewer window 1 to (specifiedStringSearch & ">=" & theYearStart & "-" & theMonthStart & "-" & theDayStart & " 00:00:00 +0200 " & specifiedStringSearch & "<=" & theYearEnd & "-" & theMonthEnd & "-" & theDayEnd & " 23:59:59 +0200")
1 Like

thank you for the improved direct access to the search window.
i changed this part in the first post to make it easier.
how the colors in that post work i not know right now, maybe i should read it somewhere.