If I add a new document to an Indexed Folder, then the added item is reflected immediately when I view the Group which references the indexed folder.
However if I add a Folder to the Indexed Folder, then that new Folder is not immediately recognized when viewing the Group. The new subfolder is recognized instead in one of two situations: (1) Adding a new document to the indexed folder; or (2) Choosing Update Indexed Items from the DT3 File menu.
Can you try it by adding to the indexed folder a subfolder which contains several items?
I have not figured out the exact threshold, but in trying it again just now a blank subfolder gets added properly. A subfolder with one small file works fine. But a subfolder with 5 larger items is not added until I choose Refresh. I don’t know if it is the number or the size of items that matters - is there a reason why either one would make a difference in whether the subfolder is automatically detected?
That’s a different matter and I just confirmed the behavior by creating a folder in the indexed folder in Dropbox online. The new folder isn’t detected.
This is likely not generating a filesystem event that DEVONthink detects.
There is a shortcut set of keystrokes to “Update Indexed Items.” Is there not a way to write a triggered script that executes that set of keystrokes?
Is there a way? Technically, yes though something appears to not be triggering properly. Also, triggered scripts don’t seem to trigger in the Navigate sidebar, but @cgrunenberg would have to comment on that.
Note I generally do not suggest trying to rely on System Events to do things like this as they often are fragile and fiddly.
This is a snippet (and the beeps are for debugging), but again it’s not triggering all the time.
on triggered(theRecord)
tell application id "DNtp"
if (type of theRecord as string) = "group" then
if (indexed of theRecord) = true then
beep 1
my keys()
beep 2
end if
end if
end tell
end triggered
on keys()
tell application "System Events"
tell application process "DEVONthink 3"
keystroke "s" using {command down, option down}
end tell
end tell
end keys