Bug: Subfolders do not Trigger Update Indexed Items

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.

if I add a Folder to the Indexed Folder

Indexed from where?

Indexed from a parent Dropbox folder

Just tried this but works as expected. Do you use the default Dropbox folder?

No - I use a folder called Devonthink Email which is a subfolder of the default Dropbox folder.

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?

How do you exactly create the subfolder and its items? This might be important.

My plan in “Production” is for the subfolder and its items to be created by Zapier; I am using that to link my Office 365 Email with Dropbox.

But for testing purposs right now I am simply creating items in my local Dropbox folder/subfolders using Finder.

Does this also happen while the Dropbox.app isn’t running?

I just saw this happen once - Dropbox app is not running - but now I can’t reproduce it.

  1. Indexed a group with some items in it.
  2. Added a new folder via Shift-Command-N in the Finder and it didn’t appear in the database.
  3. File > Updated Indexed Items cause it to appear and now it’s not reproducible.

For my local testing using finder, it works perfectly if the Dropbox.app is not running - so you may well be on to something here.

For my local testing, the problem recurs again when I turn the Dropbox.app back on.

For the updates using Zapier, it could not possibly work with the Dropbox.app off because the local indexed folder would not update in that case.

  • Are you using Smart Sync so the items are only in the cloud, not stored locally?

  • Do you see the issue with a folder in a non-Dropbox location?

Smart Sync was on for my “local” testing - now with Smart Sync off it behaves fine locally.

But Smart Sync is off for the folder I use with Zapier - and the problem persists.

I do not see the issue with a non-Dropbox location. The problem is with items synced to my computer by Dropbox.

The problem is with items synced to my computer by Dropbox.

Are you creating the folder on a different machine than DEVONthink is running then letting Dropbox sync the folder to a machine running DEVONthink?

Essentially yes

The folder is being created by Zapier and then synced to my Devonthink computer

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.

Is it possible for me to attach a script to the Group so it updates the index every time I view the Group contents?

No. There is a synchronize command but it doesn’t work with triggered scripts.

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
1 Like