Every time I open DEVONthink, the last documents that were still open when I quit the application are re-opened on launch of the app. I have the the setting about Close windows in System Preferences already enabled. Other than closing the documents first, is there a way to prevent the documents from re-opening.
Actually documents or databases?
Documents
Currently the only option would be to use a script which is executed by a smart rule on quit and which closes all documents.
This Smart Rule script closes all windows.
Set property onlyDocumentWindows
to false
to also close viewer windows.
-- Smart Rule Script - Close windows
property onlyDocumentWindows : true
on performSmartRule(theRecords)
tell application id "DNtp"
try
if onlyDocumentWindows then
set theWindows to document windows
else
set theWindows to think windows
end if
repeat with i from 1 to (count theWindows)
close item i of theWindows
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
return
end try
end tell
end performSmartRule
1 Like
Perfect! Thank you for the script. This has been a bother for awhile, and you have made my day.
1 Like
Or a bit more simply…
property onlyDocumentWindows : true
on performsmartrule()
tell application id "DNtp"
if onlyDocumentWindows then
close every document window saving yes
else
close every think window
end if
end tell
end performsmartrule
1 Like
Yeah, I used a script that closes every window except the current on as template, so didn’t try every
.
The next release will include this and complement the already available Close All Databases script.
1 Like